468,133 Members | 1,215 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,133 developers. It's quick & easy.

Need some help on this xsl, thanks

Hi, I want a xsl so I can categorize a flat xml, like this:

<field name="a1"/>
<field name="a2" merge="true"/>
<field name="a3"/>
<field name="a4"/>
<field name="a5" merge="true"/>
<field name="a6" merge="true"/>
<field name="a7"/>

so the outer loop will go through a1, a3,a4,a6,a7, and in the loop, under
a1, a2 will be called, under a4, a5 and a6 will be called.

any suggestion?

thanks
Mar 8 '06 #1
2 979


davidw wrote:
Hi, I want a xsl so I can categorize a flat xml, like this:

<field name="a1"/>
<field name="a2" merge="true"/>
<field name="a3"/>
<field name="a4"/>
<field name="a5" merge="true"/>
<field name="a6" merge="true"/>
<field name="a7"/>

so the outer loop will go through a1, a3,a4,a6,a7, and in the loop, under
a1, a2 will be called, under a4, a5 and a6 will be called.


What is the desired result XML? Do you want to make field name="a2" a
child element of field name="a1"?

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Mar 8 '06 #2
I want to output some result, nodes with merge attribute will be acted like
children of the previous non-merge node, it will work if it is a tree like

<field name="a1">
<field name="a2" merge="true"/>
</field>
<field name="a3"/>
<field name="a4">
<field name="a5" merge="true"/>
<field name="a6" merge="true"/>
</field>
<field name="a7"/>

so I know a5 and a6 is children of a4, and I can process a4 and inside, I
then process a5,a6. The issue now is Ican not have a tree like that, instead
Ihave the flat xml as I posted before. If I loop through the non-merge
nodes, how could I get its non-merge children, for example, if the current
node is a4, how can I get the nodes a5 and a6, but not a7? or on a1, how to
get a2.

Thanks!
"Martin Honnen" <ma*******@yahoo.de> wrote in message
news:O7**************@TK2MSFTNGP10.phx.gbl...


davidw wrote:
Hi, I want a xsl so I can categorize a flat xml, like this:

<field name="a1"/>
<field name="a2" merge="true"/>
<field name="a3"/>
<field name="a4"/>
<field name="a5" merge="true"/>
<field name="a6" merge="true"/>
<field name="a7"/>

so the outer loop will go through a1, a3,a4,a6,a7, and in the loop, under a1, a2 will be called, under a4, a5 and a6 will be called.


What is the desired result XML? Do you want to make field name="a2" a
child element of field name="a1"?

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/

Mar 8 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by netpurpose | last post: by
6 posts views Thread by mike | last post: by
7 posts views Thread by Timothy Shih | last post: by
7 posts views Thread by Tee | last post: by
reply views Thread by U S Contractors Offering Service A Non-profit | last post: by
1 post views Thread by gcdp | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.