Discussions

EJB design: document parsing XML (SAX)

  1. document parsing XML (SAX) (1 messages)

    Hi,
        I am useing SAX for XML parsing. I need to parse a file wich is reside in the location "c:\xml\1234242345\name.xml."
         And i am trying to parse the same from different location. i.e from "weblogic class path directory".Then it is giving file not found.

      ex:
    org.w3c.dom.Document doc=(org.w3c.dom.Document)docbuilder.parse("c:xml\xml-log.xml");

    if i placed the same file at the weblogic class path folder it is parseing the file.But i need to place it out side.


    regards,

    Vara prasad
  2. document parsing XML (SAX)[ Go to top ]

    Hi,
    Check the file path.....as you know java takes "\" as escape character.....so your code segment shuld like this.....

    org.w3c.dom.Document doc=(org.w3c.dom.Document)docbuilder.parse("c:\\xml
    xml-log.xml");....This should work fine for you.

    In your code segment what parse() method receives is "c:xmlxml-log.xml"....this isnt your file...so it throws you file not found exception....

    Regards