Using a SAX parser, is there a way to include a local...
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Thomas_Liebmann
Posted On:   Tuesday, January 30, 2001 02:24 AM

Using a SAX parser, is there a way to include a local DTD file when parsing an XML message that doesn't contain a DOCTYPE tag?

Re: Using a SAX parser, is there a way to include a local...

Posted By:   AlessandroA_Garbagnati  
Posted On:   Monday, May 14, 2001 02:40 PM

Hi,

There is a way to achieve that.

Check the org.xml.sax.EntityResolver interface:

If a SAX application needs to implement customized handling for external entities, it must implement this interface and register an instance with the SAX parser using the parser's setEntityResolver method.



The parser will then allow the application to intercept any external entities (including the external DTD subset and external parameter entities, if any) before including them.



Many SAX applications will not need to implement this interface, but it will be especially useful for applications that build XML documents from databases or other specialised input sources, or for applications that use URI types other than URLs.

Re: Using a SAX parser, is there a way to include a local...

Posted By:   Luigi_Viggiano  
Posted On:   Monday, May 14, 2001 01:01 PM

SAX API is for parsing purposes, and you cannot modify the XML while parsing.

To include a local DTD in the input xml just put the DOCTYPE line in the top of your XML:




...

About | Sitemap | Contact