• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JAVA DOM API to read xml

 
munch Chaudhary
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Using above class I can't read my web.xml which contains following line:


Removing this line make my xmlReader read the web.xml entries also.

I know it has smthing to do with the dtd but not sure in what direction to proceed for looking out a solution.

help needed regarding what is the issue here in what could be possible solutions.
 
Yves Zoundi
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
  • Try using a custom EntityResolver to resolve the DTD

  • http://java.sun.com/j2ee/dtds/web-app_2_2.dtd
  • Or disable validation in your DocumentBuilderFactory

  •  
    Anthony Castillon
    Greenhorn
    Posts: 18
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Hi. Why don't you try using XPath to traverse your XML? JDK 1.5 already has an XPath interface which will allow you to use an XPath expression to jump to a node and work with it. I used it to parse XML files and it was pretty fast (well, until the XML file got really big and I had to switch to StAX).

    Hope this helps.
    Anthony
     
    Anthony Castillon
    Greenhorn
    Posts: 18
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Hi. Why don't you try using XPath to traverse your XML? JDK 1.5 already has an XPath interface which will allow you to use an XPath expression to jump to a node and work with it. I used it to parse XML files and it was pretty fast (well, until the XML file got really big and I had to switch to StAX).

    Hope this helps.
    Anthony
     
    Jelle Klap
    Bartender
    Posts: 1951
    7
    Eclipse IDE Java
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Originally posted by Anthony Castillon:
    Hi. Why don't you try using XPath to traverse your XML? JDK 1.5 already has an XPath interface which will allow you to use an XPath expression to jump to a node and work with it. I used it to parse XML files and it was pretty fast (well, until the XML file got really big and I had to switch to StAX).

    Hope this helps.
    Anthony


    For large document processing I've recently been introduced to DataDirect XQuery, which offers an XQJ implementation based on the JSR-255 proposed final draft. It offers stream-based processing of large XML documents using StAX (Woodstox I believe). Coupled with document projection techniques it does a pretty good job of keeping the memory footprint as small as possible. I've really taken a liking to the XQuery approach of processing XML. Unfortunately the DataDirect implementation is fully commercial, so I'm still on the look-out for a solid freeware (preferably open-source) alternative, for use in my private little developement projects
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic