Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JAVA DOM API to read xml

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

  •  
    Greenhorn
    Posts: 18
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • 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
      Number of slices to send:
      Optional 'thank-you' note:
    • 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
     
    Bartender
    Posts: 1952
    7
    Eclipse IDE Java
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • 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
     
    You totally ruined the moon. You're gonna hafta pay for that you know. This tiny ad agrees:
    We need your help - Coderanch server fundraiser
    https://coderanch.com/t/782867/Coderanch-server-fundraiser
    reply
      Bookmark Topic Watch Topic
    • New Topic