Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

DOM deferred node

 
Venkata Pavan Kumar vemuri
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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
Posts: 13058
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not using any xerces j library....
 
Paul Clapham
Sheriff
Pie
Posts: 20955
31
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic