Re: XSLT Select?

Discussion in 'XML' started by TAN Kuan Hui, Jul 11, 2003.

  1. TAN Kuan Hui

    TAN Kuan Hui Guest

    >
    > and I pass x to a template, how can I send the first "a" to a
    > template, but not recursively also send the second? I use
    > apply-templates "a". Maybe I just need to apply-templates "x/a", but



    Have you tried x/a[0] ?

    > how do you do that if you are passing x, itself, to start off the
    > template? the 'root' x node is not part of the nodeset, correct?


    root x is not part of the nodeset but there is nothing stopping
    you from accessing x from within x/a thru ..
     
    TAN Kuan Hui, Jul 11, 2003
    #1
    1. Advertising

  2. "TAN Kuan Hui" <> wrote in message
    news:3f0df144$...
    > >
    > > and I pass x to a template, how can I send the first "a" to a
    > > template, but not recursively also send the second? I use
    > > apply-templates "a". Maybe I just need to apply-templates "x/a", but

    >
    >
    > Have you tried x/a[0] ?


    This won't work! In XSL arrays start at index '1'. Therefore, you must use:
    <xsl:apply-templates select="a[1]"/>

    >
    > > how do you do that if you are passing x, itself, to start off the
    > > template? the 'root' x node is not part of the nodeset, correct?

    >
    > root x is not part of the nodeset but there is nothing stopping
    > you from accessing x from within x/a thru ..
    >
    >
    >
    >
     
    Johannes Lebek, Jul 11, 2003
    #2
    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. Stylus Studio
    Replies:
    0
    Views:
    716
    Stylus Studio
    Aug 3, 2004
  2. Benjamin Hillsley
    Replies:
    3
    Views:
    1,700
    Dimitre Novatchev
    Sep 25, 2003
  3. ted
    Replies:
    1
    Views:
    642
    Laurens
    Jan 26, 2004
  4. Replies:
    2
    Views:
    729
    Henry S. Thompson
    Oct 19, 2005
  5. palmiere
    Replies:
    1
    Views:
    431
    Erwin Moller
    Feb 9, 2004
Loading...

Share This Page