[Home] [By Thread] [By Date] [Recent Entries]
Hi Wendell,
Thank you for responding, I guess I removed too much of my original post and ended up being less clear.
The reason I ask is that in XSLT 1.0 you can't generate nodes in the result by iterating over a set of numbers, which is effectively what you are trying to do here. xsl:for-each doesn't accept "from" and "to" attributes, as its purpose is to select a set of *nodes* (from the source tree) and operate with each of them in turn as the current node. (In this, it's really just a shortcut to allow you to do this locally without calling a new template rule, which is what you'd ordinarily do.)
Here is an brief version of the wddx data: <?xml version="1.0" encoding="UTF-8"?>
<wddxPacket version='1.0'><header></header><data><struct>
<var name='party'>
<recordset rowCount='2'
fieldNames='PARTY_ID,PARTY_ROLE_ID,FIRST_NAME,LAST_NAME,BIRTH_DT'>
<field name='PARTY_ID'>
<number>2127652</number>
<number>2127653</number></field>
<field name='PARTY_ROLE_ID'>
<number>51</number>
<number>24</number></field>
<field name='FIRST_NAME'>
<string>Bob</string>
<string>Donte</string></field>
<field name='LAST_NAME'>
<string>Jones</string>
<string>Smith</string></field>
<field name='SUFFIX'>
<string></string>
<string></string></field>
<field name='BIRTH_DT'>
<string></string>
<dateTime>1990-6-4T0:0:0-8:0</dateTime></field>
</recordset>
</var>
<var name='alias'>
<recordset rowCount='1' fieldNames='ALIAS_ID,PARTY_ID,FIRST_NAME,LAST_NAME'>
<field name='ALIAS_ID'>
<number>1</number></field>
<field name='PARTY_ID'>
<number>2127652</number></field>
<field name='FIRST_NAME'>
<string>Bobby</string></field>
<field name='LAST_NAME'>
<string>Joneson</string></field>
</recordset>
</var>
</struct></data></wddxPacket>And the output I am hoping to get as a result is: <?xml version="1.0" encoding="UTF-8"?>
<partyList>
<party>
<PARTY_ID>2127652</PARTY_ID>
<PARTY_ROLE_ID>51</PARTY_ROLE_ID>
<FIRST_NAME>Bob</FIRST_NAME>
<LAST_NAME>Jones</LAST_NAME>
<SUFFIX/>
<BIRTH_DT/>
</party>
<party>
<PARTY_ID>2127653</PARTY_ID>
<PARTY_ROLE_ID>24</PARTY_ROLE_ID>
<FIRST_NAME>Donte</FIRST_NAME>
<LAST_NAME>Smith</LAST_NAME>
<SUFFIX/>
<BIRTH_DT>1990-6-4T0:0:0-8:0</BIRTH_DT>
</party>
<alias>
<ALIAS_ID>1</ALIAS_ID>
<PARTY_ID>2127652</PARTY_ID>
<FIRST_NAME>Bobby</FIRST_NAME>
<LAST_NAME>Joneson</LAST_NAME>
</alias>
</partyList>If it is possible to do in one style sheet I would also like to make a copy of the alias element into the party element where the party_id identical. But I figured that could be a separate question. Thanks again, Eric
|

Cart



