Hi,
I have some trouble getting my xml to display correctly using xsl. I have a node with formatting which can also contain changes which are marked <insertion> or <deletion>. Insertions should be shown, deletions should not.
A sample piece of this xml is:
<Text> text<inserted> </inserted><b>te</b>xt</Text>
<Text>this is added withb<b>old <br/><br/></b><b><i>bold italic</i></b><b><br/><br/></b><font face='Courier New, Courier, mono'><i>courier italic<br/><br/></i></font><font face='Courier New, Courier, mono'><b>courier bold<br/><br/></b></font><i>italic<br/><br/></i><font face='Courier New, Courier, mono'>courier on its own</font><i><br/><br/></i>and normal text</Text>
The first node above has a space inserted between the two words "text" and the second has lots of insertions and deletions with formatting.
I find that when I use
<xsl:template match="inserted">
<xsl:value-of select="."/>
</xsl:template>
I get the spaces, but not the formatting, whereas when I use
<xsl:template match="inserted">
<xsl:apply-templates/>
</xsl:template>
I get the formatting but not the spaces. Note: the formatting is put in by also having
<xsl:template match="br">
<br/>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="i">
<i>
<xsl:apply-templates/>
</i>
</xsl:template>
<xsl:template match="b">
<b>
<xsl:apply-templates/>
</b>
</xsl:template>
in my xsl.
My question is - how can I get the content to show both, while still not showing any deleted text, which I have currently working through
<xsl:template match="deleted"/>
in the xsl.
Any help or pointers are greatly appreciated!
thanks
A
I have some trouble getting my xml to display correctly using xsl. I have a node with formatting which can also contain changes which are marked <insertion> or <deletion>. Insertions should be shown, deletions should not.
A sample piece of this xml is:
<Text> text<inserted> </inserted><b>te</b>xt</Text>
<Text>this is added withb<b>old <br/><br/></b><b><i>bold italic</i></b><b><br/><br/></b><font face='Courier New, Courier, mono'><i>courier italic<br/><br/></i></font><font face='Courier New, Courier, mono'><b>courier bold<br/><br/></b></font><i>italic<br/><br/></i><font face='Courier New, Courier, mono'>courier on its own</font><i><br/><br/></i>and normal text</Text>
The first node above has a space inserted between the two words "text" and the second has lots of insertions and deletions with formatting.
I find that when I use
<xsl:template match="inserted">
<xsl:value-of select="."/>
</xsl:template>
I get the spaces, but not the formatting, whereas when I use
<xsl:template match="inserted">
<xsl:apply-templates/>
</xsl:template>
I get the formatting but not the spaces. Note: the formatting is put in by also having
<xsl:template match="br">
<br/>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="i">
<i>
<xsl:apply-templates/>
</i>
</xsl:template>
<xsl:template match="b">
<b>
<xsl:apply-templates/>
</b>
</xsl:template>
in my xsl.
My question is - how can I get the content to show both, while still not showing any deleted text, which I have currently working through
<xsl:template match="deleted"/>
in the xsl.
Any help or pointers are greatly appreciated!
thanks
A