xslt: handle nested structure

Discussion in 'XML' started by thijs.kupers@gmail.com, Dec 6, 2004.

  1. Guest

    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
    , Dec 6, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dietrich
    Replies:
    1
    Views:
    625
    Joe Smith
    Jul 22, 2004
  2. Replies:
    2
    Views:
    724
  3. Leon
    Replies:
    2
    Views:
    507
  4. =?ISO-8859-1?Q?KLEIN_St=E9phane?=
    Replies:
    3
    Views:
    439
    hanumizzle
    Oct 6, 2006
  5. Replies:
    1
    Views:
    196
Loading...

Share This Page