Multiple namespaces in an XML document

I have an XML document that I am trying to use within a data flow (XML Source)--the problem is that I keep getting an error message stating that the XML document has multiple namespaces and therefore, SSIS will not create the XSD for me.  If I take out the second namespace, I am able to successfully get the task to execute, but this XML is created with 2 namespaces and there is no way to get around this (I cannot get the report server to change these parameters)--my question is: does anyone know of a way to get SSIS to handle multiple namespaces so that I can process this XML document and extract the necessary data elements from it.
Any assistance would be greatly appreciated.
Thank you!!!!

I am replying too much late..........thinking might be useful for someone !!!!
SSIS does not handle multiple namespaces in the XML source file. You can find examples where you see the format
<Namespace:Element>.
The first step to avoid multiple namespaces is to transform your source file to a format that doesn’t refer to the namespaces.
SSIS has an XML task that can do the transformation. Add the XML task to an SSIS Control Flow and edit it.
Change the OperationType property value to XSLT, the SourceType to File connection and the Source to your source file that has the problem.
Set the SaveOperationResult property to True.
Expand the OperationResult branch and Set DestinationType to File Connection and the Destination to a new XML file.
Add the following to a new file and save it with an xslt file extension.
<?xml version="1.0" encoding="utf-8" ?> 
<xsl:stylesheet version="1.0"         xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 
  <xsl:output method="xml" indent="no" /> 
  <xsl:template match="/|comment()|processing-instruction()"> 
    <xsl:copy> 
      <xsl:apply-templates /> 
    </xsl:copy> 
  </xsl:template> 
  <xsl:template match="*"> 
    <xsl:element name="{local-name()}"> 
      <xsl:apply-templates select="@*|node()" /> 
    </xsl:element> 
  </xsl:template> 
  <xsl:template match="@*"> 
    <xsl:attribute name="{local-name()}"> 
      <xsl:value-of select="." /> 
    </xsl:attribute> 
  </xsl:template> 
</xsl:stylesheet> 
Back in the XML task, set the SecondOperandType to File connection and the Second Operand to your new XSLT file.
When you run the XML task, it will take your original file and apply the transformation rules defined in the XSLT file. The results will be saved in your new XML file.
This task only needs to be run once for the original XML file. When you look at the new file, you’ll see the same data as in the original, but without namespace references.
Now you can return to your data flow and alter the XML Source to reference the new XML file.
Click on the Generate XSD and you should be able to avoid your error.
When you click on the Columns tab in your XML Source, you will probably see a warning. This is because the data types may not be fully defined (for example there’s no mention of string lengths). This shouldn’t be a problem as long as the default data type
(255-character Unicode string) meets your needs.
=================life is beatiful..so !!===========
       Rahul Vairagi
=================================== Rahul Vairagi =================================== My Blogs: www.sqlserver2005forum.blogspot.com www.knwhub.blogspot.com

