How to loop through XML data in a table of XMLType?

Hi,
I am failry new to xml document processing in Oracle using PL/SQL.
My DB version: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
I have successfully loaded an xml document into a table using the following two statements:
1) CREATE TABLE mytable2 OF XMLType;
2) INSERT INTO mytable2 VALUES (XMLType(bfilename('IMAGE_FILE_LOC', 'IFTDISB20100330172157C002.xml'), nls_charset_id('AL32UTF8')));
Now I need to traverse through the various nodes within the xml document and extract values of elements of each node. The question I have is:
How do I loop through a node? A VALID record is enclosed within the <checkItem> </checkItem> tags.
Here is a snippet of the data in that xml document:
++++++++++++++++++++++++++++++++++++++++++++++++
<?xml version="1.0" encoding="UTF-8"?>
<bdiData>
<documentControlInfo>
<documentInfo>
<docDescription>Check images and data for Test Company, account number 1234567890</docDescription>
<docID>
<ID>20100330172157</ID>
</docID>
<docModifier>Test Company</docModifier>
<docCreateDate>2010-03-30</docCreateDate>
<docCreateTime>17:21:57-0700</docCreateTime>
<standardVersion>1.0</standardVersion>
<testIndicator>0</testIndicator>
<resendIndicator>0</resendIndicator>
</documentInfo>
<sourceInfo>
<sourceName>The Bank IFT</sourceName>
<sourceID>
<idOther>TheBankIFT</idOther>
</sourceID>
</sourceInfo>
<destinationInfo>
<destinationName>Test Company</destinationName>
<destinationID>
<idOther>FEI3592</idOther>
</destinationID>
</destinationInfo>
</documentControlInfo>
<checkItemCollection>
<collectionInfo>
<description>Items</description>
<ID>1269994919135</ID>
<Classification>
<classification>Items</classification>
</Classification>
</collectionInfo>
<checkItemBatch>
<checkItemBatchInfo>
<description>Paid Checks</description>
<ID>1269994919135</ID>
<Classification>
<classification>Paid Checks</classification>
</Classification>
</checkItemBatchInfo>
<checkItem>
<checkItemType>check</checkItemType>
<checkAmount>86468</checkAmount>
<postingInfo>
<date>2010-03-29</date>
<RT>10700543</RT>
<accountNumber>1234567890</accountNumber>
<seqNum>009906631032</seqNum>
<trancode>001051</trancode>
<amount>86468</amount>
<serialNumber>300040647</serialNumber>
</postingInfo>
<totalImageViewsDelivered>2</totalImageViewsDelivered>
<imageView>
<imageIndicator>Actual Item Image Present</imageIndicator>
<imageViewInfo>
<Format>
<Baseline>TIF</Baseline>
</Format>
<Compression>
<Baseline>CCITT</Baseline>
</Compression>
<ViewSide>Front</ViewSide>
<imageViewLocator>
<imageRefKey>201003260000738400851844567205_Front.TIF</imageRefKey>
<imageFileLocator>IFTDISB20100330172157M002.zip</imageFileLocator>
</imageViewLocator>
</imageViewInfo>
<imageViewInfo>
<Format>
<Baseline>TIF</Baseline>
</Format>
<Compression>
<Baseline>CCITT</Baseline>
</Compression>
<ViewSide>Rear</ViewSide>
<imageViewLocator>
<imageRefKey>201003260000738400851844567205_Rear.TIF</imageRefKey>
<imageFileLocator>IFTDISB20100330172157M002.zip</imageFileLocator>
</imageViewLocator>
</imageViewInfo>
</imageView>
</checkItem>
<checkItem>
<checkItemType>check</checkItemType>
<checkAmount>045</checkAmount>
<postingInfo>
<date>2010-03-29</date>
<RT>10700543</RT>
<accountNumber>1234567890</accountNumber>
<seqNum>008518967429</seqNum>
<trancode>001051</trancode>
<amount>045</amount>
<serialNumber>200244935</serialNumber>
</postingInfo>
<totalImageViewsDelivered>2</totalImageViewsDelivered>
<imageView>
<imageIndicator>Actual Item Image Present</imageIndicator>
<imageViewInfo>
<Format>
<Baseline>TIF</Baseline>
</Format>
<Compression>
<Baseline>CCITT</Baseline>
</Compression>
<ViewSide>Front</ViewSide>
<imageViewLocator>
<imageRefKey>201003290000713900851896742901_Front.TIF</imageRefKey>
<imageFileLocator>IFTDISB20100330172157M002.zip</imageFileLocator>
</imageViewLocator>
</imageViewInfo>
<imageViewInfo>
<Format>
<Baseline>TIF</Baseline>
</Format>
<Compression>
<Baseline>CCITT</Baseline>
</Compression>
<ViewSide>Rear</ViewSide>
<imageViewLocator>
<imageRefKey>201003290000713900851896742901_Rear.TIF</imageRefKey>
<imageFileLocator>IFTDISB20100330172157M002.zip</imageFileLocator>
</imageViewLocator>
</imageViewInfo>
</imageView>
</checkItem>
<checkItemBatchSummary>
<totalItemCount>1028</totalItemCount>
<totalBatchAmount>61370501</totalBatchAmount>
<totalBatchImageViewsDelivered>2056</totalBatchImageViewsDelivered>
</checkItemBatchSummary>
</checkItemBatch>
<collectionSummary>
<totalBatchCount>1</totalBatchCount>
<totalItemCount>1028</totalItemCount>
<totalCollectionAmount>61370501</totalCollectionAmount>
<totalCollectionImageViewsDelivered>2056</totalCollectionImageViewsDelivered>
</collectionSummary>
</checkItemCollection>
<documentSummaryInfo>
<totalCollectionCount>1</totalCollectionCount>
<totalBatchCount>1</totalBatchCount>
<totalItemCount>1028</totalItemCount>
<totalDocumentAmount>61370501</totalDocumentAmount>
<totalDocumentImageViewsDelivered>2056</totalDocumentImageViewsDelivered>
</documentSummaryInfo>
</bdiData>
++++++++++++++++++++++++++++++++++++++++++++++++
Any ideas and or suggestions will be greatly appreciated.
Cheers!
Edited by: user12021655 on Aug 3, 2010 1:25 PM

