Confusion over patterns and expressions

Discussion in 'XML' started by mikea_59, Apr 3, 2005.

  1. mikea_59

    mikea_59 Guest

    Lets say I have some XML like this:

    <AAA>
    <BBB>
    <b1>xx</b1>
    <b2>xxx</b2>
    </BBB>
    <CCC>
    <c1>z</c1>
    </CCC>
    </AAA>

    And I want to write some XSL that will process the last node of the
    root element - in this case <CCC>, ignoring all other nodes - in this
    case <BBB>. I don't know the element names ahead of time so I can't use
    them in the templates.

    So my general question is, how do I write the expressions in the
    select part of the xsl:apply-template element and/or, how do I write
    the match part of the pattern in the xsl:template element?
     
    mikea_59, Apr 3, 2005
    #1
    1. Advertising

  2. <xsl:template match="/*">
    <xsl:apply-templates select="*[last()]"/>
    </xsl:template>

    <xsl:template match="/*/*">
    whatever you want here
    </xsl:template>

    David
     
    David Carlisle, Apr 3, 2005
    #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. Jay Douglas
    Replies:
    0
    Views:
    618
    Jay Douglas
    Aug 15, 2003
  2. =?Utf-8?B?Q2hyaXN0aWFuIE51bmNpYXRv?=

    Confusion Over Postback, ViewState and Dynamically Added Controls

    =?Utf-8?B?Q2hyaXN0aWFuIE51bmNpYXRv?=, May 3, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    2,357
    Brock Allen
    May 3, 2005
  3. crichmon
    Replies:
    4
    Views:
    497
    Mabden
    Jul 7, 2004
  4. Carlos
    Replies:
    1
    Views:
    614
    Paul McGuire
    Jan 22, 2006
  5. Noman Shapiro
    Replies:
    0
    Views:
    239
    Noman Shapiro
    Jul 17, 2013
Loading...

Share This Page