|
Subject: Re: [xsl] Displaying text nodes and child nodes From: "Filipe Correia" <filipe.correia@xxxxxxxxxxxxxxx> Date: Thu, 23 May 2002 19:08:11 +0100 |
>Hi!
>
>I've write a xsl that displays information about contacts. the problem is
>that the description of a contact could have tags and tex mixed.
>if i use <xsl:value-of/> it displays all the text (including the text of
>child nodes), if i use the <xsl:copy> it only displays the child nodes
>what i want is a way to do both so a xml like:
><Description>
> <b>some title</b>
> normal text write without beeing in a tag
> <i>italic text</i> followed by normal text.
></Description>
>
>Displays:
> some title normal text write without beeing in a tag italic text followed
>by normal text.
>
>with <xsl:value-of/> it appears like:
> some title normal text write without beeing in a tag italic text followed
>by normal text.
>
>and with <xsl:copy> appears like:
> some title italic text
>
>any ideas??
>
You can write an empty template for each element you wish to ignore.
If you wish to ignore all <b> elements your template would be:
<xsl:template match="b">
</xsl:template>
then you only need to apply all templates to the <description> element:
<xsl:template match="description">
<xsl:apply-templates/>
</xsl:template>
Cheers,
Filipe
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| [xsl] Displaying text nodes and chi, Américo Albuquerque | Thread | [xsl] Displaying text nodes and chi, Américo Albuquerque |
| [xsl] Stuck on meta-stylesheet pro, Charles Knell | Date | RE: [xsl] Using name in Xpath, Michael Kay |
| Month |