File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes JAVA DOM API to read xml 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 "JAVA DOM API to read xml" Watch "JAVA DOM API to read xml" New topic
Author

JAVA DOM API to read xml

munch Chaudhary
Greenhorn

Joined: Sep 08, 2008
Posts: 3


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

Joined: Aug 31, 2008
Posts: 47
  • 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


  • Author of VFSJFileChooser and XPontus XML Editor
    Anthony Castillon
    Greenhorn

    Joined: Nov 30, 2001
    Posts: 18
    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

    Joined: Nov 30, 2001
    Posts: 18
    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

    Joined: Mar 10, 2008
    Posts: 1666
        
        7

    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


    Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: JAVA DOM API to read xml
     
    Similar Threads
    Applet and XML Doc through a browser
    help with web service to display xml file contents using netbeans
    How to parse this xml response from server -- tag Data1 is repeating itself?
    Updating Xml Element values
    Java Web Services 2