Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How To Extract Data From XML

User_YQF7SMar 10 2020 — edited Mar 12 2020

Hi everyone.  I know that this has been asked before, but I am still having problems extracting data from the XML files in my database.  I have a camera calibration table called CMR_CLBRTN_CNFG, which has 2 rows, WRKSTN_NAME and CMR_CLBRTN_FILE, which is an XML file.  The table has around 150 rows, with each having it's own XML file.  I wanted to extract the camera calibration data (ID, Name, Tag, Data Type, Data Value and Is Current Value) from each XML file.  A sample XML file is :

<?xml version="1.0"?>

<Root>

  <CanonRebelT3i-stand>

    <PropList>

      <Timestamp>2019/01/03 17:51:54</Timestamp>

      <Property>

        <Id>1029</Id>

        <Name>Aperture</Name>

        <Tag>5.6</Tag>

        <DataType>16</DataType>

        <DataValue>48</DataValue>

        <IsCurrentValue>False</IsCurrentValue>

      </Property>

      <Property>

        <Id>1026</Id>

        <Name>ISO Speeds</Name>

        <Tag>100</Tag>

        <DataType>16</DataType>

        <DataValue>72</DataValue>

        <IsCurrentValue>False</IsCurrentValue>

      </Property>

      <Property>

        <Id>1030</Id>

        <Name>Shutter Speed</Name>

        <Tag>1/125</Tag>

        <DataType>16</DataType>

        <DataValue>112</DataValue>

        <IsCurrentValue>False</IsCurrentValue>

      </Property>

    </PropList>

  </CanonRebelT3i-stand>

  <CanonRebelT3i-sit>

    <PropList>

      <Timestamp>2019/01/03 17:51:54</Timestamp>

      <Property>

        <Id>1026</Id>

        <Name>ISO Speeds</Name>

        <Tag>100</Tag>

        <DataType>16</DataType>

        <DataValue>72</DataValue>

        <IsCurrentValue>False</IsCurrentValue>

      </Property>

      <Property>

        <Id>1030</Id>

        <Name>Shutter Speed</Name>

        <Tag>1/125</Tag>

        <DataType>16</DataType>

        <DataValue>112</DataValue>

        <IsCurrentValue>False</IsCurrentValue>

      </Property>

      <Property>

        <Id>1029</Id>

        <Name>Apreture</Name>

        <Tag>6.7</Tag>

        <DataType>16</DataType>

        <DataValue>52</DataValue>

        <IsCurrentValue>False</IsCurrentValue>

      </Property>

    </PropList>

  </CanonRebelT3i-sit>

</Root>

I was hoping that someone could help me extract the data.  We are using Oracle 11.2.0.4.  Thank you so much in advance.

This post has been answered by odie_63 on Mar 12 2020
Jump to Answer
Comments
Post Details
Added on Mar 10 2020
6 comments
1,593 views