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>
Parse Repeating XML Tags
Moderators: chulett, rschirm, roy
It is what it is, seven "instances" of a thing called EObj... You need a technique to "reverse pivot" your seven rows. I'm sure there are many such techniques described in the forum here (it can be done in a variety of ways that use everything from stage variables to Aggregations), along with one or two entries that describe using XSLT, if you want to go that route.
Ernie
Ernie
Ernie Ostic
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
-
- Premium Member
- Posts: 28
- Joined: Mon Apr 20, 2009 11:27 pm
- Location: san antonio
Parse the fisrt object and take the resultant in a column , and aply xml inut stage , with ur defined table structure . u will get 7 rows based on ur table structureeostic wrote:It is what it is, seven "instances" of a thing called EObj... You need a technique to "reverse pivot" your seven rows. I'm sure there are many such techniques described in the forum here (it can be done in a variety of ways that use everything from stage variables to Aggregations), along with one or two entries that describe using XSLT, if you want to go that route.
Ernie
Krishna Shukla