I really need to update my blog to get the example you are looking for posted. I did a quick search on the forums for XMLTable and found a good example at {message:id=4325701}. You will want to use OBJECT_VALUE in the PASSING clause where you need to reference the column in your table.
Note: See the FAQ in the upper right for how to use the tag to wrap objects to retain formatting.  Also your XML is missing closing nodes.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Similar Messages

  • How to loop through a Data Node

    Hello,
    I have an Interactive Adobe form in WebDynpro Java project. 
    My data View tab includes the following structure:
    Bapi_test
    ValueHelpData
    CodeNumber
    CodeDescription
    Can someone please tell how I can loop through the “ValueHelpData” node, and get values for “CodeNumber” and “CodeDescription”
    The ValueHelpData node has the cardinality of  0..n. and has approximately 100 elements.
    Thanks. Your help is much appreciated.
    Rob.

    Hi Robby,
    You could try the following :
    int n = wdContext.nodeValueHelpData().size();
    for(int i = 0; i < n; i++)
       wdContext.nodeValueHelpData().moveTo(i);
       IPrivateMyDataView.IValueHelpDataElement ele = wdContext.currentValueHelpDataElement();
       String codenum = ele.getCodeNumber();
       String codedesc = ele.getCodeDescription();
       // Any other processing logic..//
    Hope this helps.

  • How to loop through xml records from file without ROW , /ROW tags?

    I am using dbms_XMLSave.insertXML procedure to insert xml formated record from file. MY xmlformated records does not have open and close ROW tags. I have multiple records in the file.How can I loop through without <ROW>,</ROW> tags?

    I am using dbms_XMLSave.insertXML procedure to insert xml formated record from file. MY xmlformated records does not have open and close ROW tags. I have multiple records in the file.How can I loop through without <ROW>,</ROW> tags?

  • How to loop through xml records and repeatedly display

    I have 1 table in my rtf and the table typically reflects 1 row (grouping) from my xml data, however there are some instances where i need to take 1 row from my xml data and display the table multiple times.
    i.e.
    xmldata:
    item TOTAL_QTY CONTAINER_QTY
    x 500 250
    I need to take that row and display the table in my rtf two times. I tried to encapsulate my table in a <?for-each:xdoxslt:foreach_number($_XDOCTX,0,TOTAL_QTY,CONTAINER_QTY)?> loop looping/re-displaying the table until a reach TOTAL_QTY, but once I'm in this loop it's like i dont have access to the actual xml data fields. How can I achieve this effect?

    1. Please tell us your first name and put it in your handle and/or profile to help us.
    2. Explain your question in more detail, perhaps with an example and by showing code you already are using.
    Scott

  • How to insert large xml data into database tables.

    Hi all,
    iam new to xml. i want to insert data in xml file to my database tables.but the xml file size is very large. performance is also one of the issue. can anybody please tell me the procedure to take xml file from the server and insert into my database tables.
    Thanks in advance

    Unfortunately posting very generic questions like this in the forum tends not to be very productive for you, me or the other people who read the forum. It really helps everyone if you take a little time to review existing posts and their answers before starting new threads which replicate subjects that have already been discussed extensively in previous threads. This allows you to ask more sensible questions (eg, I'm using this approach and encountering this problem) rather than extremely generic questions that you can answer yourself by spending a little time reviewing existings posts or using the forum's search feature.
    Also in future your might want to try being a little more specific before posting questions
    Eg Define "very large". I know of customers who thing very large is 100K, and customers who think 4G is medium. I cannot tell from your post what size your files are.
    What is the content of the file. Is it going to be loaded into a single record, or a a single table, or will it need to be loaded into multiple records in a single table or multiple records in multiple tables ?
    Do you really need to load the data into exsiting relational tables or could your application work with relational views of the XML Content.
    Finally which release of the database are you working with.
    Define performance. Is it reasonable to expect to process this kind of document on this machine (Make, memory, #number of CPUs, CPU Speed, number of discs) in this period of time.
    WRT to your original question. If you take a few minutes to search this forum you will find a very large number of threads with very similar titles to yours. These theads document a number of different approaches that can be used to solve this problem.
    I suggest you start by looking for threads that cover topics like DBMS_XMLSTORE, XMLTable(), Relational Views of XML content, loading XML content in relational tables.

  • How to loop through a single row of data?

    What I'm trying to do is use a cursor to loop through a clob. When I create my cursor I get the an error telling me that the table does not exist. Which implies that I have an implicit cursor. Is there a way to get around this?

    > How to loop through a single row of data?
    By not looping as there is only a single row?
    > What I'm trying to do is use a cursor to loop through a clob
    Processing (looping through) a CLOB has nothing to do with a cursor.
    > When I create my cursor I get the an error telling me that the table does
    not exist. Which implies that I have an implicit cursor.
    Incorrect. It simply means that
    a) you do not have permissions to access that table from within the current context
    b) it does not exist (e.g. you have misspelled the object name, you have not qualified it properly within the current scope, etc)

  • Looping through XML Items

    Hi,
    I am selecting data from tables in forms of xml like below
    xml_data VARCHAR2(32000) :=
    SELECT XMLELEMENT("form",
    xmlagg(xmlelement("item",
    XMLFOREST(form_seq_no "form_seq_no",
    patientid "patientid",
    facilityid "facilityid"
    from (SELECT
    e.form_seq_no,
    e.patientid,
    e.facilityid
    FROM hosp e
    I am using a cursor like below to get the data
    OPEN l_rc FOR xml_data;
    LOOP
    if l_rc%notfound then
    EXIT ;
    end if;
    FETCH l_rc
    INTO l_xml;
    update hosp set transmit_date = sysdate;
    end loop;
    CLOSE l_rc;
    The above query returns all items in the table....I am trying to limit the number of records returned based on limit I pass...If the user enters 2, only two items from the node has to be returned. I am not having a clue on how to do this. It would be great if any one can help me...

    Thank you both for the replies. I am able to get the data based on the limit I pass...I have another question.
    Once the xml doc result is returned or once the select operation is performed and cursor data is fetched into a xmltype variable, I am updating a table's data with the current date...But I have to update the table based on the form_seq_no in the result xml doc...If the result set has three records, then it would have three different form_seq_no. Right now I am doing like below
    SELECT XMLELEMENT("form",
    xmlagg(xmlelement("item",
    XMLFOREST(form_seq_no "form_seq_no",
    patientid AS "patientid",
    facilityid AS "facilityid" ))))
    INTO l_xml
    from (SELECT
    e.form_seq_no,
    e.patientid,
    e.facilityid
    FROM hosp e
    ORDER BY e.form_seq_no
    WHERE ROWNUM < p_num_of_rows;
    I am using a cursor like below to get the data
    OPEN l_rc FOR xml_data;
    LOOP
    if l_rc%notfound then
    EXIT ;
    end if;
    FETCH l_rc
    INTO l_xml;
    This is the update I am doing, based on the result set I pasted below....But I get an error that extractValue can return only one child...I am at loss to know how to loop through the result set and perform the update...
    update hosp set transmit_date = sysdate where form_seq_no = extractValues(l_xml, 'form/item/form_seq_no);
    end loop;
    CLOSE l_rc;
    If I give rownum <3 , I get 3 rows, the result set might look like as follows:
    <form>
    <item>
    <form_seq_no>1</form_inst_seq_no>
    <patientid>21</patientid>
    <facilityid>23</facilityid>
    </item>
    <item>
    <form_seq_no>2</form_inst_seq_no>
    <patientid>212</patientid>
    <facilityid>233</facilityid>
    </item>
    <item>
    <form_seq_no>3</form_inst_seq_no>
    <patientid>213</patientid>
    <facilityid>234</facilityid>
    </item>
    I am new to this xml and xml manipulation in oracle...What are the concepts I would have to know in order to achieve my task above? And Right now I have this book called "Oracle Database 11g The Complete Reference" by Kevin Loney, but I neither find any elaborate explanations nor examples. What other books would anyone suggest to learn more on oracle and pl/sql.
    Thanks a lot in advance.

  • How to loop through Multiple Excel sheets and load them into a SQL Table?

    Hi ,
    I am having 1 excel sheet with 3 worksheet.
    I have configured using For each loop container and ADO.net rowset enumerator.
    Every thing is fine, but after running my package I am getting below error
    [Excel Source [1]] Error: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER.  The AcquireConnection method call to the connection manager "Excel Connection Manager" failed with error code 0xC0202009.  There may
    be error messages posted before this with more information on why the AcquireConnection method call failed.
    Warning: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED.  The Execution method succeeded, but the number of errors raised (5) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified
    in MaximumErrorCount. Change the MaximumErrorCount or fix the errors.
    [Connection manager "Excel Connection Manager"] Error: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005.
    An OLE DB record is available.  Source: "Microsoft Access Database Engine"  Hresult: 0x80004005  Description: "The Microsoft Access database engine cannot open or write to the file ''. It is already opened exclusively by
    another user, or you need permission to view and write its data.".
    Pleas suggest me the correct way of solving above issues.
    Thanks in advance :)
    regards,
    Vipin jha
    Thankx & regards, Vipin jha MCP

    Hi ,
    Please refer the below link for Looping multiple worksheet in a single SQL Table.
    http://www.singhvikash.in/2012/11/ssis-how-to-loop-through-multiple-excel.html
    Note:-If you using excel 2010 then you have to use EXCEL 12.0 .
    Above link explaining  step by step of Looping multiple worksheet in a single SQL Table.
    regards,
    Vipin jha
    Thankx & regards, Vipin jha MCP

  • How to loop through a collection of records which is return value of func.

    Hi all.
    Have this situation:
    - Stored function (member of pkg procedure) that returns a collection of records.
    Package Spec:
    =========
    type tipo_pvt is table of s08_plan_venta_totalizado_r % rowtype;
    rc_pvt tipo_pvt;
    (s08_plan_venta_totalizado_r is a view).
    Package Body:
    =========
    select col1
    ,col2
    ,etc
    bulk collect into rc_pvt
    from s08_lista_precio_producto_r lpp
    ,s03_producto_r prd
    where condition;
    return rc_pvt;
    Once collection is loaded and returned (i know it loads records). I just want to loop through every record on a pl/sql procedure on the client (forms6i procedure), but it gives me the error: ORA-06531 Reference to uninitialized collection:
    On the forms6i client procedure i have something like:
    procedure p_carga_plan_venta_inv (p_id_plan_venta in number) is
    v_contador integer;
    v_mensaje varchar2(10);
    rc_pvt sk08_gestiona_plan_venta.tipo_pvt; (sk08_gestiona_plan_venta is package name)
    begin
         rc_pvt := sk08_gestiona_plan_venta.tipo_pvt();
         rc_pvt := sk08_gestiona_plan_venta.f_genera_plan_venta_inv (:pvv.lip_id_lista_precio
    ,:pvv.ems_id_sucursal
                                            ,:control4.v_metodo_calculo
    ,:pvv.unm_co_unidad_monetaria
    ,:pvp.fe_fin_periodo) ;
    -- previous statement dos not fail BUT THIS:
    message('rc_pvt.count= '||rc_pvt.count);pause;
    DOES FAIL
    end;
    So my question is : since i have already returned the collection, how come is not initialized....?
    Do i have to extend it first? In this case i have to return the number of records in the collection.....
    Look what happen when done from sqlplus:
    declare
    rc_pvt sk08_gestiona_plan_venta.tipo_pvt;
    begin
    rc_pvt := sk08_gestiona_plan_venta.tipo_pvt();
    rc_pvt :=
    sk08_gestiona_plan_venta.f_genera_plan_venta_inv (8713171
    ,null
    ,'m'
    ,'BS.F'
    ,to_date('28/02/2001','dd/mm/yyyy'));
    end;
    SQL> /
    Registros en la coleccion =6
    Procedimiento PL/SQL finalizado con éxito.
    SQL>
    I put a dbms_output.put_line on stored function .....
    Please help ....!
    Apparently it fails when calling the stored function:
    rc_pvt := sk08_gestiona_plan_venta.f_genera_plan_venta_inv (:pvv.lip_id_lista_precio
    ,:pvv.ems_id_sucursal
    ,:control4.v_metodo_calculo
    ,:pvv.unm_co_unidad_monetaria
    ,:pvp.fe_fin_periodo) ;
    I don't undestand since this function return the appropiate type. It seems the collection is empty, although having test that on sqlplus works ...
    rc_pvt := sk08_gestiona_plan_venta.f_genera_plan_venta_inv (:pvv.lip_id_lista_precio
    ,:pvv.ems_id_sucursal
    ,:control4.v_metodo_calculo
    ,:pvv.unm_co_unidad_monetaria
    ,:pvp.fe_fin_periodo) ;
    function f_genera_plan_venta_inv (p_id_lista_precio in number
    ,p_id_sucursal in number
    ,p_tipo_nivel_inv in varchar2
    ,p_co_unidad_monetaria in varchar2
    ,p_fe_fin_periodo in date) return tipo_pvt;
    for some reason it works on plus:
    SQL> declare
    2 rc_pvt sk08_gestiona_plan_venta.tipo_pvt;
    3 begin
    4 rc_pvt := sk08_gestiona_plan_venta.tipo_pvt();
    5 rc_pvt :=
    6 sk08_gestiona_plan_venta.f_genera_plan_venta_inv (8713171
    7 ,null
    8 ,'m'
    9 ,'BS.F'
    10 ,to_date('28/02/2001','dd/mm/yyyy'));
    11 --
    12 dbms_output.put_line('Registros en la coleccion = '||rc_pvt.count);
    13 for i in 1 .. rc_pvt.count loop
    14 --
    15 dbms_output.put_line('En '||i||rc_pvt(i).prd_co_producto);
    16 end loop;
    17 end;
    18 /
    Registros en la coleccion =6
    Registros en la coleccion = 6
    En 1PT.REF.PET.KO05
    En 2PT.REF.PET.LM15
    En 3PT.ALM.VDR.001
    En 4PT.REF.GRN.CN
    En 5PT.REF.GRN.KO
    En 6PT.REF.GRN.LM
    Procedimiento PL/SQL finalizado con éxito.
    Don't understand why it works on plus8 (same version that comes with 6i).
    Can't loop through records on forms...? WHY ...?
    Edited by: myluism on 02-abr-2012 14:40

    Forms 6i is an antique ... write your code to run on the server.
    Multiple examples of how to loop through an array loaded with bulk collect can be found here.
    http://www.morganslibrary.org/reference/array_processing.html
    The main library page is:
    http://www.morganslibrary.org/library.html

  • How To Loop Through GregorianCalendar ?

    I wonder if anyone knows how to loop through GregorianCalendar , such as :
    GregorianCalendar Start_Date,End_Date;
    Start_Date=new GregorianCalendar(2000,Calendar.DECEMBER,25);
    End_Date=new GregorianCalendar(2006,Calendar.DECEMBER,25);
    for ( GregorianCalendar Day_Index=Start_Date ; Day_Index<End_Date ; Day_Index++ )
    Thanks
    Frank

    for ( GregorianCalendar Day_Index=Start_Date ;
    Day_Index<End_Date ; Day_Index++ )
    Day_Index.add(Calendar.DATE, 1);

  • How to loop through columns of a table?

    Hi, guys
    Is there a way to loop through each column of a table? If there is a way, then how?
    I have a table with columns of different datatypes , and I want to set default values for each column with a loop but don't know how to make it happen.
    For example,
    Table: Employees
    declare
      rec  Employees%ROWTYPE;
    begin
      for col in rec.empno .. rec.location loop
         if col = rec.empno then -- set default value for column empno;
      end loop;
    end;
    /Sorry, I am a newbie to PL/SQL. Please help!
    Thanks in advance.
    Edited by: HappyJay on 2010/05/11 10:36

    Hi,
    You can query the data dictionary views all_tab_columns (or user_tab_columns) to get the names of all the columns in a particular table.
    Here's an easy way (but not a very efficient way) to loop through them:
    SET     SERVEROUTPUT     ON
    BEGIN
         FOR  c IN ( SELECT  column_name
                         FROM    all_tab_columns
                  WHERE   owner     = 'SCOTT'     -- Remember ot use UPPER CASE inside quotes
                  AND         table_name     = 'EMP'
         LOOP
              dbms_output.put_line (c.column_name || ' = column_name inside loop');
         END LOOP;
    END;
    /I'm confused about what you want to do, though.
    Do you want the PL/SQL code to write and/or execute an ALTER TABLE command for each column?

  • Loop through XML

    I am looking for an example of how to loop through an xml structure, preferrably in VBScript, but I will take a Javascript example and try to figure out how to adapt it.
    Is a FOR EACH loop possible? In normal VBScript you can do something like this...
    ‘strQuery = “/ProfilesInfo/Profiles/ProfileInfo/Profile/Fields/Field [Name='ProfileUri' or Name= 'Age'] /(Name|Value)”
    Set colNodes = xmlDoc.selectNodes( strQuery )
    If colNodes.length>0 Then
    For Each objNode in colNodes
    Print objNode.nodeName & “: ” & objNode.text
    Next
    is it possible to do something like this with XML? Maybe something like
    For each node in myDocument.XMLElements.Item(1)
         {do something}
    Next
    If there is a better way, and I am sure there is, I'll take an example of that instead. 
    I am sure there is probably a way to do it with XPath, but I haven't been able to find any examples of using XPath with VBScript. 
    If anyone has an example of how to use XPath with VBScript I would greatly appreciate it.
    Thank you

    Kasyan, thank you for the reply.  I looked at that part in the book and I have tried using the example code, but I am having difficulty in understanding how it is being used, maybe you, or someone can help to explain it. 
    So in an example like this:
    Class ProcessChildrenRule
         Public Property Get name
              name = "ProcessChildrenRule"
         End Property
         Public Property Get xpath
              xpath = "//XMLElement"
         End Property
         Public Function apply(myXMLElement, myRuleProcessor)
              glueCode_processChildren(myRuleProcessor)
              With myXMLElement
                   myXMLElement.XMLattributes.Item(1).Value
                   myStory.InsertionPoints.Item(-1).Contents =
                   .XMLAttributes.Item(1).Value & vbCr
              End With
         apply = false
         End Function
    End Class
    There are 5 things that I am not understanding. 
    1.  How is "xpath" being used?  I don't see another occurance of it other than when the variable xpath is set.
    2.  How is name being used?  I don't see another occurance of it other than when the variable name is set.
    3.  Why is "Public Function apply" created in each class?  In the examples in the book, that function exists in each Class.  Why not just create the function outside of the class and call it from inside the class?
    4. Where is the "apply" function being called from? It doesn't get called from inside or outside the class on the example pages anywhere?
    5. Where are the values of myXMLElement and myRuleProcessor being set before they are used in the function?
    Even in the examples you gave, once I set the xpath value, what do I do with it after that?  How do I write out the value of what I am searching for with the xpath?
    So going back to my original question, if I set xpath = "/devices/device", how do I loop through each "device" node and write them out?  That is where it is breaking down for me.  I haven't seen any examples in the book or in the downloaded example code that show how to do that. 

  • Looping through XML tree

    Hi All,
    I need help in retrieving the values of nodes in a XML tree
    If I have a xml document like
    <form>
    <item>
    <form_seq_no>1</form_inst_seq_no>
    <patientid>21</patientid>
    <facilityid>23</facilityid>
    </item>
    <item>
    <form_seq_no>2</form_inst_seq_no>
    <patientid>212</patientid>
    <facilityid>233</facilityid>
    </item>
    <item>
    <form_seq_no>3</form_inst_seq_no>
    <patientid>213</patientid>
    <facilityid>234</facilityid>
    </item>
    How can I get the values of form_Seq_no node?
    I want to loop for all the nodes so that I can update a table for every form_seq_no....
    Thanks....

    Why did you open a new thread where the problem seems to be exactly the same as the one from your Re: Looping through XML Items?
    In particular what is wrong with the solution given Re: Looping through XML Items?

  • How to load the XML data of SAP to  a target database

    i use an IDocs to read from SAP and converted into XML (ie .XSD ) and now i want to move that XML data to target data base.
    i am trying to move XML data to template table, but i am getting this mapping error , even though i used NRDM and mapping while moving to template table.
    ERROR MESSAGE :
    Invalid mapping expression for column <Query_1.SNDPRN>. Additional information: <Cannot parse expression.
    Table <Query.EDI_DC40> for column <SNDPRN> does not occur in the FROM clause. For a top-level query, all columns must belong to some table in the FROM clause.. (BODI-1112351)>. (BODI-1111081)

    Hi Srikanth,
    Please find my understanding below.Correct me if my understanding is wrong.
    1)You have moved the data from IDOC to XML file (i.e Creating an XSD and using it as target).
    2)Now this XML file, will you your source and you are going to load it into the target table.
    The error looks like BODS is unable to parse the Hierarchy structure to the flat structure.
    How are you  un-nesting  your data (Are you using XML pipeline) .
    Thanks
    Arun.

  • How to parse thus XML data?

    Hi,experts:
    In below thread:
    Receiving .Net dataset with deployed proxies
    i asked how to create a external definition in IR base on above XML data.
    Now,i have created a XSD file base on the XML data.And importing it into IR successfully.
    <?xml version="1.0" encoding="utf-8"?>
    <xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
    <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:Locale="zh-CN">
    <xs:complexType>
    <xs:choice maxOccurs="unbounded">
    <xs:element name="Status">
    <xs:complexType>
    <xs:attribute name="Result" type="xs:string"/>
    </xs:complexType>
    </xs:element>
    </xs:choice>
    </xs:complexType>
    </xs:element>
    </xs:schema>
    And now,the question is how to parse the XML data in diffgr:diffgram  segment.It seems a MS-XML syntax.Can it be parsed by XI?
    I tried,but the following error occurs:
    com.sap.aii.utilxi.misc.api.BaseRuntimeException: RuntimeException in Message-Mapping transformation: Cannot produce target element /ns0:ZMT_SD_ORDER01_RESULT. Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd at com.sap.aii.mappingtool.tf3.AMappingProgram.start

    Hi,
    The above Exception seems to be because of mapping error.
    Check your mapping for all the mandatory 1-1 mapping, also the 1-unbounded parent node mapping.
    Once when you import the XSD and activate your External Definition if it does without any error then there is no problem with your External Definition.
    If this error occurs only when you test your mapping then this is mapping error and not because of XSD.
    Please check the parent node mapping like 1-unbounded.
    Reward Points if useful
    Regards
    Ashmi.

Maybe you are looking for

  • Update from Snow Leopard 10.6.8 to Yosimite problem

    I am trying to update my Mac OS X 10.6.8 to Yosimite.  When I get to the screen to download, it asks for my apple id and password, which I enter.  Afterwards the screen doesn't go any further.  I can see the wheel turning, indicating it is working, b

  • Xfdesktop copies files into Thunar instead of moving them with mouse

    Running Xfce4 with Thunar as the default file manager. If I drag a file with the mouse out of a folder in Thunar, onto my desktop, it moves from the folder to the desktop (normal behaviour). But if I drag a file from the desktop into a folder (either

  • MyColorPicker now out !

    Hello all ! My color picker extension has just been approved ! You will find it at https://creative.adobe.com/addons/products/3200 Hope you'll like it. MyColorPicker is a free color picker that is simple, very compact, yet has some unique features. I

  • [svn:osmf:] 15698: Extending unit tests.

    Revision: 15698 Revision: 15698 Author:   [email protected] Date:     2010-04-26 08:09:39 -0700 (Mon, 26 Apr 2010) Log Message: Extending unit tests. Modified Paths:     osmf/trunk/framework/OSMFTest/org/osmf/elements/TestParallelElementWithDisplayOb

  • Where's the iPhone4s in THAILAND had essembled?

    As a result of ip4s in Thailand has released in 20,900 THB. I want to know where's the whole had been produced or imported from? Furthermore, does the price is included VAT or not? Thank You.