Project

Profile

Help

Using an External XML Parser

Added by Anonymous over 19 years ago

Legacy ID: #3034097 Legacy Poster: Greg Mellinger (mellingg)

I would like to use an external parser such as James Clark's nsgmls for validating my source XML. How do I modify the command-line to use nsgmls and how do I specify the command-line arguments such as the command-line argument that denotes the catalog file for resolving FPIs?


Replies (4)

Please register to reply

RE: Using an External XML Parser - Added by Anonymous over 19 years ago

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

You can use any external parser that conforms to the SAX2 interface using the -x option, provided that the parser can be configured entirely using Java system properties. I don't believe either of these conditions is true for nsgmlns. In this case you need to do the integration in Java, or using some kind of pipeline processing language that supports both products. You may have to write a SAX2 front-end to the parser and supply that as a SAXSource to Saxon. The SAXSource contains an instance of the parser as an XMLReader, which you can fully configure using all the parser's Java API. Alternatively, if this is too difficult, you can get the external parser to product a DOM which you then supply as a DOMSource input to Saxon. Michael Kay Saxonica

RE: Using an External XML Parser - Added by Anonymous over 19 years ago

Legacy ID: #3034967 Legacy Poster: Greg Mellinger (mellingg)

If I use Crimson as my XML Parser, how do I determine the token that is placed after the '-x' command-line option? Also, how do the external parsers resolve FPIs in the DTD? Are they all resolved using URIResolver()?

RE: Using an External XML Parser - Added by Anonymous over 19 years ago

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

The name of the XMLReader implementation should be available from the documentation of any parser that claims to be SAX2-compliant. However, you're right - it can be wretchedly difficult to find. But googling for Crimson XMLReader implementation class takes you straight there. org.apache.crimson.parser.XMLReaderImpl Michael Kay

RE: Using an External XML Parser - Added by Anonymous over 19 years ago

Legacy ID: #3035128 Legacy Poster: Greg Mellinger (mellingg)

Thanks Mike!

    (1-4/4)

    Please register to reply