Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old March 8th, 2006, 03:35 AM
davidw
Guest
 
Posts: n/a
Default 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


  #2  
Old March 8th, 2006, 04:15 PM
Martin Honnen
Guest
 
Posts: n/a
Default Re: Need some help on this xsl, thanks



davidw wrote:
[color=blue]
> 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.[/color]

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/
  #3  
Old March 8th, 2006, 08:15 PM
davidw
Guest
 
Posts: n/a
Default Re: Need some help on this xsl, thanks

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" <mahotrash@yahoo.de> wrote in message
news:O7zTClsQGHA.6084@TK2MSFTNGP10.phx.gbl...[color=blue]
>
>
> davidw wrote:
>[color=green]
> > 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,[/color][/color]
under[color=blue][color=green]
> > a1, a2 will be called, under a4, a5 and a6 will be called.[/color]
>
> 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/[/color]


 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles