entity and resource resolution for source doc

Added by Anonymous about 18 years ago

Legacy ID: #3527832 Legacy Poster: Roger I Martin (martin3)

Using 8.6.1 I'm trying to resolve entities and resources locally. I've gotten the source parser ((TransformerFactoryImpl)factory).getConfiguration().setSourceParserClass(""); System.out.println("set svg entity resolver "+((TransformerFactoryImpl)factory).getConfiguration().getSourceParserClass()); org.xml.sax.XMLReader svgReader=((TransformerFactoryImpl)factory).getConfiguration().getSourceParser(); svgReader.setEntityResolver(new com.neuralworks.xml.svg.sax.SVGEntityResolver()); ... set a entity resolver and continue getting: --- set svg entity resolver vector objects C:\lg3d\bin..\ext\dynamic\anim01.svg Error net.sf.saxon.xpath.DynamicError: at net.sf.saxon.event.Sender.sendSAXSource( at net.sf.saxon.event.Sender.send( at net.sf.saxon.event.Sender.send( at net.sf.saxon.Controller.transform( at org.jdesktop.lg3d.dynamic.x3d.util.Operation.transform( at org.jdesktop.lg3d.dynamic.x3d.Producer.<init>( --- The source document starts with: --- <?xml version="1.0" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" ""> <svg width="8cm" height="3cm" viewBox="0 0 800 300" xmlns="" version="1.1"> --- Setting factory.setURIResolver() does get called for stylesheet includes and are resolved. Every attempt at resolving the source document offline has failed. I've tried before and after setting up the template for the stylesheet. Not certain when and where the resolver should be set. When I am working directly with the xerces XMLReader everything in my source docs resolve.

Replies (1)

RE: entity and resource resolution for source - Added by Anonymous about 18 years ago

Legacy ID: #3527935 Legacy Poster: Michael Kay (mhkay)

It's not clear to me where you are setting the EntityResolver. The cleanest approach is to supply the source document as a SAXSource, with the SAXSource containing its own XMLReader preconfigured to use your EntityResolver. Another approach is to subclass the XMLReader, and nominate your subclass as the SourceParserClass - your subclass can then set the EntityResolver on its base class (or you can do the same by nominating an XMLFilter as the SourceParser).


    Please register to reply