Meta-stylesheet EXSLT namespace problem
Jernej Tuljak <[email protected]> Sun, 12 Feb 2012 10:45:46 +0100
| Newsgroups | gmane.text.xml.xalan.java.user |
|---|---|
| Message-ID | <CAHK=sTiypPF5_1TSD1vQJrsPshgD=f4p8qdwsLn-4PEm-_L30Q@mail.gmail.com> |
--20cf3074b9a4e07b3e04b8c13940
Content-Type: text/plain; charset=ISO-8859-1
Hi! I am having difficulties running this meta-stylesheet:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:axsl="http://www.w3.org/1999/XSL/TransformAlias"
xmlns:exsl="http://exslt.org/common"
extension-element-prefixes="exsl">
<xsl:output method="xml" omit-xml-declaration="yes" />
<xsl:strip-space elements="*"/>
<xsl:namespace-alias stylesheet-prefix="axsl" result-prefix="xsl"/>
<xsl:template match="/">
<xsl:call-template name="disappearance-act" />
</xsl:template>
<xsl:template name="disappearance-act">
<axsl:stylesheet
xmlns:exsl="http://exslt.org/common"
extension-element-prefixes="exsl" >
<xsl:attribute name="version">1.0</xsl:attribute>
</axsl:stylesheet>
</xsl:template>
</xsl:stylesheet>
It outputs this:
<axsl:stylesheet xmlns:axsl="http://www.w3.org/1999/XSL/Transform"
version="1.0" extension-element-prefixes="exsl"/>
As you can see the exsl namespace in the generated stylesheet is simply
gobbled up. The problem is easily solved by removing that namespace from
the root stylesheet (or to put it in another way, move all EXSLT stuff to
an external stylesheet and then include it). But I would like to know what
causes the namespace to disappear. Afterall one should be able to use EXSLT
in both the meta-stylesheet and in the generated stylesheet without having
to use two separate stylesheets, right?
Using xalan-j_2_7_1 (xalan.jar) with java 1.6. Saxon 6.5.5 also suffers
from this problem so it might be a XSLT 1.0 limitation I'm not aware of.
Searching this mailing list did not help me find an answer. Also this is my
first time using _any_ mailing list, so please be gentle if I'm doing it
wrong.
Thanks, Jernej
--20cf3074b9a4e07b3e04b8c13940
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Hi! I am having difficulties running this meta-stylesheet:<br><br><xsl:s=
tylesheet version=3D"1.0"<br>=A0xmlns:xsl=3D"<a href=3D"http=
://www.w3.org/1999/XSL/Transform">http://www.w3.org/1999/XSL/Transform</a>&=
quot;<br>
=A0xmlns:axsl=3D"<a href=3D"http://www.w3.org/1999/XSL/TransformAlias"=
>http://www.w3.org/1999/XSL/TransformAlias</a>"<br>=A0xmlns:exsl=3D&qu=
ot;<a href=3D"http://exslt.org/common">http://exslt.org/common</a>"<br=
>=A0extension-element-prefixes=3D"exsl"><br>
=A0=A0=A0 <xsl:output method=3D"xml" omit-xml-declaration=3D&q=
uot;yes" /><br>=A0=A0=A0 <xsl:strip-space elements=3D"*&quo=
t;/><br>=A0=A0=A0 <xsl:namespace-alias stylesheet-prefix=3D"axsl=
" result-prefix=3D"xsl"/><br>
<br>=A0=A0=A0 <xsl:template match=3D"/"><br>=A0=A0=A0=A0=A0=
=A0=A0 <xsl:call-template name=3D"disappearance-act" /><br>=
=A0=A0=A0 </xsl:template><br>=A0<br>=A0=A0=A0 <xsl:template name=
=3D"disappearance-act"><br>
=A0=A0=A0=A0=A0=A0=A0 <axsl:stylesheet<br>=A0=A0=A0 =A0=A0=A0 xmlns:exsl=
=3D"<a href=3D"http://exslt.org/common">http://exslt.org/common</a>&qu=
ot;<br>=A0=A0 =A0=A0=A0 =A0=A0=A0 extension-element-prefixes=3D"exsl&q=
uot; ><br>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <xsl:attribute name=3D&qu=
ot;version">1.0</xsl:attribute><br>
=A0=A0=A0=A0=A0=A0=A0 </axsl:stylesheet><br>=A0=A0=A0 </xsl:templa=
te><br></xsl:stylesheet><br><br>It outputs this:<br><br><axsl:s=
tylesheet xmlns:axsl=3D"<a href=3D"http://www.w3.org/1999/XSL/Transfor=
m">http://www.w3.org/1999/XSL/Transform</a>" version=3D"1.0"=
extension-element-prefixes=3D"exsl"/><br>
<br>As you can see the exsl namespace in the generated stylesheet is simply=
gobbled up. The problem is easily solved by removing that namespace from t=
he root stylesheet (or to put it in another way, move all EXSLT stuff to an=
external stylesheet and then include it). But I would like to know what ca=
uses the namespace to disappear. Afterall one should be able to use EXSLT i=
n both the meta-stylesheet and in the generated stylesheet without having t=
o use two separate stylesheets, right?<br>
<br>Using xalan-j_2_7_1 (xalan.jar) with java 1.6. Saxon 6.5.5 also suffers=
from this problem so it might be a XSLT 1.0 limitation I'm not aware o=
f. Searching this mailing list did not help me find an answer. Also this is=
my first time using _any_ mailing list, so please be gentle if I'm doi=
ng it wrong.<br>
<br>Thanks, Jernej<br>
--20cf3074b9a4e07b3e04b8c13940--