wood burning stoves 2.0*
The moose likes XML and Related Technologies and the fly likes DOM deferred node Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "DOM deferred node" Watch "DOM deferred node" New topic
Author

DOM deferred node

Venkata Pavan Kumar vemuri
Greenhorn

Joined: Feb 01, 2010
Posts: 14


hi all,

I am trying to implement the deferred node concept of DOM parser

I have created an instance of Documentbuilderfactory and used it to set the deferred node property and classname as follows

dbf.setFeature("http://apache.org/xml/features/dom/defer-node-expansion", true );
dbf.setAttribute("http://apache.org/xml/properties/dom/document-class-name", "org.apache.xerces.dom.DocumentImpl" );

But I am getting the following error

Exception in thread "main" java.lang.IllegalArgumentException: MissingDocumentClassName: The class name of the document factory "org.apache.xerces.dom.DocumentImpl" used to construct the DOM tree could not be found.
at com.sun.org.apache.xerces.internal.parsers.AbstractDOMParser.setDocumentClassName(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractDOMParser.reset(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
at DOMParserNV.DOMParser(DOMParserNV.java:35)
at DOMParserNV.main(DOMParserNV.java:69)


Can somebody please tell me wht is wrong with my implementation

Thanks in advance
Pavan
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12806
    
    5
Which version of the Xerces-J library are you using?

Unfortunately, the JavaDocs I could find for org.apache.xerces.dom.DocumentImpl did not state when it was introduced.

Bill
Venkata Pavan Kumar vemuri
Greenhorn

Joined: Feb 01, 2010
Posts: 14
I am not using any xerces j library....
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18669
    
    8

Then I suppose you will have to download one and put it in your classpath. Probably the latest version would work, but if wherever you heard about those properties mentions anything about some versions working and some not working, then pay attention to whatever it said.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: DOM deferred node