xsl-list
[Top] [All Lists]

Including an HTML tag inside the XML text

2005-03-03 07:47:45
Hi all...

I want to write an XML something like this:

<node>
  <text>blablabla<br>blebleble</text>
</node>


If in XSL I use:

<xsl:value-of select="node/text" />

I want this to be written:

blablabla<line feed>
blebleble

Is this possible? I tried CDATA section but it didn't work.

Thanks

Jaime

-----Mensaje original-----
De: Jarno(_dot_)Elovirta(_at_)nokia(_dot_)com 
[mailto:Jarno(_dot_)Elovirta(_at_)nokia(_dot_)com]
Enviado el: Jueves, 03 de Marzo de 2005 8:47
Para: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Asunto: RE: [xsl] xsl:template having both name and match


Hi,

Hello,
  I have a question about xsl:template ..

It is said in XSLT 2.0 spec that..
"If an xsl:template element has a name attribute, it
may, but need not, also have a match attribute.

The match, mode and priority attributes on an
xsl:template element have no effect when the template
is invoked by an xsl:call-template instruction.
Similarly, the name attribute on an xsl:template
element has no effect when the template is invoked by
an xsl:apply-templates instruction."

I think this is also true in case of XSLT 1.0 ..

This means that we can write a xsl:template having
*both* name and match attributes..

I want to know in which circumstances such a template
definition is useful.. Can somebody please provide an
example where this has real practical use..?

<xsl:template name="block/title" name="section.heading">
  <xsl:param name="content">
    <xsl:apply-templates/>
  </xsl:param>
  <h2>
    <xsl:copy-of select="$content"/>
  </h2>
</xsl:template>
 
When you want to use the same template to generate headings for both matched 
title elements and autogenerated content.

Cheers,

Jarno - Rammstein: Moskau

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>