1.1 --- a/XSLForms/XSL/FixNamespace.xsl Fri Jan 19 22:22:07 2007 +0000
1.2 +++ b/XSLForms/XSL/FixNamespace.xsl Fri Jan 19 22:22:28 2007 +0000
1.3 @@ -1,6 +1,6 @@
1.4 <?xml version="1.0"?>
1.5 <!--
1.6 -Copyright (C) 2006 Paul Boddie <paul@boddie.org.uk>
1.7 +Copyright (C) 2006, 2007 Paul Boddie <paul@boddie.org.uk>
1.8
1.9 This library is free software; you can redistribute it and/or
1.10 modify it under the terms of the GNU Lesser General Public
1.11 @@ -26,7 +26,8 @@
1.12
1.13 <xsl:output indent="yes"
1.14 doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
1.15 - doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
1.16 + doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
1.17 + method="xml"/>
1.18
1.19 <!-- Get all declared expr-prefix attributes. -->
1.20
1.21 @@ -38,8 +39,9 @@
1.22
1.23 <xsl:template match="/">
1.24 <xsl:for-each select="*">
1.25 - <!-- NOTE: Not stating the namespace explicitly. -->
1.26 + <!-- NOTE: Stating the namespace using an explicit xmlns attribute. -->
1.27 <xsl:element name="{name()}">
1.28 + <xsl:attribute name="xmlns"><xsl:value-of select="namespace-uri()"/></xsl:attribute>
1.29 <xsl:for-each select="$prefixes">
1.30 <xsl:attribute namespace="{substring-after(string(), ' ')}" name="{substring-before(string(), ' ')}:{name()}"><xsl:value-of select="string()"/></xsl:attribute>
1.31 </xsl:for-each>