Similar Messages

  • Multiple namespace in Reciver XML file

    Hi I am recivering a file which has
    a namespace declaration like this.
    <?xml version="1.0" encoding="UTF-8"?>
    <Messages xmlns="http://www.emeter.com/energyip/readsforbillinginterface2">
    <ReplyMessage xmlns="http://www.emeter.com/energyip/readsforbillinginterface2">
      <Header>
    As per W3C multiple namespace should be handled but within PI when I upload this my Mapping Fails.
    Can you please help . I tried adding an attribute but that is also not working .
    Regards
    Gagan

    Hi ,
    first write  UDFs to remove name sapces,below peace of line code will help to remove it.
    replaceAll("xmlns.?(\"|\').?(\"|\')", "").
    or even simple JAVA mapping also enough.
    Regards,
    Raj

  • What is the best way to change a namespace in an xml document

    Hi,
    I need to change an xml namespaces. The xml has about 200 elements and every element may have a namespace attribute (namespaces are all the same).
    Is there any better solution then the following function?
    SQL> create or replace function change_namespace(p_xml xmltype, p_namespace varchar2) return xmltype is
      2    l_doc dbms_xmldom.DOMDocument;
      3    l_nodes dbms_xmldom.DOMNodelist;
      4    l_node dbms_xmldom.DOMNode;
      5  begin
      6    l_doc:=dbms_xmldom.NewDOMDocument(p_xml);
      7    l_nodes:=dbms_xmldom.getElementsByTagName(l_doc,'*');
      8    for i in 0..dbms_xmldom.getlength(l_nodes)-1 loop
      9      l_node:=dbms_xmldom.item(l_nodes,i);
    10      if i=0 then
    11        --set namespace only for the root node
    12        dbms_xmldom.setattribute(dbms_xmldom.makeElement(l_node),'xmlns',p_namespace);
    13      else
    14        --remove all the other namespaces
    15        dbms_xmldom.removeattribute(dbms_xmldom.makeElement(l_node),'xmlns');
    16      end if;
    17    end loop;
    18 
    19    return dbms_xmldom.getxmltype(l_doc);
    20  end;
    21  /
    Function created.
    SQL> select change_namespace(xmltype('<a xmlns="aaa"><b xmlns="aaa">4</b><c>44</c></a>'),'newnamespace')
      2  from dual;
    CHANGE_NAMESPACE(XMLTYPE('<AXMLNS="AAA"><BXMLNS="AAA">4</B><C>44</C></A>'),'NEWN
    <a xmlns="newnamespace">                                                       
      <b>4</b>                                                                     
      <c>44</c>                                                                    
    </a> Ants

    Hi,
    I found a better and almost 10x faster way to remove the namespaces, using xsl.
    here's the original xsl with a little modifications http://bytes.com/forum/thread448445.html
    SQL> with t as (select xmltype('<a xmlns="aaa"><b xmlns="aaa">4</b><c>44</c></a>') xcol from dual)
      2  select xmltransform(xcol
      3    ,xmltype('<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
      4               <xsl:template match="*">
      5                <xsl:element name="{local-name()}" namespace="">
      6                 <xsl:apply-templates select="@* | node()" />
      7                </xsl:element>
      8               </xsl:template>
      9              </xsl:stylesheet>'))
    10  from t;
    XMLTRANSFORM(XCOL,XMLTYPE('<XSL:STYLESHEETVERSION="1.0"XMLNS:XSL="HTTP://WWW.W3.
    <a><b>4</b><c>44</c></a>+but check Laurents Schneider's blog website+
    I didn't find any posts about namespace on Schneider's blog.
    Ants

  • XPath query on multiple namespace XML document

    Hi,
    I am trying to locate an element in a WordML XML document using XPath.
    The structure looks like:
    <w:body>
         <wx:sect>
              <aml:annotation aml:id="0" w:type="Word.Bookmark.Start" w:name="DOC0000966"/>
    ...So I use the following expression "/wordDocument//body/sect" wich gives me a list with the <w:sect> nodes.
    Then I search for "annotation[@type='Word.Bookmark.Start']" starting from each <w:sect> node. This yields the <aml:annotation> elem.
    So far so good.
    Now I have to handle a second case as well.
    <w:body>
         <wx:sect>
         <w:p>
              <aml:annotation aml:id="0" w:type="Word.Bookmark.Start" w:name="DOC0000966"/>
    ...As you can see the <aml:annotation> is nested inside a <w:p> elem.
    My intention was to use the expression "//annotation[@type='Word.Bookmark.Start']"to handle both cases, but this expression does not match neither.
    I have tried several different alternatives with expressions and NamingContext implementations, none working.
    What am I missing?
    Thanks in advance,
    Mariano.

    Hello,
    I decided to remove all namespaces and prefixes from the XML document and now the expression works.
    I have chaned the following:
    DocumentBuilderFactory is now namespace aware (it isn't by default).
              DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
              builderFactory.setNamespaceAware(true);I picked this NamespaceContext implementation from JAXP 1.4 samples and mapped all prefixes and namespaces coming inside the XML.
              NamespaceContextImpl ns = new NamespaceContextImpl();
              ns.bindPrefixToNamespaceURI("aml", "http://schemas.microsoft.com/aml/2001/core");
              ns.bindPrefixToNamespaceURI("dt", "uuid:C2F41010-65B3-11d1-A29F-00AA00C1488");
              ns.bindPrefixToNamespaceURI("o", "urn:schemas-microsoft-com:office:office");
              ns.bindPrefixToNamespaceURI("sl", "http://schemas.microsoft.com/schemaLibrary/2003/core");
              ns.bindPrefixToNamespaceURI("v", "urn:schemas-microsoft-com:vml");
              ns.bindPrefixToNamespaceURI("w", "http://schemas.microsoft.com/office/word/2003/wordml");
              ns.bindPrefixToNamespaceURI("w10", "urn:schemas-microsoft-com:office:word");
              ns.bindPrefixToNamespaceURI("wx", "http://schemas.microsoft.com/office/word/2003/auxHint");
              XPathFactory xpathFactory = XPathFactory.newInstance();
              XPath xpath = xpathFactory.newXPath();
              xpath.setNamespaceContext(ns);Finally, I prefixed all elements in xpath expressions.
    "//aml:annotation[@w:type='Word.Bookmark.Start']"Happier now,
    Mariano.

  • How to parse multiple xml documents from single buffer

    Hello,
    I am trying to use jaxb 2.0 to parse a buffer which contains multiple xml documents. However, it seems that it is meant to only parse a single document at a time and throws an exception when it gets to the 2nd document.
    Is there a way I can tell jaxb to only parse the first complete document and not fetch the next one out of the buffer? Or what is the most efficient way to separate the buffer into two documents without parsing it manually. If I have to search the buffer for the next document root and then split the buffer, it seems like that defeats the purpose of using jaxb as the parser.
    I am using the Unmarshaller.unmarshall method and the exception I am getting is:
    org.xml.sax.SAXParseException: Illegal character at end of document, &#x3c;.]
         at javax.xml.bind.helpers.AbstractUnmarshallerImpl.createUnmarshalException(AbstractUnmarshallerImpl.java:315)
         at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.createUnmarshalException(UnmarshallerImpl.java:476)
         at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:198)
         at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:167)
         at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:137)
         at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:184)
    Thank you for your help

    It's just like any other XML parser, it's only designed to parse one XML document. If you have something that concatenates two XML documents together (that's what your "buffer" sounds like), then stop doing that.

  • How to Add namespace to all elements in a xml document

    Hi,
    I am trying to read an xml file that does not have any namespace definitions. I have been able to create another schema in which i specify the namespace defination as shown below.
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://TargetNamespace.com/AckPaymentFile_PL" targetNamespace="http://TargetNamespace.com/AckPaymentFile_PL" xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd" nxsd:version="DTD" elementFormDefault="qualified" attributeFormDefault="unqualified">
    <include schemaLocation="PM_XML_FILE_ACK_SCHEMA_NO_NAMESPACE.xsd"/>
    </xs:schema>
    Once i do it, i am able to see the namespace has been assigned to the root element. I am looking for a way to assign the namespace and prefix tag to all elements in the xml document. If i don't i am unable to access any part of the xml document, keep getting please verify if xpath is correct.
    Thanks
    Sridhar

    Hello,
    Once you've answered all the above.
    If you can run xpath that supports functions against the xml, the expression:
    count(//phone)Otherwise, without leaving SQL:
    select count(*) from
    xmltable('//phone' passing
      -- Your XML goes here, could be a table column with type XMLTYPE.
      xmltype('<person><phone>123-456-7890</phone><phone>098-765-4321</phone></person>')
      columns phone varchar2(24 char) path '/phone'
    ;

  • Transforming signed XML document with namespace invalidates signature

    I am running into a problem signing an XML document. Well, signing the document isn't the problem, as I can sign it and then verify the signature with the public key successfully. The problem comes when I transform the document to a string. It all appears to be OK, but when I transform it back, the hash no longer verifies. After more testing, it appears that the issue is related to namespaces. When I remove namespaces from the document, the signing and transformations work just fine. Does anyone have any insight on this?
    Here is how I am transforming the document to an XML string that I and back.
        try
          signSAML( doc, assertionElement );
          xmlSource = new DOMSource( doc );
          baos = new ByteArrayOutputStream();
          outputTarget = new StreamResult( baos );
          xmlString  = new String( new ByteArrayInputStream( baos.toByteArray() ) );
          transformerFactory = TransformerFactory.newInstance();
          transformer = transformerFactory.newTransformer();
          transformer.transform( xmlSource, outputTarget ); 
          boolean verified = verify( doc );
          if ( verified )
            System.out.println( "Verified" );
          else
            System.out.println( "UNVerified" );
        catch ( Exception e )
          // TODO Auto-generated catch block
          e.printStackTrace();
        }

    jtahlborn wrote:
    i'm not talking about the transform, i'm talking about this line:
    xmlString  = new String( new ByteArrayInputStream( baos.toByteArray() ) );which is a great way to break xml data.Yes. That's not the only kind of data it's good at breaking, either.
    To the OP: just have your transform output to a StringWriter in the first place. Don't muck about converting between chars and bytes unless you know the correct encoding and use it. Which you don't know it and you didn't use it.

  • XML Structured Index with multiple namespaces

    Hi,
    I'm having some trouble creating an xmlindex with structured component on a clob xmltype column without registered schema, whose data uses multiple namespaces.
    The code I'm using atm:
    CREATE TABLE "DECLARATIONS"
        "ID" NUMBER(19,0),
        "XML" "SYS"."XMLTYPE"
    CREATE INDEX decl_header_ix ON "DECLARATIONS"(xml) INDEXTYPE IS XDB.XMLINDEX
      PARAMETERS ('PATHS (INCLUDE (/emcs:emcsDeclaration/emcs:header//*)
                          NAMESPACE MAPPING (xmlns:emcs="http://www.myurl.eu/myapp/schema/emcs/nl"))');
    INSERT INTO "DECLARATIONS" VALUES (1,'
    <?xml version = ''1.0'' encoding = ''UTF-8'' standalone = ''yes''?>
    <emcs:emcsDeclaration xsi:schemaLocation="http://www.myurl.eu/myapp/schema/emcs/nl emcs_domain.xsd"
    xmlns:common="http://www.myurl.eu/myapp/schema/common"
    xmlns:emcs="http://www.myurl.eu/myapp/schema/emcs/nl"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
       <emcs:header>
          <common:identifier>70</common:identifier>
          <common:declarationSequenceNumber>54566</common:declarationSequenceNumber>
          <common:dateCreated>2010-10-21-01:00</common:dateCreated>
          <common:status>01 Draft e-AAD in preparation</common:status>
       </emcs:header>
    </emcs:emcsDeclaration>');A this moment it's not desirable for us to register the schemas used in oracle. According to the documentation I should be able to add a structured component to the index as follows:
    BEGIN
          DBMS_XMLINDEX.registerParameter('MY_XSI_GROUP_PARAMETER'
                  , 'ADD_GROUP GROUP MY_XSI_GROUP
                   XMLTABLE decl_header
                   XMLNAMESPACES (''http://www.myurl.eu/myapp/schema/emcs/nl'' AS emcs,
                           ''http://www.myurl.eu/myapp/schema/common'' AS common),
                        COLUMNS
                  status VARCHAR2(30)  PATH ''/emcs:emcsDeclaration/emcs:header/common:status/text()''
       END;
    ALTER INDEX DECL_HEADER_IX PARAMETERS('PARAM MY_XSI_GROUP_PARAMETER');However this results in an ORA-00904: invalid identifier. After some experimenting it seems that oracle tries to parse the namespace URLs as identifiers (even tho http://download.oracle.com/docs/cd/E14072_01/appdev.112/e10492/xdb_indexing.htm#BCGJAAGH & http://download.oracle.com/docs/cd/E14072_01/appdev.112/e10492/xdb_xquery.htm#BABJCHCC specify the former), so I swapped them around:
    BEGIN
          DBMS_XMLINDEX.dropParameter('MY_XSI_GROUP_PARAMETER');
          DBMS_XMLINDEX.registerParameter('MY_XSI_GROUP_PARAMETER'
              , 'ADD_GROUP GROUP MY_XSI_GROUP
              XMLTABLE decl_header
              XMLNAMESPACES (emcs ''http://www.myurl.eu/myapp/schema/emcs/nl'',
              common ''http://www.myurl.eu/myapp/schema/common''),
              COLUMNS
              status varchar2(30)  PATH ''/emcs:emcsDeclaration/emcs:header/common:status/text()''
       END;
    ALTER INDEX DECL_HEADER_IX PARAMETERS('PARAM MY_XSI_GROUP_PARAMETER');Oracle seems to get a bit further with this, resulting in a ORA-19102: XQuery string literal expected. Here I pretty much hit a dead end. Removing the xmlnamespaces declaration altogether leads to a ORA-31013: Invalid XPATH expression. Going through the examples on http://www.liberidu.com/blog/?p=1805 works fine, but as soon as I try to add namespaces to it they stop working as well.
    So my question is: how do I get xmlnamespaces (with non-default namespaces) to work in a structured xmlindex component?

    If you want, I can help you tomorrow. Call me at my nieuwegein office or mail me at marco[dot]gralike[at]amis[dot]nl
    I have some time tomorrow, so I can help you with this. My next presentation for UKOUG will be on XML indexes strategies anyway...
    In the meantime and/or also have a look at:
    XML Howto's (http://www.liberidu.com/blog/?page_id=441) specifically:
    XML Indexing
    * Unstructured XMLIndex (part 1) – The Concepts (http://www.liberidu.com/blog/?p=228)
    * Unstructured XMLIndex (Part 2) – XMLIndex Path Subsetting (http://www.liberidu.com/blog/?p=242)
    * Unstructured XMLIndex (Part 3) – XMLIndex Syntax Dissected (http://www.liberidu.com/blog/?p=259)
    * Unstructured XMLIndex Performance and Fuzzy XPath Searches (http://www.liberidu.com/blog/?p=310)
    * Structured XMLIndex (Part 1) – Rules of Numb (http://www.liberidu.com/blog/?p=1791)
    * Structured XMLIndex (Part 2) – Howto build a structured XMLIndex (http://www.liberidu.com/blog/?p=1798)
    * Structured XMLIndex (Part 3) – Building Multiple XMLIndex Structures (http://www.liberidu.com/blog/?p=1805)
    The posts were based on Index for XML with Repeated Elements maybe that is a bit better to read than on my notepad on the internet (aka blog)
    Edited by: Marco Gralike on Oct 28, 2010 7:51 PM

  • Issue with parsing an xml document and namespaces

    I am having an issue when parsing an xml document that includes a namespace.
    Here is my xml:
    <?xml version="1.0" encoding="utf-8"?>
    <StatusFile xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" TxCnt="247" TxTotal="5756845.31" SourceId="3" xmlns="http://www.test.com/cig/payments/optimizer/status/2004/10/">
    <Tx PmtId="350031" Amt="16739" TxSts="09" CustSts="04" ChkNum="10605770" />
    <Tx PmtId="350990" Amt="31698.66" TxSts="09" CustSts="04" ChkNum="10605821" />
    <Tx PmtId="354992" Amt="201320.08" TxSts="09" CustSts="04" />
    <Tx PmtId="349277" Amt="6675.17" TxSts="09" CustSts="04" ChkNum="10605822" />
    <Tx PmtId="354979" Amt="66949.75" TxSts="09" CustSts="04" ChkNum="10605823" />
    <Tx PmtId="349341" Amt="63258.49" TxSts="09" CustSts="04" ChkNum="10605824" />
    <Tx PmtId="350025" Amt="5866.04" TxSts="09" CustSts="04" ChkNum="10605830" />
    <Tx PmtId="350024" Amt="15671.8" TxSts="09" CustSts="04" ChkNum="10605831" />
    <Tx PmtId="346822" Amt="9880.64" TxSts="09" CustSts="04" />
    <Tx PmtId="350023" Amt="1360" TxSts="09" CustSts="04" />
    <Tx PmtId="349802" Amt="131267" TxSts="09" CustSts="04" ChkNum="10605832" />
    <Tx PmtId="343573" Amt="14532.76" TxSts="09" CustSts="04" ChkNum="10605833" />
    <Tx PmtId="352675" Amt="4436" TxSts="09" CustSts="04" />
    <Tx PmtId="350022" Amt="1260" TxSts="09" CustSts="04" ChkNum="10605834" />
    <Tx PmtId="349714" Amt="80778" TxSts="09" CustSts="04" ChkNum="10605835" />
    <Tx PmtId="352676" Amt="10136" TxSts="09" CustSts="04" ChkNum="10605836" />
    <Tx PmtId="352679" Amt="25511.69" TxSts="09" CustSts="04" ChkNum="10605837" />
    <Tx PmtId="346502" Amt="12842.69" TxSts="10" CustSts="05" />
    <Tx PmtId="346503" Amt="4232.61" TxSts="09" CustSts="04" ChkNum="10605838" />
    </StatusFile>
    Here is my current code base:
    CREATE OR REPLACE PROCEDURE ParseXML(xml VARCHAR2) IS
    myParser xmlparser.parser := xmlparser.newparser;
    myDoc xmldom.DOMNode;
    myNodes xmldom.DOMNodeList;
    myElement xmldom.DOMElement;
    trec NDE_CIG_STATUS_TRANSACTIONS%ROWTYPE;
    BEGIN
    xmlparser.parseBuffer(myParser,xml);
    myDoc := xmldom.makeNode(xmlparser.getDocument(myParser));
    myNodes := xslprocessor.selectNodes(myDoc,'//Tx');
    FOR i IN 0..xmldom.getLength(myNodes)-1 LOOP
    myElement := xmldom.makeElement(xmldom.item(buyOrders,i));
    trec.pmt_id := xmldom.getAttribute(curBuy,'PmtId');
    INSERT INTO NDE_CIG_STATUS_TRANSACTIONS(PMT_ID) VALUES (trec.pmt_id);
    END LOOP;
    COMMIT;
    END ParseXML;
    If I remove the namespace, everything works just fine. The issue is that I cannot remove the namespace.
    Anyone have any suggestions on how I can get the xslprocessor.selectNodes to recognize my namespace?
    Thanks,
    Mark Moran

    Everyone,
    Well after lots of hours spent reading web pages and blogs, etc... I was able to re-write my procedure and get it to work with different calls.
    Here is my updated code.
    PROCEDURE PARSE_STATUS_XML(P_FILE_NAME IN VARCHAR2, P_XML_FILE IN CLOB) IS
    V_PARSER XMLPARSER.PARSER := XMLPARSER.NEWPARSER;
    V_DOCUMENT XMLDOM.DOMDOCUMENT;
    V_NODES XMLDOM.DOMNODELIST;
    V_ELEMENT XMLDOM.DOMELEMENT;
    V_TBL_RECORD NDE_CIG_STATUS_TRANSACTIONS%ROWTYPE;
    BEGIN
    XMLPARSER.PARSECLOB(V_PARSER, P_XML_FILE);
    V_DOCUMENT := XMLPARSER.GETDOCUMENT(V_PARSER);
    V_ELEMENT := XMLDOM.GETDOCUMENTELEMENT(V_DOCUMENT);
    V_NODES := XMLDOM.GETELEMENTSBYTAGNAME(V_ELEMENT,'Tx','http://www.test.com/cig/payments/optimizer/status/2004/10/');
    FOR I IN 0..XMLDOM.GETLENGTH(V_NODES)-1 LOOP
    V_ELEMENT := XMLDOM.MAKEELEMENT(XMLDOM.ITEM(V_NODES,I));
    V_TBL_RECORD.PMT_ID := XMLDOM.GETATTRIBUTE(V_ELEMENT,'PmtId');
    V_TBL_RECORD.PMT_AMT := XMLDOM.GETATTRIBUTE(V_ELEMENT,'Amt');
    V_TBL_RECORD.E_STATUS_CODE := XMLDOM.GETATTRIBUTE(V_ELEMENT,'TxSts');
    V_TBL_RECORD.E_REASON_CODE := XMLDOM.GETATTRIBUTE(V_ELEMENT,'StsRsn');
    V_TBL_RECORD.E_CUSTOMER_STATUS_CODE := XMLDOM.GETATTRIBUTE(V_ELEMENT,'CustSts');
    V_TBL_RECORD.UPS_TRACKING_NBR := XMLDOM.GETATTRIBUTE(V_ELEMENT,'UpsTrcNum');
    V_TBL_RECORD.FED_REFERENCE_NBR := XMLDOM.GETATTRIBUTE(V_ELEMENT,'FedRefNum');
    V_TBL_RECORD.FIDB_TRACKING_NBR := XMLDOM.GETATTRIBUTE(V_ELEMENT,'FIDbtTrcNum');
    V_TBL_RECORD.CHECK_NBR := XMLDOM.GETATTRIBUTE(V_ELEMENT,'ChkNum');
    INSERT INTO NDE_CIG_STATUS_TRANSACTIONS(
    CREATE_DATE,
    XML_FILE_NAME,     
    PMT_ID,
    PMT_AMT,
    E_STATUS_CODE,
    E_REASON_CODE,
    E_CUSTOMER_STATUS_CODE,
    UPS_TRACKING_NBR,
    FED_REFERENCE_NBR,
    FIDB_TRACKING_NBR,
    CHECK_NBR
         VALUES (
    SYSDATE,
    P_FILE_NAME,
    V_TBL_RECORD.PMT_ID,
    V_TBL_RECORD.PMT_AMT,
    V_TBL_RECORD.E_STATUS_CODE,
    V_TBL_RECORD.E_REASON_CODE,
    V_TBL_RECORD.E_CUSTOMER_STATUS_CODE,
    V_TBL_RECORD.UPS_TRACKING_NBR,
    V_TBL_RECORD.FED_REFERENCE_NBR,
    V_TBL_RECORD.FIDB_TRACKING_NBR,
    V_TBL_RECORD.CHECK_NBR
    END LOOP;
    COMMIT;
    EXCEPTION
    WHEN OTHERS THEN
         RAISE;
    END PARSE_STATUS_XML;
    Mark

  • XML document into multiple tables

    How to insert a xml document into multiple tables. Eg. Purchase Order having multiple line items. I have to insert xml document into Parent as well as child with different sets of columns.

    I created the tables using the create_ch14_tables.sql. I call it using java -classpath .;C:\commerceone\xpc\lib\xmlparserv2.jar;C:\commerceone\xpc\lib\classes12.zip;C:\commerceone\xpc\lib\xsu12.jar XMLLoader -file deptempdepend.xml -connName default -transform deptempdepend.xsl. The code doesn't seem to like the "<xsl:for-each select="Department">" tags. If I remove them, the insDoc.getDocumentElement().getFirstChild() will find the element, but it still doesn't insert anything into the database.
    Thank You,
    Dave

  • XMLType.extract and namespace in XML document

    I found some strange behaviour of XMLType:
    I create table by means of:
    create table conf (id varchar2(10), info sys.xmltype);
    I insert xml document into table.
    The text of xml document is:
    <conference finishPage="/regfinish_en.jsp" id="CID003" xmlns="http://stud.aanet.ru/conf">
    <conferencetitle>title1 </conferencetitle>
    </conference>
    Then I execute:
    select a.info.extract('//conferencetitle/text()').getstringval() from conf a
    result is empty string.
    I replace document with
    <conference finishPage="/regfinish_en.jsp" id="CID003" >
    <conferencetitle>title1 </conferencetitle>
    </conference>
    Now result of statement
    select a.info.extract('//conferencetitle/text()').getstringval() from conf a
    is "title1"
    But than I replace document with
    <tc:conference finishPage="/regfinish_en.jsp" id="CID003" xmlns:tc="http://stud.aanet.ru/conf">
    <tc:conferencetitle>title1 </tc:conferencetitle>
    </tc:conference>
    and execute
    select a.info.extract('//tc:conferencetitle/text()').getstringval() from conf a
    or
    select a.info.extract('//t:conferencetitle/text()').getstringval() from conf a
    The result is "title1"
    I receive this result on Oracle for Linux 9.0.1.3.

    hi, before you set the attribute, you need to create a Namespace element preliminary.
    Try the following code:
    ELEMENT = DOCUMENT->CREATE_SIMPLE_ELEMENT_NS(
    NAME = 'abap'
    PREFIX = 'asx'
    PARENT = DOCUMENT ).
    ATTRIBUTE = DOCUMENT->create_namespace_decl(
    NAME = 'XMLNS'
    PREFIX = 'asx'
    URI = 'http://www.sap.com/abapxml').
    ELEMENT->SET_ATTRIBUTE_NODE_NS(
    NEW_ATTR = ATTRIBUTE).
    Hope my reply will be useful.
    thanks

  • How to declare the namespace of XML document to use in oracle DB?

    I have an XML Schema file( 'Hospital.xsd' ) that reference the XML document ('Hospitals.xml' ).
    That I use JDeveloper to build them up.
    JDeveloper had set the default namespace as 'http://www.example.org'
    like this :
    <?xml version="1.0" encoding="UTF-8" ?>
    <Hospitals xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.example.org src/Hospital.xsd"
    xmlns="http://www.example.org">
    If I want these two files ('Hospital.xsd' and 'Hospitals.xml') placed into
    the table in the oracle database.
    1. Should I create two tables? one for XSD and another for XML.
    2. Should I keep the XSD file in the oracle database?
    3. What is the namespace to declare in the heading of XML file?
    The database name or my website URL?
    Thank you very much.
    Kanokporn P.

    Sounds a lot like this question, only with less details.
    how to read data from XML  variable and insert into table variable
    We can only help if you provide us details to help as we cannot see what you are doing and only know what you tell us.  Plenty of examples abound on the forums that cover the topics you seek as well.

  • Loading/breaking large files containing multiple XML documents using plsql

    Hi I have a requirement where in the client sends the multiple xml payloads/documents in a single text file. I need to load that into the xmltype varialbe. How to do this?
    I'm able to load the entire document into a clob object, here.. all the xml payloads are loaded into a single row. When I try to access this I get a error
    ORA-31001: Invalid resource handle or path name "/MobileInventoryResponse.dtd"
    ORA-06512: at "SYS.XMLTYPE", line 254
    ORA-06512: at line 1
    This error is due to the dtd present in the xml document : <!DOCTYPE MobileInventoryResponse SYSTEM "MobileInventoryResponse.dtd">
    But if I load the data into a clob after removing the doctype reference then I get the following error. Here to mulitple xml documents are loaded into a single clob row.
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00209: PI names starting with XML are reserved
    Error at line 81
    ORA-06512: at "SYS.XMLTYPE", line 254
    ORA-06512: at line 1
    When try to access this by using select xmltype(x) from t
    where x is column type of clob.
    Please let me know any method or type loading the multiple xml documents by using plsql. Only plsql method. There is a way by using SAX Loader. But can it be used in plsql or its a java method of loading.
    Regards,
    Naveen
    Edited by: MAN on Oct 18, 2008 9:21 PM

    sorry for that...
    There was enter character between some tags. From there I'm not receiving that particular error.
    Now what I get is
    ORA-31001: Invalid resource handle or path name "/MobileInventoryResponse.dtd"
    ORA-06512: at "SYS.XMLTYPE", line 254
    ORA-06512: at line 1
    ORA-06512: at line 39
    This is because there is a doctype at the start of the xml payload.
    But if there is no <!DOCTYPE MobileInventoryResponse SYSTEM "MobileInventoryResponse.dtd"> this statement then it works fine.
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE MobileInventoryResponse SYSTEM "MobileInventoryResponse.dtd">
    <MobileInventoryResponse>
    And this exercise I'm doing in my Windows xp loaded operating system with a local instance of oracle ... Do i need to do any other setting.
    Along with that I followed your method mentioned @ Re: LPX-00209: PI names starting with XML are reserved
    ignore:=dbms_xdb.createResource('/MobileInventoryResponse.dtd',bfilename('XML_DIR','MobileInventoryResponse.dtd'));
    And I'm not getting how it will refer the this resource.
    this above partilcular statement . should it be executed when ever we insert into the table ? But in the dtd there is no word saying "MobileInventoryResponse".
    got this error.
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00104: Warning: element "MobileInventoryResponse" is not declared in the DTD
    Error at line 1
    ORA-06512: at "SYS.XMLTYPE", line 254
    ORA-06512: at line 1
    ORA-06512: at line 21
    This is how I'm doing in the block
    DECLARE
    l_filehandle UTL_FILE.FILE_TYPE;
    l_filename VARCHAR2(50):='test.xml';
    l_rec_data VARCHAR2(500);
    l_rec_trim_data VARCHAR2(500);
    l_rec_trim_upper VARCHAR2(500);
    l_rec_full_data CLOB;
    ignore boolean;
    BEGIN
    l_filehandle := UTL_FILE.FOPEN('XML_DIR',l_filename,'R');
    --dbms_xdb.deleteResource('/MobileInventoryResponse.dtd',dbms_xdb.DELETE_RESOURCE   );
    LOOP
    ignore:=dbms_xdb.createResource('/MobileInventoryResponse.dtd',bfilename('XML_DIR','MobileInventoryResponse.dtd'));
    commit;
    UTL_FILE.GET_LINE(l_filehandle, l_rec_data);
    --dbms_output.put_line('l_rec_data : '|| l_rec_data);
    -- Trim the record to remove spaces
    l_rec_trim_data := TRIM(l_rec_data);
    l_rec_trim_upper := UPPER(l_rec_trim_data);
    l_rec_full_data := l_rec_full_data||l_rec_data;
    IF l_rec_trim_upper LIKE '</MOBILEINVENTORYRESPONSE>' THEN
    dbms_output.put_line('l_rec_full_data : '||l_rec_full_data);
    INSERT INTO library_xml VALUES(xmltype(l_rec_full_data));
    l_rec_full_data:=NULL;
    END IF;
    dbms_xdb.deleteResource('/MobileInventoryResponse.dtd',dbms_xdb.DELETE_RESOURCE );
    commit;
    END LOOP;
    UTL_FILE.FCLOSE(l_filehandle);
    COMMIT;
    --exception just for testing purpose
    EXCEPTION
    WHEN no_data_found THEN
    NULL;
    commit;
    END;
    Edited by: MAN on Oct 21, 2008 2:47 AM

  • How to save sections of a single XML Document to multiple tables ?

    Firstly, I apologise for the long e-mail but I feel it's necessary in order to clarify my problem/question.
    The XML document representation below stores information about a particular database. From the information in the XML document you can tell that there is a single database called "tst" which contains a single table called "tst_table". This table in turn has two columns called "CompanyName" & "Country".
    I want to use Oracle's XML SQL Utility to store this information into three seperate database tables. Specifically, I want to store the information pertaining to the database (i.e. name etc.) in one table, the information pertaining to the table (name, no. of columns etc.) in another and the information pertaining to the columns (name, type etc.) in yet another table.
    I have seen samples where an entire XML Document is saved to a database table but I cannot find any examples where different sections of a single XML Document are saved into different database tables using the XML SQL Utility.
    Can you please tell me the best approach to take in order to accomplish this . Does it involve creating an XMLDocument and then extracting the relevant sections as XMLDocumentFragment's, retrieving the String representations of these XMLDocumentFragment's and passing these strings to the OracleXMLSave.insertXml() method.
    Is this the best approach to take or are there any other, perhaps more efficient or elegant, ways of doing this ?
    Thanks in advance for your help
    - Garry
    <DATABASE id="1" name="tst">
    <TABLES>
    <TABLE name="tst_table">
    <NAME>Customers</NAME>
    <COLUMNS>
    <COLUMN num="1"> <COLID>2</COLID>
    <COLNAME>CompanyName</COLNAME>
    <COLTYPE>Text</COLTYPE>
    </COLUMN>
    <COLUMN num="2">
    <COLID>3</COLID>
    <COLNAME>Country</COLNAME>
    <COLTYPE>Text</COLTYPE>
    </COLUMN>
    </COLUMNS>
    </TABLE>
    </TABLES>
    </DATABASE>
    null

    See this thread;
    {thread:id=2180799}
    Jeff

  • Multiple XML documents in one SWF

    Hi, i'm trying to create a mix and match clothing application
    using flash for a school project but am having trouble with xml
    documents. Using an online tutorial, i found it was quite easy to
    load up one xml document, example of code below.
    I thought it would be as simple as copying all the code and
    changing the variable names to load a second xml document but i
    find when i run the code, that only the last xml document in the
    code loads, could anyone give me any tips? Thanks
    function loadXML(loaded) {
    if (loaded) {
    xmlNode = this.firstChild;
    image = [];
    description = [];
    total = xmlNode.childNodes.length;
    for (i=0; i<total; i++) {
    image
    = xmlNode.childNodes.childNodes[0].firstChild.nodeValue;
    description
    = xmlNode.childNodes.childNodes[1].firstChild.nodeValue;
    firstImage();
    } else {
    content = "file not loaded!";
    xmlData = new XML();
    xmlData.ignoreWhite = true;
    xmlData.onLoad = loadXML;
    xmlData.load("images.xml");

    Hi, i checked my text and description boxes in my document,
    and it is in fact loading the separate xml document, the problem
    seems to stem from the fact that it is not displaying the xml image
    within the movie clip.
    I have two separate mc's on the stage, with different
    instance names, flash displays the description of each separate xml
    document, however, it only shows one of the movie clips images, if
    i delete one from the actionscript, it shows the other, so it must
    be something to do with them overwriting each other, i used a
    trace, so i know the data is in flash for the images which arent
    being shown, it just isn't showing for some reason.

Maybe you are looking for

  • Reports 3.0 Printouts (Text Mode)

    1) We have been trying some printouts from the reports runtime by clicking on (Report Builder 3.0.4.6.3/Developer forms 5.0) the printer icon available on the menu bar and also specifying the appropriate print properties in the print dialogue box and

  • How does waveform graph downsamples the data before it is plotted

    Hi, I'm interested in how does waveform graph downsamples the data before it is plotted and what algorithm is used for this purpose? My goal is to plot 30 plots that have 1M samples each and I would like to downsample them before plotting onto a grap

  • Delivery Split ( 1 STO n deliveries)

    Dear all, I have a req where I need to create multiple Deliveries for one STO, there are standard pallet quantity in WM and they want to create 1 TO per delivery. there is going to be only one line item per STO. Eg: say we have a STO for 198 each pal

  • Administrative rights to Windows Server

    I know that we need administrative rights to a window box during installation and configuration. After cutover to production, is it possible for the DBA to survive if administrative rights are revoked? What daily/often-run tasks will be affected? Tha

  • Two days ago, Skype stopped accepting 1.800 toll f...

    For the past two days, when I use Skype to place a 1.800 or 1.855 call, the number does not connect and the error message is "call dropped". I tried two other computers in our area and they are having the same problem. I am calling from Kabul, Afghan