*URGENT * Parsing nd Searching XML with DOM

Hi,
I am Juliana, I am a new grad, a new employee and brand new to XML, I am learning to parse XML with the XML parser for PLSQL.
Please anyone help me how to parse the following XML string so that I will display all the session and its time schedule, or if possible display only the session that I want to display.
Thank you very much for any of your help
Juliana
<Student> Id="9130099">
<Class>
<Session>A-100</Session>
<Session>A-200</Session>
<Session>A-300</Session>
<Session>A-400</Session>
<session>A-500</Session>
</Class>
<Time> At:
<At>10:30</At>
<At>12:30</At>
<At>02:30</At>
<At>04:30</At>
<At>05:30</At>
</time>
</Student>

thx for the replay
1) i thought of using xpath but wanted to know how to do it over DOM
2) i mean that the 3 <item> have other element inside like that:
<item>
<title>Implementing Service-Oriented Architectures (SOA) with the Java EE 5 SDK</title>
  <link>http://java.sun.com/developer/technicalArticles/WebServices/soa3/?feed=JSC</link>
  <description>This article presents concepts and language constructs needed to develop a Service-Oriented Architecture composite application in Java EE 5. It then describes an example application designed to solve a business problem.</description>
  <date />
  </item>and all of them have <title>, <link> etc. I want to get the same values(eg. <title>) from all the 3 <item> and not including the <title> in the begining of xml
3) i am a professional child.....joke....
try to get to your sensitive side...thats way.

