Ramkumar V wrote:
I used the same template match, to display anchor attribute('name') value in
browser. But I can't.
XSL:
====
<xsl:template match="bk:text">
<p><xsl:value-of select="." disable-output-escaping="yes"/></p>
</xsl:template>
<xsl:template match="a">
<xsl:apply-templates/><sup><font color="red"><xsl:value-of
select="@name"/></font></sup>
</xsl:template>
XML:
====
<?xml version="1.0"?>
<bk:text><![CDATA[Psychologists acknowledge that, as in the heroism of Sully
Sullenberger, sometimes an individual’s best moments emerge<a
class="page_break" name="page7"></a> amid the most difficult
circumstances.]]></bk:text>
Required Browser output:
========================
Psychologists acknowledge that, as in the heroism of Sully
Sullenberger, sometimes an individual’s best moments emerge
<< the text 'page7' will appear superscript and font color :red>>
amid the most difficult
circumstances
Well if the markup in the input XML is contained in a CDATA section then
in the XSLT/XPath data model there is simply a text node as the sole
child node of the 'bk:text' element. If you want to use XPath or
apply-templates on the XML markup in that text node then you first need
to parse the markup as XML (as long as it is XML). However doing so
requires an extension function. Saxon 9 has one for such a task
<xsl:template match="bk:text"
<p>
<xsl:apply-templates select="saxon:parse(concat('<dummy>',
., '</dummy>'))/dummy/node()"
xmlns:saxon="http://saxon.sf.net/"/>
</p>
</xsl:template>
--
Martin Honnen --- MVP Data Platform Development
http://msmvps.com/blogs/martin_honnen/
--~------------------------------------------------------------------
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>
--~--