How to parse XML file with namesapce?

Hi,
   I am trying to parse an xml file having namespace. But no data is returned.
Sample Code:
public class XMLFileLoader
var xml:XML = new XML();
var myXML:XML = new XML();
var XML_URL:String = "file:///C:/Documents and Settings/Administrator/Desktop/MyData.xml";
var myLoader:URLLoader = null;
public function XMLFileLoader()
var myXMLURL:URLRequest = new URLRequest(XML_URL);
myLoader= new URLLoader(myXMLURL);
myLoader.addEventListener(Event.COMPLETE,download);
public function download(event:Event):void
myXML = XML(myLoader.data);
var ns:Namespace=myXML.namespace("xsi");
for(var prop:String in myXML)
     trace(prop);
//Alert.show(myXML..Parameters);
//trace("Data loadedww."+myXML.toString());
//Alert.show(myXML.DocumentInfo.attributes()+"test","Message");
The XML Contains the following format.
<Network xmlns="http://www.test.com/2005/test/omc/conf"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://www.test.com/2005/test/omc/conf/TestConfigurationEdition3proposal4.xsd">
    <TestDomain>
      <WAC>
        <!--Release Parameter  -->
        <Parameters ParameterName="ne_release" OutageType="None"
                    accessRight="CreateOnly" isMandatory="true"
                    Planned="false"
                    Reference="true" Working="true">
          <DataType>
            <StringType/>
          </DataType>
          <GUIInfo graphicalName="Release"
                   tabName="All"
                   description="Describes the release version of the managed object"/>
        </Parameters>
</TestDomain>
</Network>
Any sample code how to parse this kind of xml file with namespaces...
Regards,
Purushotham

i have exactly the same problem with KXml2, but using a j2me-polish netbeans project.
i've tried to work around with similar ways like you, but none of them worked. now i've spent 3 days for solving this problem, i'm a bit disappointed :( what is wrong with setting the downloaded kxml2 jar path in libraries&resources?
screenshot

