我有一个XML输出包含复杂的响应,我想从这个响应中提取值,知道它包含重复的行
<?xml version="1.0" encoding="UTF-8"?>
<export>
<header generated="2017-03-14T07:23:50.8" name="usgByConOpCo" title="Contracting OpCo Overview" >
<parameter name="PERIOD_START">2017-01-01</parameter>
<parameter name="PERIOD_END">2017-01-31</parameter>
<parameter name="USER_NAME">zainmdw</parameter>
<parameter name="VF_OPCO_ID">1233</parameter>
<parameter name="VF_OPCO_CODE">ZAISA</parameter>
<parameter name="TIMESTAMP">2017-03-14 07:23:50.83</parameter>
</header>
<section name="Data Usage Total" rowCount="-1">
<dataRow rowNum="1">
<dataField column="TOTAL_BYTES">18008179</dataField>
<dataField column="TOTAL_PS_SESSIONS_COUNT">13129</dataField>
<dataField column="NUM_SMS_MT_WAKEUP">0</dataField>
<dataField column="NUM_SMS_MT">17</dataField>
<dataField column="NUM_SMS_MT_TRANS">0</dataField>
<dataField column="NUM_SMS_MT_TRANS_RESPONSE">0</dataField>
<dataField column="NUM_SMS_MO">81</dataField>
<dataField column="TOTAL_CS_DURATION">0</dataField>
<dataField column="TOTAL_CS_SESSIONS_COUNT">0</dataField>
</dataRow>
</section>
<section name="Data Usage By Serving Opco" rowCount="-1">
<dataRow rowNum="1">
<dataField column="SERVING_OPCO">ZAISA</dataField>
<dataField column="TOTAL_BYTES">18008179</dataField>
<dataField column="TOTAL_PS_SESSIONS_COUNT">13129</dataField>
<dataField column="NUM_SMS_MT_WAKEUP">0</dataField>
<dataField column="NUM_SMS_MT">17</dataField>
<dataField column="NUM_SMS_MT_TRANS">0</dataField>
<dataField column="NUM_SMS_MT_TRANS_RESPONSE">0</dataField>
<dataField column="NUM_SMS_MO">81</dataField>
<dataField column="TOTAL_CS_DURATION">0</dataField>
<dataField column="TOTAL_CS_SESSIONS_COUNT">0</dataField>
</dataRow>
</section>
<section name="Data Usage By Customer" rowCount="-1">
<dataRow rowNum="1">
<dataField column="CUSTOMER_CODE">Afaqy</dataField>
<dataField column="TOTAL_BYTES">194399</dataField>
<dataField column="TOTAL_PS_SESSIONS_COUNT">29</dataField>
<dataField column="NUM_SMS_MT_WAKEUP">0</dataField>
<dataField column="NUM_SMS_MT">0</dataField>
<dataField column="NUM_SMS_MT_TRANS">0</dataField>
<dataField column="NUM_SMS_MT_TRANS_RESPONSE">0</dataField>
<dataField column="NUM_SMS_MO">0</dataField>
<dataField column="TOTAL_CS_DURATION">0</dataField>
<dataField column="TOTAL_CS_SESSIONS_COUNT">0</dataField>
</dataRow>
<dataRow rowNum="2">
<dataField column="CUSTOMER_CODE">MKTUAT1</dataField>
<dataField column="TOTAL_BYTES">1680</dataField>
<dataField column="TOTAL_PS_SESSIONS_COUNT">8</dataField>
<dataField column="NUM_SMS_MT_WAKEUP">0</dataField>
<dataField column="NUM_SMS_MT">0</dataField>
<dataField column="NUM_SMS_MT_TRANS">0</dataField>
<dataField column="NUM_SMS_MT_TRANS_RESPONSE">0</dataField>
<dataField column="NUM_SMS_MO">0</dataField>
<dataField column="TOTAL_CS_DURATION">0</dataField>
<dataField column="TOTAL_CS_SESSIONS_COUNT">0</dataField>
</dataRow>
</section>
<section name="State Transition Summary" rowCount="-1">
<dataRow rowNum="1">
<dataField column="CUSTOMER_CODE">Afaqy</dataField>
<dataField column="ACTIVE_LIVE">2</dataField>
<dataField column="ACTIVE_READY">0</dataField>
<dataField column="ACTIVE_TEST">0</dataField>
<dataField column="ACTIVE_SUSPEND">1</dataField>
<dataField column="INACTIVE">1</dataField>
<dataField column="TERMINATED">0</dataField>
<dataField column="ACTIVE_STANDBY">0</dataField>
<dataField column="ACTIVE_SLEEP">0</dataField>
<dataField column="INACTIVE_STOPPED">1</dataField>
<dataField column="INACTIVE_TRANSFORMED">0</dataField>
<dataField column="SUSPEND_REGULATORY">0</dataField>
</dataRow>
<dataRow rowNum="2">
<dataField column="CUSTOMER_CODE">MKTUAT1</dataField>
<dataField column="ACTIVE_LIVE">3</dataField>
<dataField column="ACTIVE_READY">1</dataField>
<dataField column="ACTIVE_TEST">0</dataField>
<dataField column="ACTIVE_SUSPEND">1</dataField>
<dataField column="INACTIVE">2</dataField>
<dataField column="TERMINATED">0</dataField>
<dataField column="ACTIVE_STANDBY">2</dataField>
<dataField column="ACTIVE_SLEEP">1</dataField>
<dataField column="INACTIVE_STOPPED">1</dataField>
<dataField column="INACTIVE_TRANSFORMED">0</dataField>
<dataField column="SUSPEND_REGULATORY">0</dataField>
</dataRow>
</section>
</export>
我需要一个帮助来提取每个部分的长度及其值(NUM_SMS_MT_WAKEUP,TOTAL_BYTES,TOTAL_PS_SESSIONS_COUNT,...)
这里不同的是,提取的值作为列不行。我尝试使用EXTRACTVALUE但无法从XML获取列值
DECLARE
x XMLTYPE := XMLType ('<?xml version="1.0" encoding="UTF-8"?>
<export>
<header generated="2017-03-14T07:23:50.8" name="usgByConOpCo" title="Contracting OpCo Overview" >
<parameter name="PERIOD_START">2017-01-01</parameter>
<parameter name="PERIOD_END">2017-01-31</parameter>
<parameter name="USER_NAME">zainmdw</parameter>
<parameter name="VF_OPCO_ID">1233</parameter>
<parameter name="VF_OPCO_CODE">ZAISA</parameter>
<parameter name="TIMESTAMP">2017-03-14 07:23:50.83</parameter>
</header>
<section name="Data Usage Total" rowCount="-1">
<dataRow rowNum="1">
<dataField column="TOTAL_BYTES">18008179</dataField>
<dataField column="TOTAL_PS_SESSIONS_COUNT">13129</dataField>
<dataField column="NUM_SMS_MT_WAKEUP">0</dataField>
<dataField column="NUM_SMS_MT">17</dataField>
<dataField column="NUM_SMS_MT_TRANS">0</dataField>
<dataField column="NUM_SMS_MT_TRANS_RESPONSE">0</dataField>
<dataField column="NUM_SMS_MO">81</dataField>
<dataField column="TOTAL_CS_DURATION">0</dataField>
<dataField column="TOTAL_CS_SESSIONS_COUNT">0</dataField>
</dataRow>
</section>
<section name="Data Usage By Serving Opco" rowCount="-1">
<dataRow rowNum="1">
<dataField column="SERVING_OPCO">ZAISA</dataField>
<dataField column="TOTAL_BYTES">18008179</dataField>
<dataField column="TOTAL_PS_SESSIONS_COUNT">13129</dataField>
<dataField column="NUM_SMS_MT_WAKEUP">0</dataField>
<dataField column="NUM_SMS_MT">17</dataField>
<dataField column="NUM_SMS_MT_TRANS">0</dataField>
<dataField column="NUM_SMS_MT_TRANS_RESPONSE">0</dataField>
<dataField column="NUM_SMS_MO">81</dataField>
<dataField column="TOTAL_CS_DURATION">0</dataField>
<dataField column="TOTAL_CS_SESSIONS_COUNT">0</dataField>
</dataRow>
</section>
<section name="Data Usage By Customer" rowCount="-1">
<dataRow rowNum="1">
<dataField column="CUSTOMER_CODE">Afaqy</dataField>
<dataField column="TOTAL_BYTES">194399</dataField>
<dataField column="TOTAL_PS_SESSIONS_COUNT">29</dataField>
<dataField column="NUM_SMS_MT_WAKEUP">0</dataField>
<dataField column="NUM_SMS_MT">0</dataField>
<dataField column="NUM_SMS_MT_TRANS">0</dataField>
<dataField column="NUM_SMS_MT_TRANS_RESPONSE">0</dataField>
<dataField column="NUM_SMS_MO">0</dataField>
<dataField column="TOTAL_CS_DURATION">0</dataField>
<dataField column="TOTAL_CS_SESSIONS_COUNT">0</dataField>
</dataRow>
<dataRow rowNum="2">
<dataField column="CUSTOMER_CODE">MKTUAT1</dataField>
<dataField column="TOTAL_BYTES">1680</dataField>
<dataField column="TOTAL_PS_SESSIONS_COUNT">8</dataField>
<dataField column="NUM_SMS_MT_WAKEUP">0</dataField>
<dataField column="NUM_SMS_MT">0</dataField>
<dataField column="NUM_SMS_MT_TRANS">0</dataField>
<dataField column="NUM_SMS_MT_TRANS_RESPONSE">0</dataField>
<dataField column="NUM_SMS_MO">0</dataField>
<dataField column="TOTAL_CS_DURATION">0</dataField>
<dataField column="TOTAL_CS_SESSIONS_COUNT">0</dataField>
</dataRow>
</section>
<section name="State Transition Summary" rowCount="-1">
<dataRow rowNum="1">
<dataField column="CUSTOMER_CODE">Afaqy</dataField>
<dataField column="ACTIVE_LIVE">2</dataField>
<dataField column="ACTIVE_READY">0</dataField>
<dataField column="ACTIVE_TEST">0</dataField>
<dataField column="ACTIVE_SUSPEND">1</dataField>
<dataField column="INACTIVE">1</dataField>
<dataField column="TERMINATED">0</dataField>
<dataField column="ACTIVE_STANDBY">0</dataField>
<dataField column="ACTIVE_SLEEP">0</dataField>
<dataField column="INACTIVE_STOPPED">1</dataField>
<dataField column="INACTIVE_TRANSFORMED">0</dataField>
<dataField column="SUSPEND_REGULATORY">0</dataField>
</dataRow>
<dataRow rowNum="2">
<dataField column="CUSTOMER_CODE">MKTUAT1</dataField>
<dataField column="ACTIVE_LIVE">3</dataField>
<dataField column="ACTIVE_READY">1</dataField>
<dataField column="ACTIVE_TEST">0</dataField>
<dataField column="ACTIVE_SUSPEND">1</dataField>
<dataField column="INACTIVE">2</dataField>
<dataField column="TERMINATED">0</dataField>
<dataField column="ACTIVE_STANDBY">2</dataField>
<dataField column="ACTIVE_SLEEP">1</dataField>
<dataField column="INACTIVE_STOPPED">1</dataField>
<dataField column="INACTIVE_TRANSFORMED">0</dataField>
<dataField column="SUSPEND_REGULATORY">0</dataField>
</dataRow>
</section>
</export>');
BEGIN
FOR r
IN (SELECT EXTRACTvalue(VALUE (p), '/export/section/dataRow/dataField/@TOTAL_BYTES') AS TOTAL_BYTES
FROM TABLE (XMLSEQUENCE (EXTRACT (x, '/export/section/dataRow'))) p)
LOOP
DBMS_OUTPUT.PUT_LINE (' TOTAL_BYTES :' || r.TOTAL_BYTES);
END LOOP;
END;