You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Matthew Cordes <mc...@maine.edu> on 2000/04/23 05:12:47 UTC
xsl:include and weird xalan behavior
Hello all, 2 questions...
1. In an xsl document, how do I include other stylesheets. I know what
you're thinking - <xsl:include href="some_file"/>, but I'm confused
how exactly to do this. Should I have 2 separate well-formed
stylesheets? ( I assume yes ). When i say <xsl:include...> does that
include the stylesheet's templates or can i use it to dump text directly
into place. I want to do something like apache's '#include'.
2. I'm using xalan 1.0.1 and xerces 1.0.3 and am experiencing some strange
behavior. Here is a code fragment:
<a name="{ALIAS}"></a>
<b><xsl:value-of select="LASTNAME"/>
<xsl:text>, </xsl:text>
<xsl:value-of select="FIRSTNAME"/></b>
What I expect this to display is "<LASTNAME>, <FIRSTNAME>" , but for some
aggravating reason it always displays "<LASTNAME> <FIRSTNAME>,".
Notice that the comma is at the end !?! Can anyone explain this
behavior? Or should I report it as a bug?
Just in case I'm to blame here is the whole template:
<xsl:template match="PERSON">
<tr>
<td>
<p>
<a name="{ALIAS}"></a>
<b><xsl:value-of select="LASTNAME"/>
<xsl:text>, </xsl:text>
<xsl:value-of select="FIRSTNAME"/></b>
<br/>
<xsl:apply-templates select="TITLE"/>
<xsl:value-of select="BIOGRAPHY"/>
</p>
<table border="0" cellspacing="0" cellpadding="0">
<xsl:apply-templates select="PHONE"/>
<xsl:apply-templates select="EMAIL"/>
<xsl:apply-templates select="WWW"/>
<tr>
<td><br/> <!-- blank row -->
</td>
</tr>
</table>
</td>
</tr>
</xsl:template>
Thanks for reading this
-matt