You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by st...@locus.apache.org on 2000/04/09 01:12:34 UTC
cvs commit: xml-cocoon/src/org/apache/cocoon/processor/xsp xsp-java.xsl
stefano 00/04/08 16:12:34
Modified: src/org/apache/cocoon/processor/xsp xsp-java.xsl
Log:
now xsp:pi accept xsp:expr nested tags
Revision Changes Path
1.14 +19 -6 xml-cocoon/src/org/apache/cocoon/processor/xsp/xsp-java.xsl
Index: xsp-java.xsl
===================================================================
RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/processor/xsp/xsp-java.xsl,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- xsp-java.xsl 2000/03/01 16:13:47 1.13
+++ xsp-java.xsl 2000/04/08 23:12:34 1.14
@@ -182,12 +182,25 @@
</xsl:template>
<xsl:template match="xsp:pi">
- xspCurrentNode.appendChild(
- document.createProcessingInstruction(
- "<xsl:value-of select="@target"/>",
- "<xsl:value-of select="."/>"
- )
- );
+ <!-- Appending to xspCurrentNode doesn't work for Cocoon PIs,
+ because Cocoon expects its PIs to be at the top level. -->
+ document.appendChild(
+ document.createProcessingInstruction(
+ "<xsl:value-of select="@target"/>",
+ <xsl:for-each select="xsp:text|xsp:expr">
+ <xsl:choose>
+ <xsl:when test="name(.) = 'xsp:text'">
+ "<xsl:value-of select="."/>"
+ </xsl:when>
+ <xsl:when test="name(.) = 'xsp:expr'">
+ String.valueOf(<xsl:value-of select="."/>)
+ </xsl:when>
+ </xsl:choose>
+ +
+ </xsl:for-each>
+ ""
+ )
+ );
</xsl:template>
<xsl:template match="xsp:comment">