Matching twice

P

patrik.nyman

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,007
Messages
2,570,266
Members
46,864
Latest member
DaniEbswor

Latest Threads

Top