Matching twice

Discussion in 'XML' started by patrik.nyman@orient.su.se, Dec 13, 2006.

  1. Guest

    Hi!

    I have elements like these:

    <name style="it">SomeData</name>
    <otherName style="it">SomeOtherData</otherName>

    and tries to transform these with the following:

    <xsl:template match="*[@rend='it']">
    <i><xsl:apply-templates/></i>
    </xsl:template>

    <xsl:template match="name">
    ... do something ...
    </xsl:template>

    <xsl:template match="otherName">
    ... do something ...
    </xsl:template>

    But as you might guess, it does not work, because only
    the first template matches. That is, after the first
    template there is

    <i>SomeData</i>

    but I would like to have

    <name><i>SomeData</i></name>

    Could someone please telle me how?

    /Patrik
    , Dec 13, 2006
    #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. Matching twice

    , Dec 13, 2006, in forum: XML
    Replies:
    4
    Views:
    441
  2. Kiuhnm

    twice(twice(x))

    Kiuhnm, Apr 1, 2006, in forum: C++
    Replies:
    2
    Views:
    385
    Kiuhnm
    Apr 1, 2006
  3. Joel VanderWerf
    Replies:
    1
    Views:
    217
    Joel VanderWerf
    Nov 10, 2006
  4. Marc Bissonnette

    Pattern matching : not matching problem

    Marc Bissonnette, Jan 8, 2004, in forum: Perl Misc
    Replies:
    9
    Views:
    220
    Marc Bissonnette
    Jan 13, 2004
  5. Bobby Chamness
    Replies:
    2
    Views:
    212
    Xicheng Jia
    May 3, 2007
Loading...

Share This Page