Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to use a parser with crimson XmlDocumentBuilder

843834Jul 23 2001 — edited Nov 7 2001
Hi,
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

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 5 2001
Added on Jul 23 2001
3 comments
197 views