2 Replies Latest reply: Oct 2, 2013 6:44 AM by odie_63 RSS

    Access data in XML

    TimWong765

      I have the following XML structure:

       

      <TZR Action="Insert" OrgaT="400">

      <Division id="4">

        <label language="de">ok</label>

        <label language="en">Live engl.</label>

      <Productstructure id="300" Sparte="5">

        <label language="en">Live engl.</label>

      </Productstructure>

      </Division>

      </TZR>

       

       

       

       

       

      I'd like to get

       

       

      4, ok, Live engl, 300, 1, Live engl.

       

       

       

      using XMLTYPE but I have no idea how to get id="4" or Sparte="1"

       

       

       

      SELECT *

      FROM XMLTable(

             '/TZR'

             passing XMLType(bfilename('XML_DATA_DIR', 'xxx.xml'), nls_charset_id('AL32UTF8'))

             columns Division_id       varchar2(30)       path 'Division/id'

           )

      ;

       

      Oracle 11.2.02 on Windows 2008.