Extracting multiple occurences in XML file
Posted: Tue Mar 01, 2011 2:49 am
I have an xml file with repeated info such as the following.
example:
<PRODUCT_INFO>
<PROD_CD>PROD_CD1</PROD_CD>
<PRODUCT_INFO>
<PRODUCT_INFO>
<PROD_CD>PROD_CD2</PROD_CD>
<PRODUCT_INFO>
I am required to store the first occurence (i.e. PROD_CD1) under a Field A and the second occurence (i.e. PROD_CD2) under a Field B.
I am able to extract the value for the first occurence. However unable to retrieve the second occurence. Please advice. Thanks.
example:
<PRODUCT_INFO>
<PROD_CD>PROD_CD1</PROD_CD>
<PRODUCT_INFO>
<PRODUCT_INFO>
<PROD_CD>PROD_CD2</PROD_CD>
<PRODUCT_INFO>
I am required to store the first occurence (i.e. PROD_CD1) under a Field A and the second occurence (i.e. PROD_CD2) under a Field B.
I am able to extract the value for the first occurence. However unable to retrieve the second occurence. Please advice. Thanks.