[xslt] text() problem



Hi all,

I am having difficulty with a template that uses "text()".  I am using
the most recent stable versions of libXML and libXSLT (as of
2001-01-18) via the XML::LibXML and XML::LibXSLT Perl modules.

With xml:

<?xml version="1.0"?>
<title rend="fs-italic">
Romeo and <pb n="70" header="Shakespeare"/>Juliet
</title>

And stylesheet:

<?xml version="1.0"?>

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>

<xsl:template match="pb">
<hr class="page"/>
<p class="page">
<xsl:value-of select="./@n"/>
<br/>
<xsl:value-of select="./@header"/>
</p>
</xsl:template>

<xsl:template match="title">
<xsl:apply-templates/>
</xsl:template>

<xsl:template match="title/text()">
<strong><xsl:value-of select="."/></strong>
</xsl:template>

</xsl:stylesheet>

I get output of:

<?xml version="1.0"?>
Romeo and <hr class="page"/><p class="page">70<br/>Shakespeare</p>Juliet

I believe I should get the following (which is what I get from Xalan):

<?xml version="1.0"?>
<strong>Romeo and </strong><hr class="page"/><p class="page">70<br/>Shakespeare</p><strong>Juliet</strong>

I've searched around the archives and libxslt docs but can't find any
indication that this shouldn't work as expected.  Thanks for
listening.

John
| John A. Walsh, Manager, Electronic Text Technologies
| Digital Library Program / University Information Technology Services (UITS)
| Indiana University, 1320 East Tenth Street, Bloomington, IN 47405
| Voice:812-855-8758 Fax:812-856-2062 <mailto:jawalsh@indiana.edu>




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]