Similar Messages

  • I put dom storage on "false" and now I can't do a Google search. A few days ago I could search Google with dom on false. What changed?

    I customized the Firefox using 'about:config' and all the other settings work well with Google search - for example geo_enabled which I set to false.
    The one setting that has suddenly proved problematic is dom_storage. I used it in false mode successfully for months when searching on Google, now the setting has resulted in an inability to search on Google. The Google page with search bar comes up as usual when I open the browser, but with dom storage set to "false" I can't search anything - the Google search bar page just remains static.

    Users who disable DOM storage in IE8 and IE9 are reporting the same problem on Google's web search forum. For that reason, the requirement to allow DOM storage sounds like a change in Google's code rather than a browser-specific issue.
    One Firefox-specific issue is the cookie connection: Firefox appears to use cookie permissions to block DOM storage on a site-by-site basis. So if you block cookies for google.com, the DOM storage problem will kick in.

  • XML parsing a spesific value with DOM

    Hi guys.
    I have the following xml file:
    <channel>
          <title>Java Technology Headlines</title>
          <link></link>
          <description>Technical content and news from java.sun.com, the premier source of information about the Java platform.</description>
          <language>en-us</language>
          <image>
            <title>java.sun.com</title>
            <url>http://developers.sun.com/im/logo_java_grey.gif</url>
            <link></link>
            <width>144</width>
            <hight>40</hight>
            <description>Visit java.sun.com</description>
          </image>   
         <item>
            <title>Implementing Service-Oriented Architectures (SOA) with the Java EE 5 SDK</title>
            <link>http://java.sun.com/developer/technicalArticles/WebServices/soa3/?feed=JSC</link>
            <description>This article presents concepts and language constructs needed to develop a Service-Oriented Architecture composite application in Java EE 5. It then describes an example application designed to solve a business problem.</description>
            <date></date>
         </item>
         <item>
            <title>2006 JavaOne Highlights!</title>
            <link>http://java.sun.com/javaone/sf/?feed=JSC</link>
            <description>In It's a Wrap, read about the doings that kept 14,000 attendees percolating. Winner's Circle lists who won the various drawings. And Incoming T-Shirt! Duck! celebrates the Gosling-MythBusters' Wow factor.</description>
            <date></date>
         </item>
         <item>
            <title>Visit us at JavaOne!</title>
            <link>http://java.sun.com/javaone/sf/?feed=JSC</link>
            <description>We are at the 2006 JavaOne conference this week. Find out about the latest happenings, including session coverage, announcements, articles, blogs, photos, and more. Check out all the JavaOne action at java.sun.com/javaone/sf.</description>
            <date></date>
         </item>
    </channel>    and the following java class.
    public class SimpleDOMExample
      public SimpleDOMExample()
      private static void scanDOMTree(Node node)
        int type = node.getNodeType();
        switch (type)
          case Node.ELEMENT_NODE:
             //System.out.println("Element: " +node.getNodeName());
             if(node.getNodeName().equals("channel")&&node.getNodeName().equals("title"))
                  //&& node.getNodeName().equals("title"))
                 Node fc = node.getFirstChild();
                  //Node sc = fc.getNextSibling();
                System.out.println("the tithe: "+ fc.getNodeValue());}
                   if(node.getNodeName().equals("link")){
                    // if ( node.getNodeName().equals("title") )//&& node.getNodeName().equals("title")
                      Node fc = node.getFirstChild();
                       //Node sc = fc.getNextSibling();
                     System.out.println("the url: "+ fc.getNodeValue());}
            NamedNodeMap attrs = node.getAttributes();
            for (int i = 0; i < attrs.getLength(); i++)
              Node attr = attrs.item(i);
              //System.out.println("Attribute: " +attr.getNodeName() + "=\"" + attr.getNodeValue());
            NodeList children = node.getChildNodes();
            if (children != null)  
              int len = children.getLength();
              for (int i = 0; i < len; i++)
                scanDOMTree(children.item(i));
            break;
          case Node.DOCUMENT_NODE:
            scanDOMTree(((Document)node).getDocumentElement()); 
            break;
          case Node.ENTITY_REFERENCE_NODE:
            //System.out.print("this &"+node.getNodeName()+";");
            break;
          case Node.TEXT_NODE:
           // System.out.println("TEXT: " + node.getNodeValue().trim());
            break;
         public static void main(String argv[])
              DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
              Document document = null;
        try
                   DocumentBuilder builder = factory.newDocumentBuilder();
                   document = builder.parse( new File("java.xml"));
        catch (Exception e)
                   e.printStackTrace();
        if(document!=null)
                   scanDOMTree(document);
    }The questions i have are really simple.
    1) I am trying to get a specific value from the xml.
    for example the <title> after <channel> but i want only this title not the others as well. I can all the titles but i cant get it right for returning only the first. What am i doing wrong?
    2) i also want to parse the same values that are in the <item> for all 3 items but when i am using the
                   if(node.getNodeName().equals("link")){
                     Node fc = node.getFirstChild();
                     System.out.println("the link: "+ fc.getNodeValue());}i get a nullPointerException because the first link is empty under the <title>. If i change it to <description> it works fine.
    The fact is that i dont know how to point it to look a specific tags like only in <item>
    I have some comments in there of the different things i tried...
    Any suggestions??? Pleaseeeee.... :)
    Thx in advance...

    thx for the replay
    1) i thought of using xpath but wanted to know how to do it over DOM
    2) i mean that the 3 <item> have other element inside like that:
    <item>
    <title>Implementing Service-Oriented Architectures (SOA) with the Java EE 5 SDK</title>
      <link>http://java.sun.com/developer/technicalArticles/WebServices/soa3/?feed=JSC</link>
      <description>This article presents concepts and language constructs needed to develop a Service-Oriented Architecture composite application in Java EE 5. It then describes an example application designed to solve a business problem.</description>
      <date />
      </item>and all of them have <title>, <link> etc. I want to get the same values(eg. <title>) from all the 3 <item> and not including the <title> in the begining of xml
    3) i am a professional child.....joke....
    try to get to your sensitive side...thats way.

  • Validate xml with DOM - no grammar found

    Validation with XmlSpy is OK!
    Please help me. My problem is...
    ==========================================================
    // Schema...
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
    <xs:complexType name="ParentType">
    <xs:sequence>
    <xs:element name="parent1" type="xs:string"/>
    </xs:sequence>
    </xs:complexType>
    <xs:complexType name="ChildType">
    <xs:complexContent>
    <xs:extension base="ParentType">
    <xs:sequence>
    <xs:element name="child1" type="xs:string"/>
    </xs:sequence>
    </xs:extension>
    </xs:complexContent>
    </xs:complexType>
    <xs:element name="root">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="element" type="ParentType" maxOccurs="2"/>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:schema>
    ==========================================================
    // Xml-file:
    <?xml version="1.0" encoding="UTF-8"?>
    <root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://pctoiv/etktoiv/Extending.xsd">
    <element xsi:type="ChildType">
    <parent1/>
    <child1/>
    </element>
    <element xsi:type="ParentType">
    <parent1/>
    </element>
    </root>
    =================================================================
    //java code...
    String W3C_XML_SCHEMA = "http://www.w3c.org/2001/XMLSchema";
    String JAXP_SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource";
    String schemaSource = "http://pctoiv/etktoiv/Extending.xsd";
    javax.xml.parsers.DocumentBuilder documentBuilder = null;
    org.w3c.dom.Document xmlDoc = null;
    javax.xml.parsers.DocumentBuilderFactory docBuildFactory =
    javax.xml.parsers.DocumentBuilderFactory.newInstance();
    docBuildFactory.setNamespaceAware(true);
    docBuildFactory.setValidating(true);
    docBuildFactory.setAttribute(JAXP_SCHEMA_SOURCE, W3C_XML_SCHEMA);
    docBuildFactory.setAttribute( JAXP_SCHEMA_SOURCE, schemaSource);
    documentBuilder = docBuildFactory.newDocumentBuilder();
    documentBuilder.setErrorHandler(new MyErrorHandler(System.out));
    xmlDoc = documentBuilder.parse(new java.io.File("Extending.xml"));
    ================================================
    // And errors...
    org.xml.sax.SAXParseException: Document is invalid: no grammar found.
    org.xml.sax.SAXParseException: Document root element "root", must match DOCTYPE root "null".

    Validation with XmlSpy is OK!
    Please help me. My problem is...
    =======================================================
    ==
    // Schema...
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
    elementFormDefault="qualified"
    attributeFormDefault="unqualified">
    <xs:complexType name="ParentType">
    <xs:sequence>
    <xs:element name="parent1" type="xs:string"/>
    </xs:sequence>
    </xs:complexType>
    <xs:complexType name="ChildType">
    <xs:complexContent>
    <xs:extension base="ParentType">
    <xs:sequence>
    <xs:element name="child1" type="xs:string"/>
    </xs:sequence>
    </xs:extension>
    </xs:complexContent>
    </xs:complexType>
    <xs:element name="root">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="element" type="ParentType"
    maxOccurs="2"/>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:schema>
    =======================================================
    ==
    // Xml-file:
    <?xml version="1.0" encoding="UTF-8"?>
    <root
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://pctoiv/etktoiv/Ex
    ending.xsd">
    <element xsi:type="ChildType">
    <parent1/>
    <child1/>
    </element>
    <element xsi:type="ParentType">
    <parent1/>
    </element>
    </root>
    =======================================================
    =========
    //java code...
    String W3C_XML_SCHEMA =
    "http://www.w3c.org/2001/XMLSchema";
    String JAXP_SCHEMA_SOURCE =
    "http://java.sun.com/xml/jaxp/properties/schemaSource";
    String schemaSource =
    "http://pctoiv/etktoiv/Extending.xsd";
    javax.xml.parsers.DocumentBuilder documentBuilder =
    null;
    org.w3c.dom.Document xmlDoc = null;
    javax.xml.parsers.DocumentBuilderFactory
    docBuildFactory =
    javax.xml.parsers.DocumentBuilderFactory.newInstance();
    docBuildFactory.setNamespaceAware(true);
    docBuildFactory.setValidating(true);
    docBuildFactory.setAttribute(JAXP_SCHEMA_SOURCE,
    W3C_XML_SCHEMA);
    docBuildFactory.setAttribute( JAXP_SCHEMA_SOURCE,
    schemaSource);
    documentBuilder =
    docBuildFactory.newDocumentBuilder();
    documentBuilder.setErrorHandler(new
    MyErrorHandler(System.out));
    xmlDoc = documentBuilder.parse(new
    java.io.File("Extending.xml"));
    ================================================
    // And errors...
    org.xml.sax.SAXParseException: Document is invalid: no
    grammar found.
    org.xml.sax.SAXParseException: Document root element
    "root", must match DOCTYPE root "null".
    Try this:
    private static final String JAXP_SCHEMA_SOURCE
    = "http://java.sun.com/xml/jaxp/properties/schemaSource";
    private static final String JAXP_SCHEMA_LANGUAGE
    = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
    private static final String W3C_XML_SCHEMA
    = "http://www.w3.org/2001/XMLSchema";
    docBuildFactory.setNamespaceAware(true);
    docBuildFactory.setValidating(true);
    docBuildFactory.setAttribute(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA); // use LANGUAGE here instead of SOURCE
    docBuildFactory.setAttribute( JAXP_SCHEMA_SOURCE, schemaSource);
    documentBuilder = docBuildFactory.newDocumentBuilder();
    Good luck!
    Paul Niedenzu

  • Urgent help in searching XML docs

    Hi All,
    I have started using JDOM and created a XML document after reading the contents from a text file. Now i need to implement a search facility on this XML document. The structure of my XML document is given bellow
    <Company ID="C1">
      <Name>aa</Name>
      <Address>qq</Address>
      <Contact_Person>ww</Contact_Person>
      <Designation>ee</Designation>
      <Phone>123</Phone>
      <Fax>456</Fax>
      <EMail>acd</EMail>
      <Website>axc</Website>
      <Business_Type>hfs</Business_Type>
      <Operation_Areas>khgd</Operation_Areas>
      <Other_Info>csbdcks</Other_Info>
    </Company>There are similar company nodes having information about different companies.
    The search criteria can be based on any one node e.g search companies by <Location> or <Business_Type> etc. I am planning to use XSL and pass the search parameters. Is the approach right?? Could someone guide me with some code examples .
    Thanks in advance..
    Nilotpal     

    If you want to search information in a JDom object, you can use XPath with Jaxen: http://www.jaxen.org/
    I never used Jaxen, so I can't help you.
    But with XPath you can implement many search facilities.

  • Can I parse non-wellformed XML with SAX at all?

    Hi all,
    i was wondering whether its possible at all to parse XML that is not well formed with SAX.
    e.g. A HTML file that doesnt close tags and stuff like that.
    I tried implementing the fatal() method of the Handler in a a way that it consumes the exception but does not rethrow it.
    Also I tried setting the validation property to false. Both with no success.
    Any help would be appriciated.
    thx
    philipp

    Your experiments tell you the answer.
    If you have HTML tag soup, why not just run it through JTidy or HTMLTidy to make it into well-formed XHTML?

  • How to parse data from XML with prefix?

    Hi folks,
    I have an XML which tags include prefixes. I would like to parse it using a select. Any ideas?
    [Sample XML|http://wwwinfo.mfcr.cz/cgi-bin/ares/darv_or.cgi?ico=46972501]
    I tried this:
    select xml
    from
       (  select
                httpuritype('wwwinfo.mfcr.cz/cgi-bin/ares/darv_or.cgi?ico=46972501').getXML() xml
          from dual
        );This just returns XML.
    select  x.ico,
            x.org_name
        from dual d
             ,XMLTABLE('/are:Ares_odpovedi/are:Odpoved/D:Vypis_OR'
                        PASSING httpuritype('http://wwwinfo.mfcr.cz/cgi-bin/ares/darv_or.cgi?ico=46972501').getXML()
                        COLUMNS
                           ico varchar2(50) PATH 'D:ZAU/D:ICO'
                          ,org_name varchar2(200) PATH 'D:ZAU/D:OF'
                        )  x
       where rownum = 1
    ORA-19228: XPST0008 - undeclared identifier: prefix 'are' local-name 'are:Ares_odpovedi'Any idea how to simply get all details into columns?
    Thanks,
    Tomas

    add xmlnamespaces to xmltable
    select  x.ico,
            x.org_name
        from XMLTABLE(
             xmlnamespaces('http://wwwinfo.mfcr.cz/ares/xml_doc/schemas/ares/ares_answer_or/v_1.0.3' as "are"
             , 'http://wwwinfo.mfcr.cz/ares/xml_doc/schemas/ares/ares_datatypes/v_1.0.3' as "D"),
             '/are:Ares_odpovedi/are:Odpoved/D:Vypis_OR'
                        PASSING httpuritype('http://wwwinfo.mfcr.cz/cgi-bin/ares/darv_or.cgi?ico=46972501').getXML()
                        COLUMNS
                           ico varchar2(50) PATH 'D:ZAU/D:ICO'
                          ,org_name varchar2(200) PATH 'D:Vypis_OR/D:ZAU/D:OF'
                        )  x
       where rownum = 1not tested

  • Build XML with DOM

    Why does this loop works well if I COMMENT OUT the second node -
    but I get a NULL document if I try to add the second node ?
    //Loop through the result set
    for (int i=0; i < iRows; i++) {
    System.out.println(result.getString("SiteID"));
    Node newSiteIDNode = document.createElement("SiteID");
    Text tnSiteIDNode = document.createTextNode(result.getString("SiteID"));
    newSiteIDNode.appendChild(tnSiteIDNode);
    root.appendChild(newSiteIDNode);
    Node newItemNode = document.createElement("ItemCode");
    Text tnItemNode = document.createTextNode(result.getString("ItemCode"));
    newItemNode.appendChild(tnItemNode);
    root.appendChild(newItemNode);

    The XML file that I'm creating via the following is empty
    TransformerFactory transFactory =TransformerFactory.newInstance();
    Transformer transformer = transFactory.newTransformer();
    // Using the DOM tree root node, the following line of code constructs a DOMSource object as the source of the transformation.
    DOMSource source = new DOMSource(document);
    // The following code fragment creates a StreamResult object to take the results of the transformation
    // and transforms the tree into an XML file.
    newXML = new File("FTHSites.xml");
    FileOutputStream os = new FileOutputStream(newXML);
    resultXML = new StreamResult(os);
    transformer.transform(source, resultXML);     

  • Persisting unexplained errors when parsing XML with schema validation

    Hi,
    I am trying to parse an XML file including XML schema validation. When I validate my .xml and .xsd in NetBeans 5.5 beta, I get not error. When I parse my XML in Java, I systematically get the following errors no matter what I try:
    i) Document root element "SQL_STATEMENT_LIST", must match DOCTYPE root "null".
    ii) Document is invalid: no grammar found.
    The code I use is the following:
    try {
    Document document;
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    factory.setValidating(true);
    factory.setNamespaceAware(true);
    DocumentBuilder builder = factory.newDocumentBuilder();
    document = builder.parse( new File(PathToXml) );
    My XML is:
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <!-- Defining the SQL_STATEMENT_LIST element -->
    <xs:element name="SQL_STATEMENT_LIST" type= "SQL_STATEMENT_ITEM"/>
    <xs:complexType name="SQL_STATEMENT_ITEM">
    <xs:sequence>
    <xs:element name="SQL_SCRIPT" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    </xs:complexType>
    <!-- Defining simple type ApplicationType with 3 possible values -->
    <xs:simpleType name="ApplicationType">
    <xs:restriction base="xs:string">
    <xs:enumeration value="DawningStreams"/>
    <xs:enumeration value="BaseResilience"/>
    <xs:enumeration value="BackBone"/>
    </xs:restriction>
    </xs:simpleType>
    <!-- Defining the SQL_SCRIPT element -->
    <xs:element name="SQL_SCRIPT" type= "SQL_STATEMENT"/>
    <xs:complexType name="SQL_STATEMENT">
    <xs:sequence>
    <xs:element name="NAME" type="xs:string"/>
    <xs:element name="TYPE" type="xs:string"/>
    <xs:element name="APPLICATION" type="ApplicationType"/>
    <xs:element name="SCRIPT" type="xs:string"/>
    <!-- Making sure the following element can occurs any number of times -->
    <xs:element name="FOLLOWS" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    </xs:complexType>
    </xs:schema>
    and my XML is:
    <?xml version="1.0" encoding="UTF-8"?>
    <!--
    Document : SQLStatements.xml
    Created on : 1 juillet 2006, 15:08
    Author : J�r�me Verstrynge
    Description:
    Purpose of the document follows.
    -->
    <SQL_STATEMENT_LIST xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://www.dawningstreams.com/XML-Schemas/SQLStatements.xsd">
    <SQL_SCRIPT>
    <NAME>CREATE_PEERS_TABLE</NAME>
    <TYPE>CREATION</TYPE>
    <APPLICATION>DawningStreams</APPLICATION>
    <SCRIPT>
    CREATE CACHED TABLE PEERS (
    PEER_ID           VARCHAR(20) NOT NULL,
    PEER_KNOWN_AS      VARCHAR(30) DEFAULT ' ' ,
    PRIMARY KEY ( PEER_ID )
    </SCRIPT>
    </SQL_SCRIPT>
    <SQL_SCRIPT>
    <NAME>CREATE_COMMUNITIES_TABLE</NAME>
    <TYPE>CREATION</TYPE>
    <APPLICATION>DawningStreams</APPLICATION>
    <SCRIPT>
    CREATE CACHED TABLE COMMUNITIES (
    COMMUNITY_ID VARCHAR(20) NOT NULL,
    COMMUNITY_KNOWN_AS VARCHAR(25) DEFAULT ' ',
    PRIMARY KEY ( COMMUNITY_ID )
    </SCRIPT>
    </SQL_SCRIPT>
    <SQL_SCRIPT>
    <NAME>CREATE_COMMUNITY_MEMBERS_TABLE</NAME>
    <TYPE>CREATION</TYPE>
    <APPLICATION>DawningStreams</APPLICATION>
    <SCRIPT>
    CREATE CACHED TABLE COMMUNITY_MEMBERS (
    COMMUNITY_ID VARCHAR(20) NOT NULL,
    PEER_ID VARCHAR(20) NOT NULL,
    PRIMARY KEY ( COMMUNITY_ID, PEER_ID )
    </SCRIPT>
    </SQL_SCRIPT>
    <SQL_SCRIPT>
    <NAME>DROP_PEER_TABLE</NAME>
    <TYPE>DELETION</TYPE>
    <APPLICATION>DawningStreams</APPLICATION>
    <SCRIPT>
    DROP TABLE PEERS IF EXISTS
    </SCRIPT>
    </SQL_SCRIPT>
    <SQL_SCRIPT>
    <NAME>DROP_COMMUNITIES_TABLE</NAME>
    <TYPE>DELETION</TYPE>
    <APPLICATION>DawningStreams</APPLICATION>
    <SCRIPT>
    DROP TABLE COMMUNITIES IF EXISTS
    </SCRIPT>
    </SQL_SCRIPT>
    <SQL_SCRIPT>
    <NAME>DROP_COMMUNITY_MEMBERS_TABLE</NAME>
    <TYPE>DELETION</TYPE>
    <APPLICATION>DawningStreams</APPLICATION>
    <SCRIPT>
    DROP TABLE COMMUNITY_MEMBERS IF EXISTS
    </SCRIPT>
    </SQL_SCRIPT>
    <SQL_SCRIPT>
    <NAME>CREATE_COMMUNITY_MEMBERS_VIEW</NAME>
    <TYPE>CREATION</TYPE>
    <APPLICATION>DawningStreams</APPLICATION>
    <SCRIPT>
    CREATE VIEW COMMUNITY_MEMBERS_VW AS
    SELECT P.PEER_ID, P.PEER_KNOWN_AS, C.COMMUNITY_ID, C.COMMUNITY_KNOWN_AS
    FROM PEERS P, COMMUNITIES C, COMMUNITY_MEMBERS CM
    WHERE P.PEER_ID = CM.PEER_ID
    AND C.COMMUNITY_ID = CM.COMMUNITY_ID
    </SCRIPT>
    <FOLLOWS>CREATE_PEERS_TABLE</FOLLOWS>
    <FOLLOWS>CREATE_COMMUNITIES_TABLE</FOLLOWS>
    </SQL_SCRIPT>
    </SQL_STATEMENT_LIST>
    Any ideas? Thanks !!!
    J�r�me Verstrynge

    Hi,
    I found the solution in the following post:
    Validate xml with DOM - no grammar found
    Sep 17, 2003 10:58 AM
    The solution is to add a line of code when parsing:
    try {
    Document document;
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    factory.setValidating(true);
    factory.setNamespaceAware(true);
    factory.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaLanguage", "http://www.w3.org/2001/XMLSchema");
    DocumentBuilder builder = factory.newDocumentBuilder();
    document = builder.parse( new File(PathToXml) );
    The errors are gone !!!
    J�r�me Verstrynge

  • Parsing the xml with out dom parser in Oracle10g

    Hi,
    I need to parse the xml and create new xml with out any parsers in oracle 10g.Please help me how to do this one.

    Parsing without a parser eh? Could be tricky. Maybe if you go to the XML DB forum and explain your problem over there someone can help you...
    XML DB forum FAQ:
    XML DB FAQ

  • How can I use a 3rd party XML parser such as xerces with OC4J ?

    Hi all tech experts,
    I am using Oracle Application Server 10g Release 2 (10.1.2) and i have
    installed Portal and Wireless and OracleAS Infrastructure on the same
    computer.
    i tried all the solutions on this thread
    Use of Xerces Parser in out application with Oracle App Server 9.0.4
    but still fighting.
    I have also posted this query on OTN on following thread
    How can I use a 3rd party XML parser such as xerces with OC4J?
    but no reply....
    Please help me on this issue.
    Since OC4J is preconfigured to use the Oracle XML parser which is xmlparserv2.jar.
    i have read the following article which states that
    OC4J is preconfigured to use the Oracle XML parser. The Oracle XML parser is fully JAXP 1.1 compatible and will serve the needs of applications which require JAXP functionality. This approach does not require the download, installation, and configuration of additional XML parsers.
    The Oracle XML parser (xmlparserv2.jar) is configured to load as a system level library of OC4J through it's inclusion as an entry in the Class-Path entry of the oc4j.jar Manifest.mf file. This results in the Oracle XML parser being used for all common deployment and packaging situations. You are not permitted to modify the Manifest.mf file of oc4j.jar.
    It must be noted that configuring OC4J to run with any additional XML parser or JDBC library is not a supported configuration. We do know customers who have managed to successfully replace the system level XML parser and the Oracle JDBC drivers that ship with the product, but we do not support this type of configuration due to the possibility of unexpected system behavior and system errors that might occur from replacing the tested and certified libraries.
    If you absolutely must use an additional XML parser such as xerces, then you have to start OC4J such that the xerces.jar file is loaded at a level above the OC4J system classpath. This can be accomplished using the -Xbootclasspath flag of the JRE.
    i have also run the following command
    java -Xbootclasspath/a:d:\xerces\xerces.jar -jar oc4j.jar
    but no success.
    How could i utilize my jar's like xerces.jar and xalan.jar for parsing instead of OC4J in-built parser ?
    All reply will be highly appreciated.
    Thnx in advance to all.
    Neeraj Sidhaye
    try_catch_finally @ Y !

    Hi Neeraj Sidhaye,
    I am trying to deploy a sample xform application to the Oracle Application Server (10.1.3). However, I encountered the class loader issue that is similar to your stuation. I tried all the three solutions but the application is still use the Oracle xml paser class. I am wondering if you have any insight about this?
    Thanks for your help.
    Xingsheng Qian
    iPass Inc.
    Here is the error message I got.
    Message:
    java.lang.ClassCastException: oracle.xml.parser.v2.XMLElement
    Stack Trace:
    org.chiba.xml.xforms.exception.XFormsException: java.lang.ClassCastException: oracle.xml.parser.v2.XMLElement
         at org.chiba.xml.xforms.Container.dispatch(Unknown Source)
         at org.chiba.xml.xforms.Container.dispatch(Unknown Source)
         at org.chiba.xml.xforms.Container.initModels(Unknown Source)
         at org.chiba.xml.xforms.Container.init(Unknown Source)
         at org.chiba.xml.xforms.ChibaBean.init(Unknown Source)
         at org.chiba.adapter.servlet.ServletAdapter.init(ServletAdapter.java:153)
         at org.chiba.adapter.servlet.ChibaServlet.doGet(ChibaServlet.java:303)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:719)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)
         at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:299)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:187)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    Caused by: java.lang.ClassCastException: oracle.xml.parser.v2.XMLElement
         at org.chiba.xml.xforms.Instance.iterateModelItems(Unknown Source)
         at org.chiba.xml.xforms.Bind.initializeModelItems(Unknown Source)
         at org.chiba.xml.xforms.Bind.init(Unknown Source)
         at org.chiba.xml.xforms.Initializer.initializeBindElements(Unknown Source)
         at org.chiba.xml.xforms.Model.modelConstruct(Unknown Source)
         at org.chiba.xml.xforms.Model.performDefault(Unknown Source)
         at org.chiba.xml.xforms.XFormsDocument.performDefault(Unknown Source)
         at org.chiba.xml.xforms.XFormsDocument.dispatchEvent(Unknown Source)
         at org.apache.xerces.dom.NodeImpl.dispatchEvent(Unknown Source)
         ... 18 more

  • To convert XML to ABAP internal table can we do it with DOM or we need XSLT

    I have a requirement where I need to collect the data from XML file into an internal table.
    I need to collect this data into an internal table as I should make use of this data and do Goods Receipt in SAP.
    My XML file is very very complex and the child nodes in my XML file may occur ones or 10 times and change dynamically.
    I want to know if XML to ABAP internal table is possible with DOM or does it need XSLT too.
    I used the blog of Robert which uses DOM, but it I am unable to collect the data in internal table. The blog explains only how to wtite the out put to screen as element and value.
    I want to know if XML to ABAP internal table is possible with DOM or do I need XSLT too? I am confused please help.
    Any help will be highly appreciated.
    Regards,
    Jessica Sam

    Hello Jessica
    Why not using the DOM itself for processing?
    Below you see the post-processing coding which I use to add the interchange control number (ICN) into an EDI message (which at this stage is still an XML-EDI stream). This is done on SAP-XI yet on the ABAP stack so you could use this approach on your R/3 system as well.
    method POSTPROCESSING.
    * Post-Processing of outbound EDI invoices & dispatch advices
      me->map_icn( ).
    endmethod.
    method MAP_ICN.
    * define local data
      DATA: lo_node       TYPE REF TO if_ixml_node,
            ld_name       TYPE string,
            ld_value      TYPE string,
            ld_error_code type MPG_ERRCODE,
    **        ld_control_number   TYPE char13,
            ld_rc         TYPE i,
            ld_msg        TYPE string.  " bapi_msg.
      DATA: ld_interface  TYPE string.
      DATA: incode TYPE REF TO if_ixml_node_collection.
      LOG-POINT ID zedi
        SUBKEY mc_subkey_method_trace.
      ld_error_code = md_clsname.
    * Get next interchange control number (ICN)
      me->md_next_number = me->get_next_number(
          id_nrobj  = me->md_nrobj   " Object (SNRO)
          id_nrnr   = me->md_nrnr ). " Number Range
      CALL METHOD zcl_edi_uk_counter=>calculate_modulo_n09
        EXPORTING
          id_input  = me->md_next_number
        receiving
          rd_output = me->md_next_number.
    * Build ICN according to naming conventions agreed with EDI customer
      me->md_icn = me->generate_icn( me->md_next_number ).
      ld_value = me->md_icn.  " type conversion to string
      CLEAR: incode,
             lo_node.
      incode  = me->mo_document->get_elements_by_tag_name( mc_d_0020 ).
      lo_node = incode->get_item( index = 0 ).
      CALL METHOD lo_node->set_value
        EXPORTING
          value = ld_value
        RECEIVING
          rval  = ld_rc.
      IF ( ld_rc NE 0 ).
        CONCATENATE 'Error [' mc_d_0020
                    ']: Method SET_VALUE (IF_IXML_NODE)'
                    INTO ld_msg.
        CONDENSE ld_msg.
        me->mif_trace->trace2( message = ld_msg ).
        RAISE EXCEPTION TYPE cx_mapping_fault
          EXPORTING
    *        textid =
    *        previous =
            error_code = ld_error_code
            error_text = ld_msg.
    **    MESSAGE ld_msg TYPE 'A'.
      ENDIF.
      CLEAR: incode,
             lo_node.
      incode  = me->mo_document->get_elements_by_tag_name( mc_d_0020_2 ).  " element for ICN
      lo_node = incode->get_item( index = 0 ).
      CALL METHOD lo_node->set_value
        EXPORTING
          value = ld_value
        RECEIVING
          rval  = ld_rc.
      IF ( ld_rc NE 0 ).
        CONCATENATE 'Error [' mc_d_0020_2
                    ']: Method SET_VALUE (IF_IXML_NODE)'
                    INTO ld_msg.
        CONDENSE ld_msg.
        me->mif_trace->trace2( message = ld_msg ).
        RAISE EXCEPTION TYPE cx_mapping_fault
          EXPORTING
    *        textid =
    *        previous =
            error_code = ld_error_code
            error_text = ld_msg.
    **    MESSAGE ld_msg TYPE 'A'.
      ENDIF.
    * define local data
      DATA: ls_record       TYPE mpp_dynamic.
      CLEAR: ls_record.
      ls_record-namespace = mc_dynamic_namespace.
      ls_record-name      = mc_icn.
      ls_record-value     = ld_value.
      mif_dynamic->add_record( ls_record ).
    endmethod.
    In your case you would need to do a DO...ENDDO loop until you parsed all required nodes.
    NOTE: ME->MO_DOCUMENT is of TYPE REF TO IF_IXML_DOCUMENT.
    Regards
       Uwe

  • Parsing an XML using DOM parser in Java in Recursive fashion

    I need to parse an XML using DOM parser in Java. New tags can be added to the XML in future. Code should be written in such a way that even with new tags added there should not be any code change. I felt that parsing the XML recursively can solve this problem. Can any one please share sample Java code that parses XML recursively. Thanks in Advance.

    Actually, if you are planning to use DOM then you will be doing that task after you parse the data. But anyway, have you read any tutorials or books about how to process XML in Java? If not, my suggestion would be to start by doing that. You cannot learn that by fishing on forums. Try this one for example:
    http://www.cafeconleche.org/books/xmljava/chapters/index.html

  • Parsing xml using DOM parser in java

    hi there!!!
    i don have much idea about parsing xml.. i have an xml file which consists of details regarding indentation and spacing standards of C lang.. i need to read the file using DOM parser in java n store each of the attributes n elements in some data structure in java..
    need help as soon as possible!!!

    DOM is the easiest way to parse XML document, google for JDOM example it is very easy to implement.
    you need to know what is attribute, what is text content and what is Value in XML then easily you can parse your document with dom (watch for space[text#] in your XML document when you parse it).
    you get root node then nodelist of childs for root then go further inside, it is easy believe me.

  • XSLT with DOM/C++ Parser

    Help,
    Anyone familiar with xslprocess class with DOM Parser for C++? My application needs to transform the original XML document, and then parse the new document (parse elements in tree). The example in the XDK demo directory (XSLSample.cpp) stops short of this. This demo/sample code simply output the newly transformed to the standard output (screen). My attempt to parse the newly transformed XML has been unsuccessful. Most of my code is base direcly from the sample:
    void
    DbXMLLoad::transformXML( const string& filename)
    xmlpar.xmlinit();
    strcpy(xml_doc, (char*)filename.c_str());
    xmlpar.xmlparse((oratext *), xml_doc, (oratext *) 0, flags);
    xslpar.xmlinit();
    strcpy(xsl_doc, "it2xxx.xsl");
    xslpar.xmlparse((oratext *), xsl_doc, (oratext *) 0, flags);
    respar.xmlparse((oratext *) result, (oratext *) 0, flags);
    xslproc.xslprocess(&xmlpar, &xslpar, &respar, &result);
    xslproc.printres(&respar.getDocumentElement(), 1);
    // Parse the newly transformed XML document????
    constructTree(result, 1);
    (void) xmlpar.xmlterm();
    (void) xslpar.xmlterm();
    (void) respar.xmlterm();
    void
    DbXMLLoad::constructTree(Node *node, word level)
    if (node) {
    dumpTree(node, level);
    if ((node->getType() !=DOCUMENT_TYPE_NODE) && node->hasChildNodes()) {
    nodes = node->getChildNodes();
    n_nodes = node->numChildNodes();
    for (i=0; i< n_nodes; i++)
    constructTree(nodes->item(i), level + 1);
    void
    DbXMLLoad::dumpTree(Node *node, uword level)
    switch (node->getType()) {
    case ELEMENT_NODE: // start database processing
    case TEXT_NODE: // continue database processing
    default:
    Appreciate your help. Thanks in advance
    Russ

    what is "respar"?What version of XDK do you use?

Maybe you are looking for

  • Problem in Outbound delivery with order reference

    Hi, I am facing problem with creation of outbound delivery with order reference from transaction VL01N. When i enter into the transaction with order key in, but in the tab Picking there is one column Pick quantity which is showing as grey field with

  • Best Method For Keyword Search (Full Text Search)

    I have some cataloged columns I am searching for Keywords. This table is getting huge over 6.7 million records and it is becoming slow. What is the best method to optimize the DB for this Search. Do I need to create a column that will have a keyword

  • Is It Possible to Change Cursors in 8.1...

    ...the way you can in Photoshop?

  • Import Server & Port Sequence

    Hi All , We are using import server for importing records into MDM. In our scenarios ,we are using mulitiple ports &  depending on condition, files/records are dropped into particular port. For Eg. There 3 ports say .. Port1 , Port 2 , Port3 . Files

  • How do I get a book on CSs to play in sequential order?

    I listen to books on CDs, checked out at the library. When I play a CD, I can't get it to automatically play in sequential order.