SSIS - How to extract a mixed XML content

Hi folks,
I have a mixed xml content file like that:
<account>123456
<name>John SMITH</name>
<adress>Something
<street>Dummy street
<number>5</number>
</street>
<city> New York
<postCode>12345</postCode>
</city>
</adress>
</account>
What's the best way to extract a such content using SSIS? (Of course I can have more than 1 child for each node in the file)
Thank you,
Said
  

Thank you Sudeep. I'm looking for how to do it with XMLReader.
Said
Hi,
You could search the net there are a lot of tutorials on this.
two of them:
http://www.dotnetjohn.com/articles.aspx?articleid=81
http://www.beansoftware.com/ASP.NET-Tutorials/XML-Programming-VB.NET.aspx
Hope this helps !!
Sudeep   |   
My Blog

Similar Messages

  • How to extract the actual XML document from soap message?

    My problem is " how to extract the actual XML document from soap message? "
    i just want to extract the attachment i.e. (pure XML document without any soap header or envolope).
    i could be ver thank full if u could solve my problem.
    [email protected]

    Hi,
    This is some skeleton code for extracting an attachment from a SOAPMessage.
    import javax.activation.DataHandler.;
    import javax.xml.soap.*;
    import javax.xml.message.*;
    Iterator allAttachments = message.getAttachments();
    AttachmentPart ap1 = null;
    while(allAttachments.hasNext()){
    ap1 = (AttachmentPart)allAttachments.next();
    //Check that the attachment is correct one. By looking at its mime headers
    //Convert the attachment part into its DOM representation:
    if(ap1.getContentType() == "text/xml"){
    //Use the activation dataHandler class to extract the content, then create a StreamSource from
    //the content.
    DataHandler attachmentContent = ap1.getDataHandler();
    StreamSource attachmentStream = new StreamSource(attachmentContent.getInputStream());
    DOMResult domAttachment = getDOMResult(attachmentStream);
    domAttachment holds an xml representation of the attachment.
    Hope this helps.

  • How to extract data from XML file with JavaScript

    HI All
    I am new to this group.
    Can anybody help me regarding XML.
    I want to know How to extract data from XML file with JavaScript.
    And also how to use API for XML
    regards
    Nagaraju

    This is a Java forum.
    JavaScript is something entirely different than Java, even though the names are similar.
    Try another website with forums about JavaScript.
    For example here: http://www.webdeveloper.com/forum/forumdisplay.php?s=&forumid=3

  • How to display string with XML content in 4.6?

    Hi,
    I`d like to know how to display string with XML content in it for 4.6.
    4.6 has not method parse_string.
    And example like this is not helpful:
      DATA: lo_mxml    TYPE REF TO cl_xml_document.
      CREATE OBJECT lo_mxml.
      CALL METHOD lo_mxml->parse_string
        EXPORTING
          stream = gv_xml_string.
      CALL METHOD lo_mxml->display.
    Thank you.

    Hi,
    May be you can use fm SAP_CONVERT_TO_XML_FORMAT. But it have some issues with memory usage, the program consumed tons of memory during convert.

  • How to extract the image field content?

    Hi, experts
    I placed an image fields on an interactive form , user can upload jpg file into this field.
    Could you pls tell me how to extract that using programming languages with the help of XML DOM?
    I built a sample program that can retrive the content of the field, which is of type string, then when i save it to local drive, the image can not be displayed correctly.
    could you pls tell me how to solve that?
    br.
    Jun

    Jun,
    Did you figure this out on your own? Any one out there have an answer?
    Leti

  • Urgent Please - How avoid namespace tag in XML Content

    Hi XI Experts,
    <?xml version="1.0" encoding="UTF-8"?>
    <b><ns0:AAA xmlns:ns0="http://Abc.com"></b>
    <DocHeader><ClientID>ABC</ClientID><ClientDocID>null</ClientDocID><UserID>PurchaseOrder</UserID></DocHeader><Request Type="PO" action="insert"><ClientReference>PO-0099000099</ClientReference><DeliveryDate>20071025</DeliveryDate><Vendor>5104</Vendor><OrderLine><ExpectQTY>1.000</ExpectQTY></OrderLine></Request>
    <b></ns0:AAA></b>
    Please tell me how to avoid the xml content which is in <b>Bold</b>?
    Thank X in Advance......

    Hi,
    for removing namespace from ur XML content,remove the namespace from field XML namespace while defining message type.
    Refer:
    /people/sameer.shadab/blog/2005/12/05/how-to-remove-namespaces-in-mapping--xi
    and for removing </ns0:AAA> u can use XMLAnonymizerBean in modules.
    refer:
    /people/stefan.grube/blog/2007/02/02/remove-namespace-prefix-or-change-xml-encoding-with-the-xmlanonymizerbean
    Regards,
    Anoop

  • How to extract a tpz file contents ?

    Hi to all,
    does anybody know how to extract a tpz file without using XI ? I mean, I want to see the contents of the tpz file to get some code.
    Thanks in advance.

    hi
    The TPZ file contains 2 files. First is a matadata file and other is the TPT file so is there any method to view TPT or TPZ file.
    There is no tool available that I know but has some1 done any development in this field.
    quote
    regards
    krishna

  • How to extract data from xml and insert into Oracle table

    Hi,
    I have a large xml file. which will have hundreds of the following transaction tags having column names and there values.
    There is a table one of the schema with coulums "actualCostRate","billRate"....etc.
    I need to extract the values of these columns and insert into the table
    <Transaction actualCostRate="0" billRate="0" chargeable="1" clientID="NikuUK" chargeCode="LCOCD1" externalID="L-RESCODE_UK1-PROJ_UK_CNT_GBP-37289-8" importStatus="N" projectID="TESTPROJ" resourceID="admin" transactionDate="2002-02-12" transactionType="L" units="11" taskID="5017601" inputTypeCode="SALES" groupId="123" voucherNumber="ABCVDD" transactionClass="ABCD"/>
    <Transaction actualCostRate="0" billRate="0" chargeable="1" clientID="NikuEU" chargeCode="LCOCD1" externalID="L-RESCODE_US1-PROJ_EU_STD2-37291-4" importStatus="N" projectID="TESTPROJ" resourceID="admin" transactionDate="2002-02-04" transactionType="L" units="4" taskID="5017601" inputTypeCode="SALES" groupId="124" voucherNumber="EEE222" transactionClass="DEFG"/>

    Re: Insert from XML to relational table
    http://www.google.ae/search?hl=ar&q=extract+data+from+xml+and+insert+into+Oracle+table+&btnG=%D8%A8%D8%AD%D8%AB+Google&meta=

  • How to extract data from xml file and store that data inti data base table

    Hii All
    I have one table that table contains one column that column contain an XML file
    I want to extract data from that XML file and want to store that extracted data into an other table.
    That xml file has different different values
    I want to store that values into table in diff diff columns

    Hi,
    I am also facing the same problem.I have a .xml file and i need to import the data into the custom table in oracle database.
    Can you please let me know if you know the solution how to do it in oracle apps.
    Thanks,

  • How to extract data from xml field to dropdown list?

    Hi,
    I have designed a form and connected to a SQL server database using a web service. The XML data retrieved from wsdl connection is currently hold in a text field called 'XMLfield'. I need to extract the data such as 'PersonnelName' from XMLfield into a dropdown list. I used the following code and I do not get any error, but nothing come up and all my fields in the forms become bank when i click the dropdown list.
    I would appreciate it if anyone can help me with this issue.
    form1.DropDownList::click - (JavaScript, client)
    xfa.datasets.data.loadXML(form1.XMLfield.rawValue,0,1);
    form1.XMLfield.rawValue = xfa.datasets.data.saveXML();
    var dataGroup = xfa.resolveNode("xfa.data.Timesheet.Personnel.PersonnelName");
    var dataGroupLength = dataGroup.nodes.length;
    if (dataGroupLength == 0) {
      xfa.host.messageBox("There are no parts in the XML doc");
    else {
      for (var i=0; i < dataGroupLength; i++){
        this.addItem(dataGroup.nodes.item(i).nodes.item(0).value);
    Thanks,
    Roya

    Hi Roya,
    I think the loadXML will override your form data, so blanking out your fields.  You could try loading the xml data at the xfa.datasets level (that is xfa.datasets.loadXML(form1.XMLfield.rawValue,0,1);) or using E4X to process the XML.
    Another option though might be more rework is to use the Acrobat SOAP api which will return you a JavaScript object so you wont have to do any XML work.
    There's a good intro to the SOAP api here, http://www.avoka.com/blog/page/11/.
    Regards
    Bruce

  • How to extract data from xml file in owb 10.2?

    I have to load data from an xml file into a relational table , may i know how to do it in owb 10.2.

    This is a Java forum.
    JavaScript is something entirely different than Java, even though the names are similar.
    Try another website with forums about JavaScript.
    For example here: http://www.webdeveloper.com/forum/forumdisplay.php?s=&forumid=3

  • How to extract a clob xml string with multiple row of table tag. in 10g

    i have a xml value like:
    <table><c1>0</c1><c2>Mr</c2><c3>abc</c3><c4>Sharma</c4></table>
    <table><c1>0</c1><c2>Mrs</c2><c3>abcd</c3><c4>Sharma</c4></table>
    <table><c1>0</c1><c2>Mr</c2><c3>sabc</c3><c4>Sharma</c4></table>
    <table><c1>0</c1><c2>Mrs</c2><c3>sdabc</c3><c4>Sharma</c4></table>
    <table><c1>0</c1><c2>Mr</c2><c3>dabc</c3><c4>Sharma</c4></table>
    <table><c1>0</c1><c2>Mr</c2><c3>adbc</c3><c4>Sharma</c4></table>
    i want to insert each of <c> value in a table with respective columns according c1,c2,c3,c4
    pls suggest me what to do
    I use extract(xml, '/table) tab but it just read first one line & return error for other

    Can you plz explain to me thisIt is because you did not provide us with a valid xml structure so I used 11g's xmlparse function to create a xmltype even with the xml not being valid (no root tag).
    With a valid xml structure I could use the xmltype constructor instead and go on the same way as before:
    SQL> select *
      from xmltable (
             'table'
             passing xmltype ('
                            <root>
                            <table><c1>0</c1><c2>Mr</c2><c3>abc</c3><c4>Sharma</c4></table>
                            <table><c1>0</c1><c2>Mrs</c2><c3>abcd</c3><c4>Sharma</c4></table>
                            <table><c1>0</c1><c2>Mr</c2><c3>sabc</c3><c4>Sharma</c4></table>
                            <table><c1>0</c1><c2>Mrs</c2><c3>sdabc</c3><c4>Sharma</c4></table>
                            <table><c1>0</c1><c2>Mr</c2><c3>dabc</c3><c4>Sharma</c4></table>
                            <table><c1>0</c1><c2>Mr</c2><c3>adbc</c3><c4>Sharma</c4></table>
                            </root>').extract ('root/table')
             columns c1 number path 'c1', c2 varchar2 (4) path 'c2', c3 varchar2 (6) path 'c3', c4 varchar2 (6) path 'c4')
            C1 C2     C3        C4      
             0 Mr     abc       Sharma  
             0 Mrs    abcd      Sharma  
             0 Mr     sabc      Sharma  
             0 Mrs    sdabc     Sharma  
             0 Mr     dabc      Sharma  
             0 Mr     adbc      Sharma  
    6 rows selected.

  • How to extract data using xml datatype

    Hi,
    I tried the following example using xml data type , but not getting the required output.
    could you please correct the query so as to get the required one
    CREATE TABLE TEST.EMP_DETAIL
      EMPNO       NUMBER,
      ENAME       VARCHAR2(32 BYTE),
      EMPDETAILS  SYS.XMLTYPE
    Insert into EMP_DETAIL
       (EMPNO, ENAME, EMPDETAILS)
    Values
       (7, 'Martin', XMLTYPE('<Dept>
      <Emp Empid="1">
        <EmpName>Kevin</EmpName>
        <Empno>50</Empno>
        <DOJ>20092008</DOJ>
        <Grade>E3</Grade>
        <Sal>3000</Sal>
      </Emp>
      <Emp Empid="2">
        <EmpName>Coster</EmpName>
        <Empno>60</Empno>
        <DOJ>01092008</DOJ>
        <Grade>E1</Grade>
        <Sal>1000</Sal>
      </Emp>
      <Emp Empid="3">
        <EmpName>Samuel</EmpName>
        <Empno>70</Empno>
        <DOJ>10052008</DOJ>
        <Grade>E2</Grade>
        <Sal>2530</Sal>
      </Emp>
      <Emp Empid="4">
        <EmpName>Dev</EmpName>
        <Empno>80</Empno>
        <DOJ>10032007</DOJ>
        <Grade>E2</Grade>
        <Sal>1200</Sal>
      </Emp>
    </Dept>
    '));I need to get the record for Empid="2"
    So tried the following query with no expected o/p
    SELECT a.empno,a.ename,a.empdetails.extract('//Dept/Emp/EmpName/text()').getStringVal() AS "EmpNAME",
         a.empdetails.extract('//Dept/Emp/Empno/text()').getStringVal() AS "EMPNumber",
          a.empdetails.extract('//Dept/Emp/DOJ/text()').getStringVal() AS "DOJ",
          a.empdetails.extract('//Dept/Emp/Grade/text()').getStringVal() AS "Grade",
          a.empdetails.extract('//Dept/Emp/Sal/text()').getStringVal() AS "Salary",
          a.empdetails.extract('//Dept/Emp[@Empid="2"]').getStringVal() AS "ID",
          a.empdetails.extract('//Dept/Emp[EmpName="Coster"]').getStringVal() AS "CHK"
         FROM emp_detail a
         where empno=7 
               AND a.empdetails.existsNode('//Dept/Emp[@Empid="2"]') =1thanks..

    I am not very good at this... But Shouldn't your XML be more like this
    SQL> Insert into EMP_DETAIL
      2     (EMPNO, ENAME, EMPDETAILS)
      3   Values
      4     (7, 'Martin', XMLTYPE('<Dept>
      5    <Emp>
      6      <Empid>1</Empid>
      7      <EmpName>Kevin</EmpName>
      8      <Empno>50</Empno>
      9      <DOJ>20092008</DOJ>
    10      <Grade>E3</Grade>
    11      <Sal>3000</Sal>
    12    </Emp>
    13    <Emp>
    14      <Empid>2</Empid>
    15      <EmpName>Coster</EmpName>
    16      <Empno>60</Empno>
    17      <DOJ>01092008</DOJ>
    18      <Grade>E1</Grade>
    19      <Sal>1000</Sal>
    20    </Emp>
    21    <Emp>
    22      <Empid>3</Empid>
    23      <EmpName>Samuel</EmpName>
    24      <Empno>70</Empno>
    25      <DOJ>10052008</DOJ>
    26      <Grade>E2</Grade>
    27      <Sal>2530</Sal>
    28    </Emp>
    29    <Emp>
    30      <Empid>4</Empid>
    31      <EmpName>Dev</EmpName>
    32      <Empno>80</Empno>
    33      <DOJ>10032007</DOJ>
    34      <Grade>E2</Grade>
    35      <Sal>1200</Sal>
    36    </Emp>
    37  </Dept>
    38  '));
    1 row created.so that you can
    SQL> SET LINESIZE 250
    SQL> COLUMN EMPNAME FORMAT A20
    SQL> COLUMN EMPNUMBER FORMAT A2
    SQL> COLUMN DOJ FORMAT A10
    SQL> COLUMN GRADE FORMAT A10
    SQL> COLUMN SALARY FORMAT A10
    SQL> SELECT a.empno,a.ename,a.empdetails.extract('//Dept/Emp[Empid="2"]/EmpName/text()').getStringVal() AS "EmpNAME",
      2        a.empdetails.extract('//Dept/Emp[Empid="2"]/Empno/text()').getStringVal() AS "EMPNumber",
      3        a.empdetails.extract('//Dept/Emp[Empid="2"]/DOJ/text()').getStringVal() AS "DOJ",
      4        a.empdetails.extract('//Dept/Emp[Empid="2"]/Grade/text()').getStringVal() AS "Grade",
      5        a.empdetails.extract('//Dept/Emp[Empid="2"]/Sal/text()').getStringVal() AS "Salary"
      6   FROM emp_detail a
      7  /
         EMPNO ENAME                            EmpNAME              EM DOJ        Grade      Salary
             7 Martin                           Coster               60 01092008   E1         1000Edited by: Karthick_Arp on Apr 30, 2009 2:21 AM

  • Web service Response data - how to extract fields from XMl returned

    Hi,
        I am using a web service in adobe forms to get currency , by entering country name. I generated the fields i form by clicking on 'Generate fields ' it automatically generated the biding.
    The problem is that in response field , i get the whole XML , wheras i just need the currecny value.
    Below is the o/p.
    <NewDataSet>
      <Table>
        <Name>India</Name>
        <CountryCode>in</CountryCode>
        <Currency>Rupee</Currency>
        <CurrencyCode>INR</CurrencyCode>
      </Table>
      <Table>
        <Name>India</Name>
        <CountryCode>in</CountryCode>
        <Currency>Rupee</Currency>
        <CurrencyCode>INR</CurrencyCode>
      </Table>
    </NewDataSet>
    I just want INR to be shown in the text field?
    Plz help..

    You might have to tweak this code some to get it to work, but it should at least lay the groundwork for solving your problem:
    Code Snippet
    /* Declare an XmlNode object and initialize it with the XML response from the GetListItems method. The last parameter specifies the GUID of the Web site containing the list. Setting it to null causes the Web site specified by the Url property to be used.*/
                System.Xml.XmlNode nodeListItems =
                    MyListsService.GetListItems
                    (listName, viewName, query, viewFields, rowLimit, queryOptions, null);
    System.Xml.XmlDocument xd = new System.Xml.XmlDocument();
    xd.LoadXml(nodeListItems.OuterXml);
    System.Xml.XmlNamespaceManager nm = new System.Xml.XmlNamespaceManager(xd.NameTable);
    nm.AddNamespace("rs", "urn:schemas-microsoft-com:rowset");
    nm.AddNamespace("z", "#RowsetSchema");
    nm.AddNamespace("rootNS", "http://schemas.microsoft.com/sharepoint/soap");
    System.Xml.XmlNodeList nl = xd.SelectNodes("/rootNS:listitems/rs:data/z:row", nm);
    foreach(System.Xml.XmlNode listItem in nl)
      listBoxProsjekter.Items.Add(listItem.OuterXml);
    I hope this helps!
    Please look into the following site for more info:
    http://msdn2.microsoft.com/en-us/library/4bektfx9(vs.80).aspx

  • How to passing cf variable xml content to SpryXMLDataSet

    I have an cf object which calls a method which returns an XML string. Now like to access the XML-data by a SpryXMLDataSet. Is this possible?

    Another solution was found (CF9):
    <cfset myCFObject = createObject("component","MyCFC").init("attribute01","attribute02")>
    <cfset CFVariableMyXMLDataString = #myCFObject.CFCFunctionGetDataAsXML()#>
    <script type="text/javascript">
    var myDataSet = new Spry.Data.XMLDataSet(null, "root/children");
    var xmlDocument = Spry.Utils.stringToXMLDoc('<cfoutput>#variables.CFVariableMyXMLDataString#</cfoutput>');
    myDataSet.setDataFromDoc(xmlDocument);
    </script>

Maybe you are looking for

  • Before I ask stupid questions...

    Just taken over at a small post facility and need to read up on Xserve RAID related issues before I ask stupid questions on this forum. So can anyone refer me to any useful sites/blogs/apple articles about Xserve RAID setups geared towards video edit

  • Help - virus on the MAC?

    I recently upgraded to the MAC Lion OS. I've started receiving a message box when I leave my laptop idle. "Apple agent wants to make changes. Please enter password"  Of course, I do not enter the password. But then I will notice that if I open Safari

  • Form Builder. Error 306 wrong number or types of arguments in call to populate_table

    Hi ! I'm trying to build a simple form based on a procedure. the error that i get: error 306 - wrong number or types of arguments in call to populate_table When I use the Data block wizard, I specify the procedure with a ref cursor argument. the proc

  • Billing type F2 not defined error vf 007

    in Billing transaction this error happend Billing type F2 not defined error Vf 007 and the billing type f2 is deleted from the system and it's not assigned in the sales order type why the system determined billing type F2 for this sales order ??

  • Iphone 3Gs TV OUT- Audio OK, Scrambled Video

    While my first generation iphone's TV OUT works fine when connected to my TV, My 3GS TV OUT delivers Audio but only a scrambled Video image. Any thoughts?