How to use a parser with crimson XmlDocumentBuilder
843834Jul 23 2001 — edited Nov 7 2001Hi,
I'd be very grateful for any help on the following...
I used to use the following code to parse an Xml document, using a SimpleElementFactory to create my own class Element nodes...
XmlDocumentBuilder builder = new XmlDocumentBuilder();
parser = new com.sun.xml.tree.ValidatingParser();
parser.setDocumentHandler( builder );
..
..
parser.parse( in );
Docuent doc = buider.getDocument();
This worked fine using the project X code. However after migrating to the crimson code I can't find a way to link my XmlDocumentBuilder with the parser.
com.apache.crimson.parser.ValidatingParser seems to have no methods to link it to a com.apache.crimson.tree.XmlDocumentBuilder. If I follow a similar pattern to before the getDocument call returns null as the parser is not linked to the builder.
Please could someone point out my obvious mistake!
Many thanks