document parsing XML (SAX)


EJB design: document parsing XML (SAX)

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

        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.

    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.


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

    Check the file you know java takes "\" as escape 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 it throws you file not found exception....