You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by mi...@apache.org on 2003/11/05 00:01:23 UTC
cvs commit: cocoon-lenya/src/webapp/lenya/xslt/authoring/edit form.xsl
michi 2003/11/04 15:01:22
Modified: src/webapp/lenya/xslt/authoring/edit form.xsl
Log:
xalan-2.5.1 workaround
Revision Changes Path
1.8 +48 -1 cocoon-lenya/src/webapp/lenya/xslt/authoring/edit/form.xsl
Index: form.xsl
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/webapp/lenya/xslt/authoring/edit/form.xsl,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- form.xsl 3 Nov 2003 21:09:07 -0000 1.7
+++ form.xsl 4 Nov 2003 23:01:22 -0000 1.8
@@ -8,6 +8,7 @@
<xsl:param name="form"/>
<xsl:param name="message"/>
+
<xsl:template match="/">
<html>
<body>
@@ -48,9 +49,55 @@
</xsl:template>
<!-- Copy mixed content -->
+<!-- also see oneform.xsl -->
+<!--
<xsl:include href="copy-mixed-content.xsl"/>
-<!-- also see oneform.xsl -->
+-->
+<xsl:template match="//*" mode="mixedcontent">
+<xsl:variable name="prefix"><xsl:if test="contains(name(),':')">:<xsl:value-of select="substring-before(name(),':')"/></xsl:if></xsl:variable>
+
+<xsl:choose>
+<xsl:when test="node()">
+<xsl:text><</xsl:text><xsl:value-of select="name()"/>
+
+<xsl:apply-templates select="@*[local-name()!='tagID']" mode="mixedcontent"/>
+
+<xsl:for-each select="namespace::*">
+<xsl:variable name="prefix"><xsl:if test="local-name() != ''">:<xsl:value-of select="local-name()"/></xsl:if></xsl:variable>
+<xsl:if test=". != 'http://www.w3.org/XML/1998/namespace'">
+<xsl:text> </xsl:text>xmlns<xsl:value-of select="$prefix"/>="<xsl:value-of select="."/><xsl:text>"</xsl:text>
+</xsl:if>
+</xsl:for-each>
+
+<xsl:text>></xsl:text>
+
+<xsl:apply-templates select="node()" mode="mixedcontent"/>
+
+<xsl:text></</xsl:text><xsl:value-of select="name()"/><xsl:text>></xsl:text>
+
+</xsl:when>
+
+<xsl:otherwise>
+
+<xsl:text><</xsl:text><xsl:value-of select="name()"/>
+
+<xsl:apply-templates select="@*[local-name()!='tagID']" mode="mixedcontent"/>
+
+<xsl:for-each select="namespace::*">
+<xsl:variable name="prefix"><xsl:if test="local-name() != ''">:<xsl:value-of select="local-name()"/></xsl:if></xsl:variable>
+<xsl:if test=". != 'http://www.w3.org/XML/1998/namespace'">
+<xsl:text> </xsl:text>xmlns<xsl:value-of select="$prefix"/>="<xsl:value-of select="."/><xsl:text>"</xsl:text>
+</xsl:if>
+</xsl:for-each>
+
+<xsl:text>/></xsl:text></xsl:otherwise>
+</xsl:choose>
+</xsl:template>
+
+<xsl:template match="@*" mode="mixedcontent"><xsl:text> </xsl:text><xsl:value-of select="name()"/>="<xsl:value-of select="."/>"</xsl:template>
+
+
<!-- FIXME: namespaces occur multiple times, e.g. xlink:show="" xlink:href="" xmlns:xlink="" xmlns:xlink="" -->
<!--
---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-cvs-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-cvs-help@cocoon.apache.org