Can't parse entities
Added by Anonymous almost 20 years ago
Legacy ID: #2883337 Legacy Poster: pdupin (pdupin)
Hello, I'm trying to parse system entities declared in XML Doctype with saxon, but without success. I use the example Echo12.java, just changing validating property to false, (http://java.sun.com/xml/jaxp/dist/1.1/docs/tutorial/sax/8_lex.html) based on file slideSample10.xml <!DOCTYPE slideshow SYSTEM "slideshow3.dtd" [ <!ENTITY product "WonderWidget"> <!ENTITY products "WonderWidgets"> <!-- FOR WALLY / WALLIES --> <!ENTITY copyright SYSTEM "copyright.xml"> ]> When I run this example with xerces, it works OK. So, why saxon is not parsing those entities ? Thanks a lot.
Replies (2)
RE: Can't parse entities - Added by Anonymous almost 20 years ago
Legacy ID: #2883525 Legacy Poster: Michael Kay (mhkay)
Saxon doesn't actually do XML parsing itself, it delegates that job to the XML parser. You can choose which XML parser to use, for example Crimson or Xerces. In JDK 1.4 the default is Crimson, in JDK 1.5 this changes to Xerces. You don't actually say how it's failing, which makes it difficult to give you advice. The error message may not mean much to you, but it would give me a useful clue. The example Echo11 that you cite is an example of how to handle lexical events from an XML parser. Since Saxon isn't an XML parser, I can't quite see where it comes into the picture. What exactly are you doing? Michael Kay
RE: Can't parse entities - Added by Anonymous almost 20 years ago
Legacy ID: #2884947 Legacy Poster: pdupin (pdupin)
Thank you Michael. Your response has solved my problem, due to the parser Aelfred I was using with an older version of saxon (for compatibility reasons). I have changed it for xerces and it works good now (it works good with crimson too). Aelfred didn't trap unparsedEntities of DTDHandler interface. Thank you.
Please register to reply