Parse Repeating XML Tags
Posted: Tue Jul 15, 2008 9:51 am
I am getting input XML in the format below. I need to pull the value in the tag <name> and create 1 row with 7 columns (populated by the different values in the <name> tag). Since the tag name <EObjCdProdTp> is the same for all the blocks, I am getting 7 rows and 1 column. Is there a way to do this?
<ResponseObject>
<EObjCdProdTp>
<description>SEM</description>
<lang_tp_cd>100</lang_tp_cd>
<lang_type>English</lang_type>
<last_update_dt>2008-05-20 12:00:00.0</last_update_dt>
<name>616</name>
<tp_cd>6000673</tp_cd>
</EObjCdProdTp>
<EObjCdProdTp>
<description>COMPACT</description>
<lang_tp_cd>100</lang_tp_cd>
<lang_type>English</lang_type>
<last_update_dt>2008-05-20 12:00:00.0</last_update_dt>
<name>MMCWL</name>
<tp_cd>5001035</tp_cd>
</EObjCdProdTp>
<EObjCdProdTp>
<description>Compact Wheel</description>
<lang_tp_cd>100</lang_tp_cd>
<lang_type>English</lang_type>
<last_update_dt>2008-05-20 12:00:00.0</last_update_dt>
<name>CWL</name>
<tp_cd>4001020</tp_cd>
</EObjCdProdTp>
<EObjCdProdTp>
<description>Compact Equip</description>
<lang_tp_cd>100</lang_tp_cd>
<lang_type>English</lang_type>
<last_update_dt>2008-05-20 12:00:00.0</last_update_dt>
<name>CCE</name>
<tp_cd>3001003</tp_cd>
</EObjCdProdTp>
</ResponseObject>
<ResponseObject>
<EObjCdProdTp>
<description>SEM</description>
<lang_tp_cd>100</lang_tp_cd>
<lang_type>English</lang_type>
<last_update_dt>2008-05-20 12:00:00.0</last_update_dt>
<name>616</name>
<tp_cd>6000673</tp_cd>
</EObjCdProdTp>
<EObjCdProdTp>
<description>COMPACT</description>
<lang_tp_cd>100</lang_tp_cd>
<lang_type>English</lang_type>
<last_update_dt>2008-05-20 12:00:00.0</last_update_dt>
<name>MMCWL</name>
<tp_cd>5001035</tp_cd>
</EObjCdProdTp>
<EObjCdProdTp>
<description>Compact Wheel</description>
<lang_tp_cd>100</lang_tp_cd>
<lang_type>English</lang_type>
<last_update_dt>2008-05-20 12:00:00.0</last_update_dt>
<name>CWL</name>
<tp_cd>4001020</tp_cd>
</EObjCdProdTp>
<EObjCdProdTp>
<description>Compact Equip</description>
<lang_tp_cd>100</lang_tp_cd>
<lang_type>English</lang_type>
<last_update_dt>2008-05-20 12:00:00.0</last_update_dt>
<name>CCE</name>
<tp_cd>3001003</tp_cd>
</EObjCdProdTp>
</ResponseObject>