JAXP & DOM with Namespaces

A quick question: when an XML document using a namespace is parsed into a DOM tree, is Element.getNodeName() supposed to return the tag name of the element with or without the namespace prefix? Also, does Element.getElementsByTagName() follow the same standard?
When I use the Oracle XML Parser through JAXP, Element.getNodeName() returns the namespace prefix along with the name, but Element.getElementsByTagName(String name) requires that I leave off the namespace prefix. When I use the default parser included with Java 1.4.1, the behavior is different. Does anyone know what the correct behavior is?

The XML DOM core specification can be found here: http://www.w3.org/TR/2002/WD-DOM-Level-3-Core-20021022/core.htm
From that, it looks like Nodes have separate fields for namespace and name, so I would lean towards there having to be separate accessors as well, so getNodeName() should not return the namespace. That should be handled by getNamespaceURI(). Although, that returns the URI, not the alias, but I don't think an alias is used in any other method anyways.
Also, there is a getElementsByTagNameNS which allows searching for tags within a given namespace, so I would say that getElementsByTagName behaves as it should.

Similar Messages

  • Need XML (JAXP DOM) creating/parsing sample coding

    Where to find some sample code of XML document creating and parsing with JAXP DOM? Thanks.

    Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse("c:/myfile.xml");

  • JAXP DOM - I can get children fine, just not nested children!

    Hi,
    I have a problem with JAXP dom. I cannot get the nested children associated.
    Here is my code:
    try {
    DOMParser parser = new DOMParser();
    String url = "file:/myxml.xml";
    parser.parse(url);
    Document doc = parser.getDocument();
    //Get the filename
    NodeList FileNameNodeList = doc.getElementsByTagName("filename");
    //Get the duration
    NodeList DurationNodeList = doc.getElementsByTagName("duration");
    //Get the headline
    NodeList HeadLineNodeList = doc.getElementsByTagName("headline");
    //Get the description
    NodeList DescriptionNodeList = doc.getElementsByTagName("description");
    //Get the keywords
    NodeList KeyWordsNodeList = doc.getElementsByTagName("keywords");
    //Get the link order
    //Read all values for every "File Name"
    for(int i=0; i<FileNameNodeList.getLength(); i++){          
    //Get the values
    Node FileNameNode = FileNameNodeList.item(i);
    Node DurationNode = DurationNodeList.item(i);
    Node HeadLineNode = HeadLineNodeList.item(i);
    Node DescriptionNode = DescriptionNodeList.item(i);
    Node KeyWordsNode = KeyWordsNodeList.item(i);
    //File name
    if(FileNameNode.getFirstChild() != null){
    Message += "<br><b>Filename:</b> " + FileNameNode.getFirstChild().getNodeValue();
    //Duration
    if(DurationNode.getFirstChild() != null){
    Message += "<b>Duration:</b> " + DurationNode.getFirstChild().getNodeValue();
    //Head line
    if(HeadLineNode.getFirstChild() != null){
    Message += "<b>Head Line:</b> " + HeadLineNode.getFirstChild().getNodeValue();
    //Description
    if(DescriptionNode.getFirstChild() != null){
    Message += "<b>Description:</b> " + DescriptionNode.getFirstChild().getNodeValue();
    //Key words
    if(KeyWordsNode.getFirstChild() != null){
    Message += "<b>Key Words:</b> " + KeyWordsNode.getFirstChild().getNodeValue();
    //Build the string
    String MessageTemp = Message;
    Message = "<font size=-1>" + MessageTemp + "</font>";
    return Message;
    } catch (Exception ex) {
    System.out.println(ex);
    return Message + ex.toString();
    Here is part of my XML File:
    - <article storyorder="1" pubdate="11/6/02 3:28:27 AM" source="MSNBC Video" topnews="1">
    <filename>vh</filename>
    <duration>00:01:58</duration>
    <headline>MSNBC&#146;s Video Headlines</headline>
    <description>The latest news from MSNBC.com</description>
    <keywords>headlines, news headlines</keywords>
    <photographer />
    <aspect>4:3</aspect>
    - <linkinfo>
    - <link order="1">
    <linkurl>http://www.msnbc.com/news/828323.asp</linkurl>
    <linktext>Republicans win control of Congress</linktext>
    </link>
    - <link order="2">
    <linkurl>http://www.msnbc.com/news/828325.asp</linkurl>
    <linktext>Republicans widen House majority</linktext>
    </link>
    - <link order="3">
    <linkurl>http://www.msnbc.com/news/828326.asp</linkurl>
    <linktext>Democrats retake some statehouses</linktext>
    </link>
    </linkinfo>
    - <categories>
    - <category id="News">
    - <topics>
    <topic>International</topic>
    <topic>US</topic>
    </topics>
    </category>
    </categories>
    </article>
    I can get filename, duration, etc. But I cannot get the multiple link URLs associated with the filename. How can I get that?
    Thanks

    Call getDocumentElement() on the document to obtain the root node. Then call getChildNodes() on the root node to get its children, each individual child can be accessed by looping, as follows :
    // Get the Document object.
    Node node = document.getDocumentElement();
    NodeList childNodes = node.getChildNodes();
    for(int i = 0; i < childNodes.getLength(); i++) {
        Node childNode = childNodes.item(i);
        // Perform some action on the node, or get its children to burrow
        // further down the DOM tree.
    }If you know how many levels you need to go down then you'll need that many nested for loops but recursion is a far more elegant solution.

  • How must getElementsByTagName work on an xml file with namespaces?

    Hello together,
    is there any normative document, which specifies
    which nodes must be returned by
    the org.w3c.dom.Document method
    getElementsByTagName when which was
    created by a namespace aware dom parser
    from an xml file containing namespaces?
    In other words:
    when you have an xml file:
    <someprefix:somenode xmlns:someprefix="http://someuri">
    <someprefix:innertag>
    <someprefix:mostinnertag>
    </someprefix:mostinnertag>
    <someprefix:mostinnertag>
    </someprefix:mostinnertag>
    </someprefix:innertag>
    </someprefix>
    and you call
    document.getElementsByTagName( ... );
    1) How many nodes must be returned when giving
    "mostinnertag" as parameter?
    2) How many nodes when giving "someprefix:mostinnertag" as parameter?
    Is it allowed to use the "non namespaceaware"
    method and not "getElementsByTagNameNS"?
    I know:
    a) xerces returns 2 nodes when using
    alternative 2 and none with alternative 1
    b) oracle xml parser returns 2 nodes when using
    alternative 1 and none when using alternative 2
    Which implementation is right?
    Yours
    Stefan

    I've got some problems with this methos and xerces too.
    Perhaps the two implementations (xerces and oracle) are different. I mean xerces implementation gives you nodes of this name but without namespace and oracles's implementation gives you modes with namespace whose unprefix-name is "mostinnertag".

  • Changing /updating an xml file using JAXP(DOM)

    Hello,
    i am fairly new to xml and am using it in my degree project.I am able to retrieve and read data from a fairly large xml file using JAXP(DOM) and/or XMLBeans.I am having difficulties in updating the xml document. Any updation i believe is ito be saved into a new xml document,but dont know how to proceed with it. Any help would be appreciated.
    Following is a snippet of my code using JAXP. Here i am able to retrieve data from the source file.
    File document=new File("C:\\tester.xml");
    try {
    DocumentBuilderFactory factory
    = DocumentBuilderFactory.newInstance();
    DocumentBuilder parserr = factory.newDocumentBuilder();
    Document doc=parserr.parse(document);
    System.out.println(document + " is well-formed.");
    NodeList n2=doc.getElementsByTagName("Top");
    NodeList n3=doc.getElementsByTagName("Base");
    int x=n2.getLength();
    System.out.println("There are " x "players");
    for(int g=0;g<=x;g++)
    System.out.println("Top is" + n2.item(g).getFirstChild().getNodeValue()+" Base is" +n3.item(g).getFirstChild().getNodeValue());
    --------------------------------------------------------------------------------

    Following is my updation code to the dom tree:
    NodeList list=doc.getElementsByTagName("Information");
    for(int i=0; i<list.getLength();i++){
    Node thissampnode=list.item(i);
    Node thisNameNode=thissampnode.getFirstChild();
    if(thisNameNode==null) continue;
    if(thisNameNode.getFirstChild()==null)continue;
    // if(thisNameNode.getFirstChild() !(instanceof org.w3c.dom.Text) continue;
    String data=thisNameNode.getFirstChild().getNodeValue();
    if (! data.equals("0.59")) continue;
    Node newsampNode = doc.createElement("Samp");
    Node newsampTopNode = doc.createElement("Top");
    Text tnNode = doc.createTextNode("0.50");
    newsampTopNode.appendChild(tnNode);
    Element newsampRef = doc.createElement("Ref");
    Text tsr = doc.createTextNode("0");
    newsampRef.appendChild(tsr);
    Element newsampType = doc.createElement("Type");
    Text tt = doc.createTextNode("z");
    newsampType.appendChild(tt);
    Element newsampbase = doc.createElement("Base");
    Text sb = doc.createTextNode("0.55");
    newsampbase.appendChild(sb);
    newsampNode.appendChild(newsampTopNode);
    newsampNode.appendChild(newsampRef);
    newsampNode.appendChild(newsampType);
    newsampNode.appendChild(newsampbase);
    rootNode.insertBefore(newsampNode, thissampnode);
    Here i dont see any changes to the original xml source file.

  • JAXP DOM question

    Hi,
    I'm using jdk 1.4.1's JAXP and it seems to live a life of it's own ;)
    I'm building a DOM document out of an Oracle table and when I reach RowSet entry no.300 then the DocumentBuilder refuses (without any error) to give me a new Document (there are 25000 entries in this table).
    I also tried to create a new Builder and a new Factory but nothing.
    The funny part is that when I move the ResultSet entries 295-305 to the beginning of the ResultSet then my code works without any flaws until it reaches again the magical entry no.300 :)
    Is 300 some kind of undocumented DOM Document buffer size in JVM?
    Has anyone an explanation for it?
    Can I adjust the limit in jaxp.properties?
    If not then is there a workaround?
    rgds
    Sabalasa

    hey!
    I've found the bottle neck. It does not have anything to do with JAXP but with Oracle's XSU:)
    It seems like the XSU does not close the XMLQuerys properly and the database throws an "Maximum cursors exceeded" exception at line 300 :(
    Now I have to find out how to solve this problem.
    rgds
    Sabalasa

  • Using XSLT to extract value of a XML node with namespace

    I have a XML source code here.
    <?xml version="1.0" encoding="utf-8" ?>
    <rss version="2.0" xmlns:job="http://www.pageuppeople.com">
      <channel>
        <title>SMH Jobs</title>
        <link>internalrecruitment.smhgroup.com.au/jobsrss.ashx?stp=di</link>
        <description>A listing of jobs available here</description>
        <item>
          <title>eCommerce Optimisation Advisor</title>
          <description>A new and exciting opportunity exists for an experienced eCommerce Advisor to join</description>
          <job:location PUReferenceID="3711">Sydney - Inner Suburbs & CBD</job:location>
        </item>
      </channel>
    </rss>
    I want to use XSLT to extract value of a XML node with namespace <job:location>, and the returned value should be string 'Sydney - Inner Suburbs & CBD'. I tried a few XSL code below, but failed with error or nothing was returned.
    <xsl:value-of select="job:location" disable-output-escaping="yes"/>
    <xsl:value-of select="job/location" disable-output-escaping="yes"/>
    <xsl:value-of select="job\location" disable-output-escaping="yes"/>
    <xsl:value-of select="location" disable-output-escaping="yes"/>
    This might be an easy question for you, but I would appreciate if anyone can help.

    Hi Suncorp IT Learner,
    We need to tell the XSLT that some elements are in another namespace. Copy the xmls declarations for the prefixes you need to use. Then use the xsl format as:
    <xsl: value-of select=”job:location/@PUReferenceID”/>
    In following issue, Chriztian has a good explanation:
    http://our.umbraco.org/forum/developers/xslt/33353-XSLT-reading-XML-attribute-value
    Thanks,
    Qiao Wei
    TechNet Community Support

  • How can I get the element value with namespace?

    I tried to get a element value in xml has namespace but i can't.
    I removed the namespace, i can get a element value.
    How can i get a element value with namespace?
    --1. Error ----------- xml ------------------------------
    <?xml version="1.0" encoding="UTF-8"?>
    *<TaxInvoice xmlns="urn:kr:or:kec:standard:Tax:ReusableAggregateBusinessInformation:1:0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:kr:or:kec:standard:Tax:ReusableAggregateBusinessInformation:1:0 http://www.kec.or.kr/standard/Tax/TaxInvoiceSchemaModule_1.0.xsd">*
    <ExchangedDocument>
    <IssueDateTime>20110810133213</IssueDateTime>
    <ReferencedDocument>
    <ID>318701-0002</ID>
    </ReferencedDocument>
    </ExchangedDocument>
    <TaxInvoiceDocument>
    <IssueID>201106294100</IssueID>
    <TypeCode>0101</TypeCode>
    <IssueDateTime>20110810</IssueDateTime>
    <PurposeCode>02</PurposeCode>
    </TaxInvoiceDocument>
    <TaxInvoiceTradeLineItem>
    <SequenceNumeric>1</SequenceNumeric>
    <InvoiceAmount>200000000</InvoiceAmount>
    <TotalTax>
    <CalculatedAmount>20000000</CalculatedAmount>
    </TotalTax>
    </TaxInvoiceTradeLineItem>
    </TaxInvoice>
    --2. sucess ----------- xml ---------remove namespace---------------------
    <?xml version="1.0" encoding="UTF-8"?>
    <TaxInvoice>
    <ExchangedDocument>
    <IssueDateTime>20110810133213</IssueDateTime>
    <ReferencedDocument>
    <ID>318701-0002</ID>
    </ReferencedDocument>
    </ExchangedDocument>
    <TaxInvoiceDocument>
    <IssueID>201106294100</IssueID>
    <TypeCode>0101</TypeCode>
    <IssueDateTime>20110810</IssueDateTime>
    <PurposeCode>02</PurposeCode>
    </TaxInvoiceDocument>
    <TaxInvoiceTradeLineItem>
    <SequenceNumeric>1</SequenceNumeric>
    <InvoiceAmount>200000000</InvoiceAmount>
    <TotalTax>
    <CalculatedAmount>20000000</CalculatedAmount>
    </TotalTax>
    </TaxInvoiceTradeLineItem>
    </TaxInvoice>
    ---------- program ------------
    procedure insert_table
    l_clob clob,
    wellformed out boolean,
    error out varchar2
    is
    l_parser dbms_xmlparser.Parser;
    xmldoc xmldom.domdocument;
    l_doc dbms_xmldom.DOMDocument;
    l_nl dbms_xmldom.DOMNodeList;
    l_n dbms_xmldom.DOMNode;
    l_root DBMS_XMLDOM.domelement;
    l_node DBMS_XMLDOM.domnode;
    l_node2 DBMS_XMLDOM.domnode;
    l_text DBMS_XMLDOM.DOMTEXT;
    buf VARCHAR2(30000);
    xmlparseerror exception;
    TYPE tab_type is Table of xml_upload%ROWTYPE;
    t_tab tab_type := tab_type();
    pragma exception_init(xmlparseerror, -20100);
    l_node_name varchar2(300);
    begin
    l_parser := dbms_xmlparser.newParser;
    l_doc := DBMS_XMLDOM.newdomdocument;
    dbms_xmlparser.parseClob(l_parser, l_clob);
    l_doc := dbms_xmlparser.getDocument(l_parser);
    l_n := dbms_xmldom.makeNode(l_doc);
    l_nl := dbms_xslprocessor.selectNodes(l_n, '/TaxInvoice/TaxInvoiceDocument');
    FOR cur_tax In 0..dbms_xmldom.getLength(l_nl) - 1 LOOP
    l_n := dbms_xmldom.item(l_nl, cur_tax);
    t_tab.extend;
    t_tab(t_tab.last).ed_id := '5000000';
    dbms_xslprocessor.valueOf(l_n, 'IssueID/text()', t_tab(t_tab.last).tid_issue_id);
    dbms_xslprocessor.valueOf(l_n, 'TypeCode/text()', t_tab(t_tab.last).tid_type_code);
    END LOOP;
    FORALL i IN t_tab.first .. t_tab.last
    INSERT INTO xml_upload VALUES t_tab(i);
    COMMIT;
    dbms_xmldom.freeDocument(l_doc);
    wellformed := true;
    exception
    when xmlparseerror then
    --xmlparser.freeparser(l_parser);
    wellformed := false;
    error := sqlerrm;
    end insert_table;

    l_nl := dbms_xslprocessor.selectNodes(l_n, '/TaxInvoice/TaxInvoiceDocument');try to change as follow
    l_nl := dbms_xslprocessor.selectnodes(l_n,'/TaxInvoice/TaxInvoiceDocument','xmlns="urn:kr:or:kec:standard:Tax:ReusableAggregateBusinessInformation:1:0"');Edited by: AlexAnd on Aug 17, 2011 12:36 AM

  • Namespace not found error when creating data server for xml with namespace

    Hi
    I tried creating XML data server in ODI with namespace in xml file. I followed the below steps but could not success in creating the dataserver. however when I remove the namespace in xml file I am able to reverse engineer the xml file.
    1) Create xml data server
    2) select xml driver - com.sunopsis.jdbc.driver.xml.SnpsXmlDriver
    3) Provide the jdbc url - jdbc:snps:xml?f=D:/xmlnew/sample_namespace.xml&s=xmlns&d=D:/xmlnew/sample_namespace.dtd
    xml content
    <f:root xmlns:f="http://www.w3.org/TR/html4/">
    <table>
    <name>African Coffee Table</name>
    <width>80</width>
    <length>120</length>
    </table>
    </f:root>
    DTD content
    <!ELEMENT f:root ( table ) >
    <!ELEMENT length ( #PCDATA ) >
    <!ELEMENT name ( #PCDATA ) >
    <!ELEMENT table ( name, width, length ) >
    <!ELEMENT width ( #PCDATA ) >
    when I test connection it shows the following error.
    java.sql.SQLException: The model generated by the model mapper was not accepted by a validator: Model not accepted: Namespace not found:
         at oracle.odi.jdbc.datasource.LoginTimeoutDatasourceAdapter.doGetConnection(LoginTimeoutDatasourceAdapter.java:133)
         at oracle.odi.jdbc.datasource.LoginTimeoutDatasourceAdapter.getConnection(LoginTimeoutDatasourceAdapter.java:62)
         at com.sunopsis.sql.SnpsConnection.testConnection(SnpsConnection.java:1100)
         at com.sunopsis.graphical.dialog.SnpsDialogTestConnet.getLocalConnect(SnpsDialogTestConnet.java:371)
         at com.sunopsis.graphical.dialog.SnpsDialogTestConnet.localConnect(SnpsDialogTestConnet.java:794)
         at com.sunopsis.graphical.dialog.SnpsDialogTestConnet.jButtonTest_ActionPerformed(SnpsDialogTestConnet.java:754)
         at com.sunopsis.graphical.dialog.SnpsDialogTestConnet.connEtoC1(SnpsDialogTestConnet.java:137)
         at com.sunopsis.graphical.dialog.SnpsDialogTestConnet.access$1(SnpsDialogTestConnet.java:133)
         at com.sunopsis.graphical.dialog.SnpsDialogTestConnet$IvjEventHandler.actionPerformed(SnpsDialogTestConnet.java:87)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
         at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
         at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
         at java.awt.Component.processMouseEvent(Component.java:6289)
         at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
         at java.awt.Component.processEvent(Component.java:6054)
         at java.awt.Container.processEvent(Container.java:2041)
         at java.awt.Component.dispatchEventImpl(Component.java:4652)
         at java.awt.Container.dispatchEventImpl(Container.java:2099)
         at java.awt.Component.dispatchEvent(Component.java:4482)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
         at java.awt.Container.dispatchEventImpl(Container.java:2085)
         at java.awt.Window.dispatchEventImpl(Window.java:2478)
         at java.awt.Component.dispatchEvent(Component.java:4482)
         at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:644)
         at java.awt.EventQueue.access$000(EventQueue.java:85)
         at java.awt.EventQueue$1.run(EventQueue.java:603)
         at java.awt.EventQueue$1.run(EventQueue.java:601)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
         at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
         at java.awt.EventQueue$2.run(EventQueue.java:617)
         at java.awt.EventQueue$2.run(EventQueue.java:615)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:614)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    Caused by: java.sql.SQLException: The model generated by the model mapper was not accepted by a validator: Model not accepted: Namespace not found:
         at com.sunopsis.jdbc.driver.xml.SnpsXmlDTD.initialize(SnpsXmlDTD.java:389)
         at com.sunopsis.jdbc.driver.xml.SnpsXmlDTD.initialize(SnpsXmlDTD.java:421)
         at com.sunopsis.jdbc.driver.xml.SnpsXmlDTD.<init>(SnpsXmlDTD.java:150)
         at com.sunopsis.jdbc.driver.xml.SnpsXmlSchema.<init>(SnpsXmlSchema.java:478)
         at com.sunopsis.jdbc.driver.xml.SnpsXmlSchemaManager.createNewSchema(SnpsXmlSchemaManager.java:292)
         at com.sunopsis.jdbc.driver.xml.SnpsXmlSchemaManager.getSchemaFromProperties(SnpsXmlSchemaManager.java:270)
         at com.sunopsis.jdbc.driver.xml.SnpsXmlDriver.connect(SnpsXmlDriver.java:114)
         at oracle.odi.jdbc.datasource.DriverManagerUtils$DriverProxy.connect(DriverManagerUtils.java:23)
         at oracle.odi.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriverManager(DriverManagerDataSource.java:368)
         at oracle.odi.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriverManager(DriverManagerDataSource.java:352)
         at oracle.odi.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriverManager(DriverManagerDataSource.java:316)
         at oracle.odi.jdbc.datasource.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:275)
         at oracle.odi.jdbc.datasource.LoginTimeoutDatasourceAdapter.doGetConnection(LoginTimeoutDatasourceAdapter.java:99)
         at oracle.odi.jdbc.datasource.LoginTimeoutDatasourceAdapter.getConnection(LoginTimeoutDatasourceAdapter.java:62)
         at oracle.odi.jdbc.datasource.LoginTimeoutDatasourceAdapter$ConnectionProcessor.run(LoginTimeoutDatasourceAdapter.java:217)
         at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
         at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
         at java.util.concurrent.FutureTask.run(FutureTask.java:138)
         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
         at java.lang.Thread.run(Thread.java:662)

    Hi,
    Thans for your reply.
    This is the DTD for my xmldoc.
    <!ELEMENT Data (Department+)>
    <!ELEMENT EmployeeID (#PCDATA)>
    <!ATTLIST EmployeeID col (EMPID) #IMPLIED>
    <!ELEMENT Education (EmployeeID, Sequence, Dgree)>
    <!ATTLIST Education table NMTOKEN #IMPLIED>
    <!ELEMENT Employee (EmployeeName, EmployeeID, DepartmentID, Education*)>
    <!ATTLIST Employee table NMTOKEN #IMPLIED>
    <!ELEMENT EmployeeName (#PCDATA)>
    <!ATTLIST EmployeeName col NMTOKEN #IMPLIED>
    <!ELEMENT DepartName (#PCDATA)>
    <!ATTLIST DepartName col NMTOKEN #IMPLIED>
    <!ELEMENT Table (Column+)>
    <!ATTLIST Table importType NMTOKEN #IMPLIED>
    <!ATTLIST Table parentTable NMTOKEN #IMPLIED>
    <!ATTLIST Table tag NMTOKEN #IMPLIED>
    <!ATTLIST Table columns NMTOKEN #IMPLIED>
    <!ATTLIST Table name NMTOKEN #IMPLIED>
    <!ELEMENT DepartID (#PCDATA)>
    <!ATTLIST DepartID col NMTOKEN #IMPLIED>
    <!ELEMENT MetaData (Table+)>
    <!ELEMENT Sequence (#PCDATA)>
    <!ATTLIST Sequence col NMTOKEN #IMPLIED>
    <!ELEMENT Dgree (#PCDATA)>
    <!ATTLIST Dgree col NMTOKEN #IMPLIED>
    <!ELEMENT Export (MetaData, Data)>
    <!ELEMENT DepartmentID (#PCDATA)>
    <!ATTLIST DepartmentID col NMTOKEN #IMPLIED>
    <!ELEMENT Column (#PCDATA)>
    <!ATTLIST Column deleteKey NMTOKEN #IMPLIED>
    <!ATTLIST Column isKey NMTOKEN #IMPLIED>
    <!ELEMENT Department (DepartName, DepartID, Employee+)>
    <!ATTLIST Department table NMTOKEN #IMPLIED>
    Thanks again!
    Yan

  • WebDynpro Exception: IDs with Namespace Must Have the Format / namespace /

    Hi Experts,
        Can you please help me with this:
        I get the following error when I execute a webdynpro application.  Can you please let me know where do
        I need to look to verify the <namespace> and <id>.
       Error when processing your request
    What has happened?
    The URL http://sapdev.tfi.local:8000/sap/bc/webdynpro/sap/z_temp_disp_mara/ was not called due to an error.
    Note
    The following error text was processed in the system DEV : WebDynpro Exception: IDs with Namespace Must Have the Format /<namespace>/<id>
    The error occurred on the application server sapdev_DEV_00 and in the work process 0 .
    The termination type was: RABAX_STATE
    The ABAP call stack was:
    Method: RAISE of program CX_WD_GENERAL=================CP
    Method: CONSTRUCTOR of program CL_WDR_VIEW_ELEMENT===========CP
    Method: CONSTRUCTOR of program CL_WD_TABLE_COLUMN============CP
    Method: NEW_TABLE_COLUMN of program CL_WD_TABLE_COLUMN============CP
    Method: IF_WDR_VIEW_DELEGATE~WD_CREATE_UI_TREE of program /1BCWDY/6JQCRML58TRPAX42J5MQ==CP
    Method: CREATE_UI_TREE of program CL_WDR_DELEGATING_VIEW========CP
    Method: INIT_CONTROLLER of program CL_WDR_VIEW===================CP
    Method: INIT of program CL_WDR_CONTROLLER=============CP
    Method: GET_VIEW of program CL_WDR_VIEW_MANAGER===========CP
    Method: BIND_ROOT of program CL_WDR_VIEW_MANAGER===========CP
    What can I do?
    If the termination type was RABAX_STATE, then you can find more information on the cause of the termination in the system DEV in transaction ST22.
    If the termination type was ABORT_MESSAGE_STATE, then you can find more information on the cause of the termination on the application server sapdev_DEV_00 in transaction SM21.
    If the termination type was ERROR_MESSAGE_STATE, then you can search for more information in the trace file for the work process 0 in transaction ST11 on the application server sapdev_DEV_00 . In some situations, you may also need to analyze the trace files of other work processes.
    If you do not yet have a user ID, contact your system administrator.
    HTTP 500 - Internal Server Error
    Your SAP Internet Communication Framework Team
    Edited by: arshad mohammed on Sep 24, 2009 2:19 AM

    Hello experts,
    i got the same error but we use sap basis 700 with sps 15. What to do here?

  • Using XMLQuery with namespace

    Hi,
    I have following XML document stored as XMLType column,
    <ocaStatus xmlns="http://xmlbeans.apache.org/ocastatus"><status><statusCode>934</statusCode><statusDate>Wed Apr 07 16:05:53 GMT+05:30 2010</statusDate><userId>u0121845</userId><comment>Sent to LTC</comment></status><status><statusCode>934</statusCode><statusDate>Wed Apr 07 15:58:25 GMT+05:30 2010</statusDate><userId>u0121845</userId><comment>Sent to LTC</comment></status><status><statusCode>934</statusCode><statusDate>Wed Apr 07 15:54:02 GMT+05:30 2010</statusDate><userId>u0121845</userId><comment>Sent to LTC</comment></status><status><statusCode>750</statusCode><statusDate>2010-03-31 12:39:41.580 GMT+05:30</statusDate><userId>u0121845</userId><comment>Document Metadata is correct.</comment></status><status><statusCode>934</statusCode><statusDate>2010-03-31 12:39:41.580 GMT+05:30</statusDate><userId>u0121845</userId><comment>Sent to LTC</comment></status><status><statusCode>932</statusCode><statusDate>2010-03-31 12:39:41.580 GMT+05:30</statusDate><userId>u0121845</userId><comment>Loaded to Novus</comment></status><status><statusCode>700</statusCode><statusDate>2010-03-31 12:39:41.580 GMT+05:30</statusDate><userId>u0121845</userId><comment>Document is deleted from OCA.</comment></status></ocaStatus>
    This XML row contains namespace in it. Also there are some XML that does not have any namespace in it.
    I am running following XMLQuery() to get statusCode,
    select docfamily_uuid,
    XMLQuery(
    'for $i in /ocaStatus/status
    where $i/statusCode = 934
    return <statusDate>{$i /statusDate}</statusDate>'
    passing document_status_bean RETURNING CONTENT)
    from document_status_xml;
    Interestingly the query returns null for XML with namespace and statusCode value for rest of the XMLs without any namespace.
    Please help me to get this resolved.
    Thanks in advanced.
    Edited by: user6117359 on Apr 8, 2010 12:17 AM

    user6117359 wrote:
    I have some XPath queries too which are using extract(). I am facing the similar problem with them.Hi,
    Extract() accepts a list of namespaces as its third parameter.
    Ex. : based on your sample, to extract the first "status" element :
    SELECT extract(document_status_bean, 'ocaStatus/status[1]', 'xmlns="http://xmlbeans.apache.org/ocastatus"')
    FROM document_status_xml

  • Add child element by name with namespace

    I'm trying to add element by name that is in namespace. This call
    mod.addAppendStep ( Exp, XmlModify.Element, Name, Text )
    fails with error:
    Error: XmlModify::addStep: Cannot create content for step
    Name in abobe call is "my_ns:elem_name", query context is linked to that namespace (I tried query context not linked to namespace as well).

    If you want to add an element in a namespace, you need to do it using an empty name, and put the element (with namespace decl). E.g.:
    mod.addAppendStep(Exp, XmlModify.Element, "", "<my_ns:elem_name xmlns:my_ns='uri_for_my_ns' />").
    The exception you're seeing is saying that it can't create the content, and the content is created by parsing what is passed in, and <my_ns:elem_name/> is not well-formed (namespace prefix hasn't been mapped).
    Regards,
    George

  • Why XPath didnot work with Namespace ?

    Dear all,
    When I parsing a xml document with Namespace by XPath , it didnot work well , but if I remove the part of Namespace , it worked well , I am not sure if I processed with right steps , any help is appreciated :
    My parser : jdom-b9
    jdk : 1.4.1
    My code is like :
    import java.io.*;
    import java.util.*;
    import org.jdom.*;
    import org.jdom.input.*;
    import org.jdom.output.*;
    import org.jdom.xpath.*;
    public class XPathTest {   
        public static void main(String[] args) throws IOException, JDOMException {
            if (args.length != 1) {
                System.err.println("Usage: samples.XPathTest [test.xml]");
                return;
            String filename = args[0];
            PrintStream out = System.out;
            SAXBuilder builder = new SAXBuilder();
            Document doc = builder.build(new File(filename));
            Element root = doc.getRootElement();          
            XPath path = XPath.newInstance("//Worksheet");          
            path.addNamespace("ss","urn:schemas-microsoft-com:office:spreadsheet");
            // or use :
            //Namespace ns = root.getNamespace();
            //path.addNamespace(ns);
            List elementNames = path.selectNodes(doc);
            if (elementNames.size() == 0) {
                out.println("This xml contains no element <Worksheet>");
            } else {
                out.println("This xml contains " + elementNames.size() + " <Worksheet> :");
                Iterator i = elementNames.iterator();
                while (i.hasNext()) {
                    out.println("\t" + ((Element)i.next()).getName());
    }and test.xml :
    <?xml version="1.0"?>
    <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
    xmlns:o="urn:schemas-microsoft-com:office:office"
    xmlns:x="urn:schemas-microsoft-com:office:excel"
    xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
    xmlns:html="http://www.w3.org/TR/REC-html40">
    <Worksheet ss:Name="Sheet2">
      <Table ss:ExpandedColumnCount="12" ss:ExpandedRowCount="38" x:FullColumns="1"
       x:FullRows="1" ss:DefaultColumnWidth="54" ss:DefaultRowHeight="14.25">
       <Column ss:Width="63"/>
       <Column ss:Width="76.5"/>
       <Column ss:Width="103.5"/>
       <Column ss:Width="123"/>
       <Column ss:Width="136.5"/>
       <Column ss:Width="83.25"/>
       <Column ss:Width="39"/>
       <Column ss:Width="76.5"/>
       <Column ss:Width="103.5"/>
       <Column ss:Width="90"/>
       <Column ss:Width="76.5"/>
       <Column ss:Width="90"/>
       <Row>
        <Cell><Data ss:Type="String">PORT_CODE</Data></Cell>
        <Cell><Data ss:Type="String">EFFECT_DATE</Data></Cell>
        <Cell><Data ss:Type="String">END_DATE</Data></Cell>
        <Cell><Data ss:Type="String">ENCODE_SCHEME_PORT</Data></Cell>
        <Cell><Data ss:Type="String">PORT_NAME</Data></Cell>
        <Cell><Data ss:Type="String">COUNTRY_CODE</Data></Cell>
        <Cell><Data ss:Type="String">IS_RT</Data></Cell>
        <Cell><Data ss:Type="String">DATA_SOURCE</Data></Cell>
        <Cell><Data ss:Type="String">LAST_UPD_DATE</Data></Cell>
        <Cell><Data ss:Type="String">LAST_UPD_USER</Data></Cell>
        <Cell><Data ss:Type="String">BP_UPD_DATE</Data></Cell>
        <Cell><Data ss:Type="String">PROVINCE_CODE</Data></Cell>
       </Row>
      </Table>
    </Worksheet>
    </Workbook>test1.xml
    <?xml version="1.0"?>
    <Workbook>
    <Worksheet Name="Sheet2">
      <Table>
       <Column Width="63"/>
       <Column Width="76.5"/>
       <Column Width="103.5"/>
       <Column Width="123"/>
       <Column Width="136.5"/>
       <Column Width="83.25"/>
       <Column Width="39"/>
       <Column Width="76.5"/>
       <Column Width="103.5"/>
       <Column Width="90"/>
       <Column Width="76.5"/>
       <Column Width="90"/>
       <Row>
        <Cell><Data Type="String">PORT_CODE</Data></Cell>
        <Cell><Data Type="String">EFFECT_DATE</Data></Cell>
        <Cell><Data Type="String">END_DATE</Data></Cell>
        <Cell><Data Type="String">ENCODE_SCHEME_PORT</Data></Cell>
        <Cell><Data Type="String">PORT_NAME</Data></Cell>
        <Cell><Data Type="String">COUNTRY_CODE</Data></Cell>
        <Cell><Data Type="String">IS_RT</Data></Cell>
        <Cell><Data Type="String">DATA_SOURCE</Data></Cell>
        <Cell><Data Type="String">LAST_UPD_DATE</Data></Cell>
        <Cell><Data Type="String">LAST_UPD_USER</Data></Cell>
        <Cell><Data Type="String">BP_UPD_DATE</Data></Cell>
        <Cell><Data Type="String">PROVINCE_CODE</Data></Cell>
       </Row>
      </Table>
    </Worksheet>
    </Workbook>The output of test.xml is : This xml contains no element <Worksheet>
    The output of test1.xml with no namespace part is :
    This xml contains 1 <Worksheet> :
    Worksheet
    WHY ????????????????????????????

    I do not use jdom but I had similar problems. You can try "//:worksheet". The prefix for the default namespace might be "". it fixed my problem.
    wz

  • Getting Error :  WebDynpro Exception: IDs with Namespace Must Have the

    Hi Experts,
    I am getting following error while running Webdynpro application, Please give me solution
    The following error text was processed in the system E6I : WebDynpro Exception: IDs with Namespace Must Have the Format /<namespace>/<id>
    The error occurred on the application server HCSAP2950-1_E6I_00 and in the work process 0 .
    The termination type was: RABAX_STATE
    The ABAP call stack was:
    Method: RAISE of program CX_WD_GENERAL=================CP
    Method: CONSTRUCTOR of program CL_WDR_VIEW_ELEMENT===========CP
    Method: CONSTRUCTOR of program CL_WD_TABLE_COLUMN============CP
    Method: NEW_TABLE_COLUMN of program CL_WD_TABLE_COLUMN============CP
    Method: IF_WDR_VIEW_DELEGATE~WD_CREATE_UI_TREE of program /1BCWDY/AK98KQL1OONYBLIT9ARC==CP
    Method: CREATE_UI_TREE of program CL_WDR_DELEGATING_VIEW========CP
    Method: INIT_CONTROLLER of program CL_WDR_VIEW===================CP
    Method: INIT of program CL_WDR_CONTROLLER=============CP
    Method: GET_VIEW of program CL_WDR_VIEW_MANAGER===========CP
    Method: BIND_ROOT of program CL_WDR_VIEW_MANAGER===========CPThanks,
    satish

    Hi,
    SAP Notes 1242377, 1381873, 1389146
    Threads:
    WebDynpro Exception: IDs with Namespace Must Have the Format /<namespace>/<
    regards, Lukas

  • Unexpected start node "Insert" with namespace...

    Hi,
           I have a simple Biztalk app which receives an XML and sends to oracle DB using WCF-custom adapter.
    I generated schema from Visual Studio, created a map for inbound XSD to generated XSD mapping, deployed the app.
    Send port is configured to use the map and there is no orchestration.
    I run into following error. The error description is understood, but I am not able to see why it is happening.
    The adapter failed to transmit message going to send port "SendPort12" with URL "oracledb://DEVDB/". It will be retransmitted after the retry interval specified for this Send Port. Details:"Microsoft.ServiceModel.Channels.Common.XmlReaderParsingException: Unexpected start node "Insert" with namespace "http://Microsoft.LobServices.OracleDB/2007/03/DEVSCHEMA/Table/SITES" found.
    SOAP Action is :
    <BtsActionMapping xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <Operation Name="Insert" Action="http://Microsoft.LobServices.OracleDB/2007/03/DEVSCHEMA/Table/SITES/Insert" />
    </BtsActionMapping>
    I have checked multiple posts on different sites for this error. I am still not able to figure out what is causing this. Any help is appreciated.
    Thanks,
    SRG

    Hi SRG,
    Can you try generating schema again as may be some table change may have occurred . It may be silly but you can try 
    There are tow different post which can relate to your issue and resolution
    https://social.msdn.microsoft.com/Forums/en-US/c9e15c82-3bec-4bbb-b3c2-2507206c2d40/microsoftservicemodelchannelscommonxmlreaderparsingexception-unexpected-start-node?forum=biztalkr2adapters 
    https://social.msdn.microsoft.com/Forums/en-US/59ef69e7-3159-4fd6-ba67-9120d907f95e/wcforacledb-unexpected-start-node-node-with-namespace?forum=biztalkr2adapters
    Thanks
    Abhishek

Maybe you are looking for

  • Accounting document not generated for cancled credit memo

    Hi, its related to rebet den cancled credit memo.but accounting document not generated. after that created new rebet and accounting document generated..so in document flow status showing open for cancled credti memo. how to delete or clear this? or h

  • Invoice Response Message Type ?

    Does anyone know if there is a Standard Message type to send an IDOC response back after receiveing a Logistics Invoice ?

  • Concurrent processing casing contention

    I have 2 identical processes that I need to run concurrently, the only difference being each process handles a data set from a different day. I get the following error when both processes insert into the same table, even though no commit has yet been

  • Content Version

    Dear All, I have a scenario here, Lets assume, there are many content versions for a document. as default when the user tries to view the attachment of the document info record, it will show the current content version. but. Is it possible that the s

  • Complete My Album for Metallica's "Death Magnetic"

    Since last night's release of Metallica's new album "Death Magnetic", I would have expected to see this album listed under my "Complete My Album" feature, as I purchased the single releases leading up to last night's launch. According to the iTunes s