Similar Messages

  • How to validate xml file with XSD schema ??  in JDK1.4.2

    How to validate xml file with XSD schema ?? in JDK1.4.2
    i dont want to use new Xerec Jar ...
    Suggest option ...

    Please do not double-post. http://forum.java.sun.com/thread.jspa?threadID=5134447&tstart=0
    Then use Stax (Woodstock) or Saxon.
    - Saish

  • How to parse xml file in midlet

    Hi Guys,
    i wish to parse xml file and display it in my midlet. i found api's supporting xml parsing in j2se ie., in java.net or j2se 5.0. Can u please help me what package to use in midlet?
    how to parse xml info and display in midlet? Plz reply soon......Thanks in advance....

    i have exactly the same problem with KXml2, but using a j2me-polish netbeans project.
    i've tried to work around with similar ways like you, but none of them worked. now i've spent 3 days for solving this problem, i'm a bit disappointed :( what is wrong with setting the downloaded kxml2 jar path in libraries&resources?
    screenshot

  • Parsing XML file with different languages (Xerces)

    How do we code or program to an XML file with different
    languages , say english and spanish. WHen we parse such a document with the default locale , the presence of special characters throws errors .For eg when I use xerces and use
    DOMParser parser = new DOMParser();
    try
    // Parse the XML Document
    parser.parse(xmlFile);
    catch (SAXException se)
    se.printStackTrace();
    org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0xfc) was found in the element content of the document.
    System Error:          void org.apache.xerces.framework.XMLParser.parse(org.xml.sax.InputSource)
    So what locale do we set before we parse ?How to handle this problem

    You need an encoding attribute in the xml declaration. If you don't, the parser assumes UTF-8, which are ASCII characters up to 127 - useful (only) for English.
    So, something like this would allow you to use characters above 127, ISO-8859-1 is the encoding used by standard PCs.
    <?xml version="1.0" encoding="ISO-8859-1"?>
    You can find a (offical) list of encodings at:
    http://www.iana.org/assignments/character-sets
    I'm not sure about mixing various encodings. I think you have to resort external parsed entities, which can have their own encoding, but I think you cannot mix encodings in one XML file.
    Good luck.

  • How to parse XML files from normal FTP Servers?

    I want to parse xml files from a normal FTP Servers , NOT the sap application severs itself. How can i do that?
    I know how to use the SAPFTP getting and putting files ,but I don't want to download and then parse it.
    Who knows how to parse it directly? I Just need to read the contents into a database.
    Thanks.

    I want to parse xml files from a normal FTP Servers , NOT the sap application severs itself. How can i do that?
    I know how to use the SAPFTP getting and putting files ,but I don't want to download and then parse it.
    Who knows how to parse it directly? I Just need to read the contents into a database.
    Thanks.

  • How to Create XML file with SAX parser instead of DOM parser

    HI ALL,
    I am in need of creating an XML file by SAX parser ONLY. As far as my knowledge goes, we can use DOM for such purpose(by using createElement, creatAttribute ...). Can anyone tell me, is there any way to create an XML file using SAX Parser only. I mean, I just want to know whether SAX provides any sort of api for Creatign an element, attribute etc. I know that SAX is for event based parsing. But my requirement is to create an XML file from using only SAX parser.
    Any help would be appreciated
    Thanx in advance
    Kaushik

    Hi,
    You must write a XMLWriter class yourself, and that Class extends DefaultHandle ....., the overwrite the startElement(url, localName, qName, attributeList), startDocument(), endElement().....and so on.
    in startElement write your own logic about how to create a new element and how to create a Attribute list
    in startDocument write your own logic about how to build a document and encodeType, dtd....
    By using:
    XMLWriter out = new XMLWriter()
    out.startDocument();
    Attribute attr1 = new Atribute();
    attr1.add("name", "value");
    out.startElement("","","Element1", attr1);
    Attribute attr2 = new Atribute();
    attr2.add("name", "value");
    out.startElement("","","Element2", attr2);
    out.endElement("","","Element2");
    out.endElement("","","Element1");
    out.endDocument();

  • How to parse xml file

    Hi,
    I am having an XML file which is having set of repeated tags like
    <gender>
    <male>
    <name>sk</name>
    <age>19</age>
    </male>
    <male>
    <name>raj</name>
    <age>20</age>
    </male>
    <male>
    <name>kris</name>
    <age>18</age>
    </male>
    </gender>
    Like this i am having the xml file, i have to read the values from this xml file, here we are having male tag is repeated, from this i have to take the name, and age values. can you tell me how to take these values. If you are having the sample send me.
    Thanks,

    Hai
    It may be a bit late to reply but i hope this code will help you
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import java.io.*;
    import java.io.File;
    import org.w3c.dom.*;
    class DomParse
         public void func()
              try               
                   DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();               
                   DocumentBuilder db = dbf.newDocumentBuilder();               
                   //File f =new File("trial.xml");
                   Document doc = db.parse(new File("trial.xml")); //your xml file name here
                   //Document doc = db.parse(f);
                   NodeList nl1 = doc.getElementsByTagName("male");
                   for(int i=0;i<nl1.getLength();i++)
                        Node nd = nl1.item(i);
                        NodeList tmplist = nd.getChildNodes();
                        for(int j=0;j<tmplist.getLength();j++)
                             Node tmpNode = tmplist.item(j);
                             String locStr = tmpNode.getTextContent();
                             System.out.println(""+tmpNode.getTextContent());
              catch(Exception e)
                   System.out.println("Error: "+e);
                   e.printStackTrace();
         public static void main(String[] args) //throws
              new DomParse().func();
    with regards
    shan

  • How to parse xml file to read the tags

    Hi All,
    I am having a requirement to read the tags from the xml file(xml parsing).
    The main issue is *xml file is stored in the table with xml type column* (not placed directly in the server) and we have to read the tags from that xml file.
    Please help me to achieve it.
    Regards,
    Akshata
    Edited by: Akshata on Mar 21, 2013 3:44 AM

    Hi,
    Akshata wrote:
    The main issue is xml file is stored in the table clob/blob type column (not placed directly in the server) and we have to read the tags from that xml file.How is that an issue? On the contrary, it's better when the data already resides in the database, though it should be in an XMLType column to leverage the full capacity of the Oracle parser.
    What's the datatype of the column exactly? CLOB or BLOB?
    Either way you'll have to convert in to XMLType datatype using the XMLType constructor.
    Did you go through the countless examples on this forum? Examples with XMLTable should be helpful.
    Post some sample data and database version if you need additional guidance.
    Thanks.

  • Parse xml file with validating againat dtd

    i have a xlm file looks like:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE map SYSTEM "map.dtd">
    <map width="20" height="15" goal="25" name="eXtreme Labyrinth of Dooom">
    <random-item type='lantern' amount='5' />
    <random-item type='health' amount='10' />
    <tile x="14" y="0" type="wall">
    <renderhint>wall:rock,cracked</renderhint>
    </tile>
    <tile x="15" y="0" type="wall" />
    <tile x="16" y="0" type="floor">
    <renderhint>floor:marble,cracked</renderhint>
    </tile>
    <tile x="17" y="0" type="floor">
    <renderhint>floor:stone,rubble</renderhint>
    </tile>
    <tile x="18" y="0" type="floor" />
    <tile x="0" y="1" type="floor" />
    <tile x="1" y="1" type="floor" startlocation="1" />
    <tile x="2" y="1" type="floor" />
    <tile x="3" y="1" type="floor">
    <item type="treasure">Bar of Silver</item>
    <renderhint>floor:stone,blood</renderhint>
    </tile>
    <tile x="4" y="1" type="wall" />
    <tile x="5" y="1" type="wall" />
    <tile x="6" y="1" type="wall">
    <renderhint>wall:bricks,cracked</renderhint>
    </tile>
    </map>and a dtd document like:
    <!ELEMENT map (random-item+, tile+)>
    <!ATTLIST map
    width CDATA #REQUIRED
    height CDATA #REQUIRED
    goal CDATA #REQUIRED
    name CDATA #REQUIRED
    <!ELEMENT random-item EMPTY>
    <!ATTLIST random-item
    type (armour|health|sword|treasure|lantern) #REQUIRED
    amount CDATA #REQUIRED
    <!ELEMENT tile (item|renderhint)*>
    <!ATTLIST tile
    x CDATA #REQUIRED
    y CDATA #REQUIRED
    type (exit|floor|wall) #REQUIRED
    startlocation CDATA #IMPLIED
    <!ELEMENT item (#PCDATA)>
    <!ATTLIST item
    type (armour|health|sword|treasure|lantern) #REQUIRED
    <!ELEMENT renderhint (#PCDATA)>i need to validate the xml file against the dtd document and parse it to java using DOM.
    Can anyone give ma any suggestions on how to do it?
    thank you

    i have started my coding like:
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.ParserConfigurationException;
    import org.w3c.dom.*;
    import org.xml.sax.SAXException;
    import java.io.*;
    class loadxml
        public static void main(String[] args)
         try {
              DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
              factory.setValidating(true);
              factory.setIgnoringElementContentWhitespace(true);
              DocumentBuilder parser = factory.newDocumentBuilder();
              Document doc = parser.parse(new File("hallways.xml"));
              loadxml load = new loadxml();
              load.parseNode(doc);
         } catch (ParserConfigurationException e) {
              e.printStackTrace();
         } catch (SAXException e) {
              e.printStackTrace();
         } catch (IOException e) {
              e.printStackTrace();
        public void parseNode (Node node) throws IOException
               // here is where i have problem with
    }since in my xml file, i have got ATTLIST, this ready confuses me when i try to coding it.
    Can anyone help me, please.
    Thank you.
    Edited by: mujingyue on Mar 12, 2008 3:10 PM

  • How to parse xml file, containing image,  generaged from JAX-RS connector?

    Hi,
    We are using JAX-RS connector and just want to call getBusinessObjects() directly using JerseyMe (basically bypassing sync engine). We have used sync engine so far and want to try as how to bypass it. The method produces the text/xml and verified the xml file in the web by giving the full url. The plan is to call the same URL from the Java Me Client using JerseyMe. When I print the bytes at the client I receive the same xml that I have seen in the web. Actually, I am passing an image that I can see in a different character format in xml (assuming this is bcos of UTF-8 encoding). I am wondering as how to parse this xml file and how to decode the "UTF-8" format? Do we need to use SGMP for this or use kxml or java me webservices spec.
    I would really appreciate if somebody can answer this one.
    I have been observing in this forum that SGMP team is not at all active in answering the questions. Please let us know whether Oracle is keeping this product and we can continue using SGMP1.1. Please let us know so that we can plan accordingly as we are building a product based on SGMP.

    Hi Rajiv,
    The client library is using org.apache.commons.codec.binary.Base64 internally. We don't have the full Commons Codec library bundled, but you can look up the javadoc for the Base64 class online. All you need to do is call Base64.decode(obj.getBytes()) on the objects you get out of the XML.
    In general it isn't a good idea to depend on implementation details of the client library, but in this case, I think it is pretty safe to expect org.apache.commons.codec.binary.Base64 to remain in our library.
    --Ryan                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Parsing XML file with the word "Infinity" in it

    I am having a problem within Flex that parses an XML file,
    one of the text names within the file contains the word "Infinity".
    Unfortunately this is a constant within Flex and the element of my
    array does not think it is a text string but a value. I have tried
    type setting the xml element, and putting escape characters around
    the text but nothing works. If I change the text to lowercase
    "infinity" it works fine.
    Any help greatly appreciated.

    This sounds like a bug. Can you file it, with a small code
    example that illustrates it, here:
    http://bugs.adobe.com/jira
    Thanks!
    matt horn
    flex docs

  • Parse XML file with regex

    Hi,
    Is that possible to parse a xml file using regular expressions....if s what is the API needed
    thanx in advance

    Is that possible to parse a xml file using regular
    expressions....if s what is the API neededI'm sure it can be done. Here's the regex API:
    http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/package-summary.html
    http://www.javaregex.com/tutorial.html
    But that's not where regex is for. Better have a look at this:
    http://java.sun.com/xml/

  • How to generate xml file with multiple nodes using sqlserver as database in SSIS..

    Hi ,
    I have to generate the xml file using multiple nodes by using ssis and database is sqlserver.
    Can some one guide me on to perform this task using script task?
    sudha

    Why not use T-SQL for generating XML? You can use FOR XML for that
    http://visakhm.blogspot.in/2014/05/t-sql-tips-fun-with-for-xml-path.html
    http://visakhm.blogspot.in/2013/12/generating-nested-xml-structures-with.html
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • How to parse XML document with default namespace with JDOM XPath

    Hi All,
    I am having difficulty parsing using Saxon and TagSoup parser on a namespace html document. The relevant content of this document are as follows:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    </head>
    <body>
        <div id="container">
            <div id="content">
                <table class="sresults">
                    <tr>
                        <td>
                            <a href="http://www.abc.com/areas" title="Hollywood, CA">hollywood</a>
                        </td>
                        <td>
                            <a href="http://www.abc.com/areas" title="San Jose, CA">san jose</a>
                        </td>
                        <td>
                            <a href="http://www.abc.com/areas" title="San Francisco, CA">san francisco</a>
                        </td>
                        <td>
                            <a href="http://www.abc.com/areas" title="San Diego, CA">San diego</a>
                        </td>
                  </tr>
    </body>
    </html>
    Below is the relevant code snippets illustrates how I have attempted to retrieve the contents (value of  <a>):
                 import java.util.*;
                 import org.jdom.*;
                 import org.jdom.xpath.*;
                 import org.saxpath.*;
                 import org.ccil.cowan.tagsoup.Parser;
    ( 1 )       frInHtml = new FileReader("C:\\Tmp\\ABC.html");
    ( 2 )       brInHtml = new BufferedReader(frInHtml);
    ( 3 ) //    SAXBuilder saxBuilder = new SAXBuilder("org.apache.xerces.parsers.SAXParser");
    ( 4 )       SAXBuilder saxBuilder = new SAXBuilder("org.ccil.cowan.tagsoup.Parser");
    ( 5 )       org.jdom.Document jdomDocument = saxbuilder.build(brInHtml);
    ( 6 )       XPath xpath =  XPath.newInstance("/ns:html/ns:body/ns:div[@id='container']/ns:div[@id='content']/ns:table[@class='sresults']/ns:tr/ns:td/ns:a");
    ( 7 )       xpath.addNamespace("ns", "http://www.w3.org/1999/xhtml");
    ( 8 )       java.util.List list = (java.util.List) (xpath.selectNodes(jdomDocument));
    ( 9 )       Iterator iterator = list.iterator();
    ( 10 )     while (iterator.hasNext())
    ( 11 )     {
    ( 12 )            Object object = iterator.next();
    ( 13 ) //         if (object instanceof Element)
    ( 14 ) //               System.out.println(((Element)object).getTextNormalize());
    ( 15 )             if (object instanceof Content)
    ( 16 )                   System.out.println(((Content)object).getValue());
    ….This program would work on the same document without the default namespace, hence, it would not be necessary to include “ns” prefix along in the XPath statements (line 6-7) either. Moreover, I was using “org.apache.xerces.parsers.SAXParser” to have successfully retrieve content of <a> from the same document without default namespace in the past.
    I would like to achieve the following objectives if possible:
    ( i ) Exclude DTD and namespace in order to simplifying the parsing process. How this could be done?
    ( ii ) If this is not possible, how to include it in XPath statements (line 6-7) so that the value of <a> is picked up correctly?
    ( iii ) Would changing from “org.apache.xerces.parsers.SAXParser” to “org.ccil.cowan.tagsoup.Parser” make any difference as far as using XPath is concerned?
    ( iv ) Failing to exlude DTD, how to change the lookup of a PUBLIC DTD to a local SYSTEM one and include a local DTD for reference?
    I am running JDK 1.6.0_06, Netbeans 6.1, JDOM 1.1, Saxon6-5-5, Tagsoup 1.2 on Windows XP platform.
    Any assistance would be appreciated.
    Thanks in advance,
    Jack

    Here's an example of using a custom EntityResolver with the standard DocumentBuilder provided by the JDK. The code may or may not be similar for the parsers that you're using.
    import java.io.IOException;
    import java.io.StringReader;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import org.w3c.dom.Document;
    import org.xml.sax.EntityResolver;
    import org.xml.sax.InputSource;
    import org.xml.sax.SAXException;
    public class ParseExamples
        private final static String COMMON_XML
            = "<music>"
            +     "<artist name=\"Anderson, Laurie\">"
            +         "<album>Big Science</album>"
            +         "<album>Strange Angels</album>"
            +     "</artist>"
            +     "<artist name=\"Fine Young Cannibals\">"
            +         "<album>The Raw & The Cooked</album>"
            +     "</artist>"
            + "</music>";
        private final static String COMMON_DTD
            = "<!ELEMENT music (artist*)>"
            + "<!ELEMENT artist (album+)>"
            + "<!ELEMENT album (#PCDATA)>"
            + "<!ATTLIST artist name CDATA #REQUIRED>";
        public static void main(String[] argv)
        throws Exception
            // this version uses just a SYSTEM identifier - note that it gets turned
            // into a file: URL
            String xml = "<!DOCTYPE music SYSTEM \"bar\">"
                       + COMMON_XML;
            // this version uses both PUBLIC and SYSTEM identifiers; the SYSTEM ID
            // gets munged, the PUBLIC ID doesn't
    //        String xml = "<!DOCTYPE music PUBLIC \"foo\" \"bar\">"
    //                   + COMMON_XML;
            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
            dbf.setValidating(true);
            DocumentBuilder db = dbf.newDocumentBuilder();
            db.setEntityResolver(new EntityResolver()
                public InputSource resolveEntity(String publicId, String systemId)
                    throws SAXException, IOException
                    System.out.println("publicId = " + publicId);
                    System.out.println("systemId = " + systemId);
                    return new InputSource(new StringReader(COMMON_DTD));
            Document dom = db.parse(new InputSource(new StringReader(xml)));
            System.out.println("root element name = " + dom.getDocumentElement().getNodeName());
    }

  • How to compare after parsing xml file

    Hi,
    following code, parse the input.xml file, counts how many nodes are there and writes the node name and its value on screen.
    1) i am having trouble writing only node name into another file instead of writing to screen.
    2) after parsing, i like to compare each node name with another .xsd file for existence.
    Please keep in mind that, input.xml is based on some other .xsd and after parsing i have comparing its tag with another .xsd
    Need you help guys.
    thanks
    * CompareTags.java
    import java.io.*;
    import org.w3c.dom.*;
    import org.xml.sax.*;
    import javax.xml.parsers.*;
    import javax.xml.transform.*;
    import javax.xml.transform.dom.*;
    import javax.xml.transform.stream.*;
    /** This class represents short example how to parse XML file,
    * get XML nodes values and its values.<br><br>
    * It implements method to save XML document to XML file too
    public class CompareTags {
    private final static String xmlFileName = "C:/input.xml";
         int totalelements = 0;
    /** Creates a new instance of ParseXMLFile */
    public CompareTags() {
    // parse XML file -> XML document will be build
    Document doc = parseFile(xmlFileName);
    // get root node of xml tree structure
    Node root = doc.getDocumentElement();
    // write node and its child nodes into System.out
    System.out.println("Statemend of XML document...");
    writeDocumentToOutput(root,0);
                   System.out.println("totalelements in xyz tag " + totalelements);
              System.out.println("... end of statement");
    /** Returns element value
    * @param elem element (it is XML tag)
    * @return Element value otherwise empty String
    public final static String getElementValue( Node elem ) {
    Node kid;
    if( elem != null){
    if (elem.hasChildNodes()){
    for( kid = elem.getFirstChild(); kid != null; kid = kid.getNextSibling() ){
    if( kid.getNodeType() == Node.TEXT_NODE ){
    return kid.getNodeValue();
    return "";
    private String getIndentSpaces(int indent) {
    StringBuffer buffer = new StringBuffer();
    for (int i = 0; i < indent; i++) {
    buffer.append(" ");
    return buffer.toString();
    /** Writes node and all child nodes into System.out
    * @param node XML node from from XML tree wrom which will output statement start
    * @param indent number of spaces used to indent output
    public void writeDocumentToOutput(Node node,int indent) {
    // get element name
    String nodeName = node.getNodeName();
    // get element value
    String nodeValue = getElementValue(node);
    // get attributes of element
    NamedNodeMap attributes = node.getAttributes();
    System.out.println(getIndentSpaces(indent) + "NodeName: " + nodeName + ", NodeValue: " + nodeValue);
    for (int i = 0; i < attributes.getLength(); i++) {
    Node attribute = attributes.item(i);
    System.out.println(getIndentSpaces(indent + 2) + "AttributeName: " + attribute.getNodeName() + ", attributeValue: " + attribute.getNodeValue());
    // write all child nodes recursively
    NodeList children = node.getChildNodes();
              //int totalelements = 0;
    for (int i = 0; i < children.getLength(); i++) {
    Node child = children.item(i);
                   //     System.out.println("child value.."+child);
    if (child.getNodeType() == Node.ELEMENT_NODE) {
    writeDocumentToOutput(child,indent + 2);
                             if(node.getNodeName() == "DATA"){
                             totalelements = totalelements+1;}
                        //System.out.println("totalelements in DATA tag " + totalelements);
    /** Parses XML file and returns XML document.
    * @param fileName XML file to parse
    * @return XML document or <B>null</B> if error occured
    public Document parseFile(String fileName) {
    System.out.println("Parsing XML file... " + fileName);
    DocumentBuilder docBuilder;
    Document doc = null;
    DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
    docBuilderFactory.setIgnoringElementContentWhitespace(true);
    try {
    docBuilder = docBuilderFactory.newDocumentBuilder();
    catch (ParserConfigurationException e) {
    System.out.println("Wrong parser configuration: " + e.getMessage());
    return null;
    File sourceFile = new File(fileName);
    try {
    doc = docBuilder.parse(sourceFile);
    catch (SAXException e) {
    System.out.println("Wrong XML file structure: " + e.getMessage());
    return null;
    catch (IOException e) {
    System.out.println("Could not read source file: " + e.getMessage());
    System.out.println("XML file parsed");
    return doc;
    /** Starts XML parsing example
    * @param args the command line arguments
    public static void main(String[] args) {
    new CompareTags();
    }

    hi,
    check out the following links
    Check this blog to extract from XML:
    /people/kamaljeet.kharbanda/blog/2005/09/16/xi-bi-integration
    http://help.sap.com/saphelp_nw04/helpdata/en/fe/65d03b3f34d172e10000000a11402f/frameset.htm
    Check thi link for Extract from any DB:
    http://help.sap.com/saphelp_nw04s/helpdata/en/58/54f9c1562d104c9465dabd816f3f24/content.htm
    regards
    harikrishna N

Maybe you are looking for

  • Open sales order value for credit check need to be changed (S066)

    Hi all, I need to change open sales order value which is already there in S066 table. Previously we had used open order value for credit check. Open order values are already updated in the S066 table. Now we dont want to consider open order value for

  • How do I get my software to update?

    I have a 3rd gen iPod touch and am using a PC with the latest iTunes. Last night, after weeks of trying, I was able to update my software. Unfortunately, my computer shut down as it was backing up.  This morning i did the same thing I did last  night

  • Mail 2.1.1 recieves but doesn't send mail and gives no error message?

    I've an issue with mail on an I-Mac with 2 gig intel core duo running O/S 10.4.9 and mail app version 2.1.1. I was using the machine at my studio for a studio manager. I downsized the studio and gave that machine to my parents who have been using an

  • Can't download purchased copy of photoshop cs6

    I purchased Photoshop CS6 upgrade this evening and got the emailed receipt with the new serial number.  When I went to download the new upgrade, there was nothing in my account order history for me to download. If I signin to my account directly from

  • Assignments to collection with user groups seems to be failing

    We have a collection with users and a collection with groups.  We assign a simple application to a collection with users, that seems to be fine, we can see the app in the application catalog. We then assign the same app to a collection with just a se