|
Subject: RE: [xsl] preceding-sibling:: while keeping xml well formed From: "Aron Bock" <aronbock@xxxxxxxxxxx> Date: Tue, 31 May 2005 17:21:52 +0000 |
<xsl:template match="/">
<data>
<xsl:apply-templates/>
</data>
</xsl:template> <xsl:template match="text()[ancestor::i and not(ancestor::b)]">
<italic>
<xsl:copy-of select="."/>
</italic>
</xsl:template> <xsl:template match="text()[ancestor::b[ancestor::i]]">
<bolditalic>
<xsl:copy-of select="."/>
</bolditalic>
</xsl:template><?xml version="1.0" encoding="UTF-8"?> <data> <italic>This</italic> <bolditalic>is</bolditalic> <italic>valid</italic> </data>
I am using xslt to convert one xml to another importable xml. Everything is going fine except for the fact that the program I am importing into supports <italic>, and <bold>, but needs a <bolditalic> when the both are together.
My original xml file is used on the web so of course
<i>This<b>is</b>valid</i>.
I assume this can be done using the preceding-sibiling axis to achive something along the lines of
<italic>This</italic><bolditalic>is</boldItalic><italic>valid</italic>
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| RE: [xsl] preceding-sibling:: while, Michael Kay | Thread | Re: [xsl] preceding-sibling:: while, Spencer Tickner |
| RE: [xsl] preceding-sibling:: while, Michael Kay | Date | Re: [xsl] preceding-sibling:: while, Spencer Tickner |
| Month |