attrybutes from higher elements XSLT

Discussion in 'XML' started by Ruthless, Dec 27, 2003.

  1. Ruthless

    Ruthless Guest

    Hello.
    I've got a question.
    I've got family tree in XML.

    It looks like this
    <generation level="2">
    <single><person>...</single>
    <marriage><preson>...</person><person>....</person></marriage>

    <person> inside single and marriage is the same element,
    marriage has 2 elements of <person>(quite obvious :))

    I've got XSLT displaying all persons(single and marriage both) from all
    levels but i'd also like to display their level in family tree.
    e.g.
    <tr><td>first_name</td><td>last_name</td><td> level</td> ... etc... </tr>

    But i don'y know how to ommit the <single> or <marriage> element and go
    straight to generation@level

    Generation is recursive, <marriage> can have <children> who strats new
    <generation> of level="parents_level+1"

    And the second question how can i check whether or not <person> is inside
    <single who="name1"> or <marriage who="name1 with name2"> element and how to
    get the @who attribute?

    thanx in advance
    greetings R


    ---
    Outgoing mail is certified Virus Free.
    Checked by AVG anti-virus system (http://www.grisoft.com).
    Version: 6.0.554 / Virus Database: 346 - Release Date: 03-12-20
    Ruthless, Dec 27, 2003
    #1
    1. Advertising

  2. "Ruthless" <ruthless@NO_SPAM.poczta.onet.pl> wrote in message
    news:bsjo18$8cc$...
    > Hello.
    > I've got a question.
    > I've got family tree in XML.
    >
    > It looks like this
    > <generation level="2">
    > <single><person>...</single>
    > <marriage><preson>...</person><person>....</person></marriage>
    >
    > <person> inside single and marriage is the same element,
    > marriage has 2 elements of <person>(quite obvious :))
    >
    > I've got XSLT displaying all persons(single and marriage both) from all
    > levels but i'd also like to display their level in family tree.
    > e.g.
    > <tr><td>first_name</td><td>last_name</td><td> level</td> ... etc... </tr>
    >
    > But i don'y know how to ommit the <single> or <marriage> element and go
    > straight to generation@level


    Use:

    ../../@level

    >
    > Generation is recursive, <marriage> can have <children> who strats new
    > <generation> of level="parents_level+1"
    >
    > And the second question how can i check whether or not <person> is inside
    > <single who="name1"> or <marriage who="name1 with name2">
    > element


    Use:
    ../self::single

    to select the parent if it is "single"

    or use

    ../self::marriage

    to select the parent if it is "marriage"



    > and how to
    > get the @who attribute?


    ../@who

    Dimitre Novatchev.
    FXSL developer, XML Insider,

    http://fxsl.sourceforge.net/ -- the home of FXSL
    Resume: http://fxsl.sf.net/DNovatchev/Resume/Res.html
    Dimitre Novatchev, Dec 27, 2003
    #2
    1. Advertising

  3. Ruthless

    Ruthless Guest

    thnak you, now it's OK

    greetings R

    U¿ytkownik "Dimitre Novatchev" <> napisa³ w wiadomo¶ci
    news:bsjq32$dkh3o$-berlin.de...
    >
    > "Ruthless" <ruthless@NO_SPAM.poczta.onet.pl> wrote in message
    > news:bsjo18$8cc$...
    > > Hello.
    > > I've got a question.
    > > I've got family tree in XML.
    > >
    > > It looks like this
    > > <generation level="2">
    > > <single><person>...</single>
    > > <marriage><preson>...</person><person>....</person></marriage>
    > >
    > > <person> inside single and marriage is the same element,
    > > marriage has 2 elements of <person>(quite obvious :))
    > >
    > > I've got XSLT displaying all persons(single and marriage both) from all
    > > levels but i'd also like to display their level in family tree.
    > > e.g.
    > > <tr><td>first_name</td><td>last_name</td><td> level</td> ... etc...

    </tr>
    > >
    > > But i don'y know how to ommit the <single> or <marriage> element and go
    > > straight to generation@level

    >
    > Use:
    >
    > ../../@level
    >
    > >
    > > Generation is recursive, <marriage> can have <children> who strats new
    > > <generation> of level="parents_level+1"
    > >
    > > And the second question how can i check whether or not <person> is

    inside
    > > <single who="name1"> or <marriage who="name1 with name2">
    > > element

    >
    > Use:
    > ../self::single
    >
    > to select the parent if it is "single"
    >
    > or use
    >
    > ../self::marriage
    >
    > to select the parent if it is "marriage"
    >
    >
    >
    > > and how to
    > > get the @who attribute?

    >
    > ../@who
    >
    > Dimitre Novatchev.
    > FXSL developer, XML Insider,
    >
    > http://fxsl.sourceforge.net/ -- the home of FXSL
    > Resume: http://fxsl.sf.net/DNovatchev/Resume/Res.html
    >
    >
    >
    >



    ---
    Outgoing mail is certified Virus Free.
    Checked by AVG anti-virus system (http://www.grisoft.com).
    Version: 6.0.554 / Virus Database: 346 - Release Date: 03-12-20
    Ruthless, Dec 27, 2003
    #3
    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. Nathan Sokalski
    Replies:
    0
    Views:
    719
    Nathan Sokalski
    May 30, 2005
  2. pete kirkham
    Replies:
    5
    Views:
    448
    pete kirkham
    Aug 13, 2003
  3. RCS

    Higher DPI than 72

    RCS, Oct 19, 2003, in forum: Java
    Replies:
    6
    Views:
    2,794
  4. Gerald Aichholzer
    Replies:
    2
    Views:
    2,481
    Gerald Aichholzer
    Jun 27, 2006
  5. Replies:
    1
    Views:
    394
    Joseph Kesselman
    Oct 27, 2006
Loading...

Share This Page