Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > xslt: handle nested structure

Reply
Thread Tools

xslt: handle nested structure

 
 
thijs.kupers@gmail.com
Guest
Posts: n/a
 
      12-06-2004
hy,

I don't have so much experience with xslt, so i've got a question about
it.

I've got a xml-document with the following structure:
<Block>
<Block>
<State name="1">...</State>
<State name="2">...</State>
<Block>
<State name="3">...</State>
</Block>
<Trans name="a"/>
<Trans name="b"/>
</Block>
<Trans name="c"/>
</Block>

A 'state' (and 'Trans') can be a child of a 'block' and a 'block' can
be a child of another 'block'. What I as output want is the same as the
input, with the difference that every 'State' has all the 'Trans' items
from the parents (so State 3 gets trans a, b and c. State 2 gets only
state c)

for example:

<Block name="b1">
<Block name="b2">
<State name="1">...
<Trans name="c" blockFrom="b1"/>
</State>
<State name="2">...
<Trans name="c" blockFrom="b1"/>
</State>
<Block name="b3">
<State name="3">...
<Trans name="a" blockFrom="b2"/>
<Trans name="b" blockFrom="b2"/>
<Trans name="c" blockFrom="b1"/>
</State>
</Block>
<Trans name="a"/>
<Trans name="b"/>
</Block>
<Trans name="c"/>
</Block>


I hope, someone can help me

Regards,

Thijs

 
Reply With Quote
 
 
 
Reply

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 On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
selection structure nested within another selection structure 4Ankit@gmail.com Javascript 1 12-07-2006 11:47 AM
Possible to handle web requests without an ASPX page? i.e. have DLL handle request. jdlwright@shaw.ca ASP .Net 2 05-31-2005 05:42 PM
xslt: handle nested structure thijs.kupers@gmail.com XML 2 12-07-2004 08:22 AM
how to handle command line output(not terminal handle) Leon Python 2 11-04-2004 05:16 AM
File Handle Reading Blues: Rereading a File Handle for Input Dietrich Perl 1 07-22-2004 10:02 AM



Advertisments