Hi Marc-Olivier,
thanks for pointing this out. I have taken a look into the XSLT spec and
you are certainly right, a zero length string is not an URI at all,
which is allowed as value of the namespace attribute.
This was earlier meant as a work-around for namespace problems for the
access of elements in variables using a different XSLT processor.
Nevertheless, the current version works fine with Apache Xalan, which is
being shipped together with OpenOffice / StarOffice to assure a
consistent behavior of the transformation even with JDK 1.3 and 1.5.
Therefore and due to my current commitment on other parts of OOo, I
believe the fix will come in a little later.
Could you please write me ('SUS') an issue with the target "OOo 2.0.1".
Simply paste your letter as issue description.
Thanks in advance,
Svante
Marc-Olivier Bernard wrote:
Hi Svante,
Trying to use sx2ml (from OO2Beta) with libxslt (http://xmlsoft.org/XSLT/)
I found out a problem with node-set, which is supported by libxslt, but
not with the empty namespaces as in:
openoffice.org1.9.95/share/xslt/export/common/styles/style_collector.xsl
<xsl:when test="office:document-content">
<xsl:element name="styles-file" namespace="">
^^^^^^^^^^^^
<xsl:copy-of select="document(concat($sourceBaseURL, 'styles.xml'))" />
</xsl:element>
<xsl:element name="meta-file" namespace="">
^^^^^^^^^^^^
<xsl:copy-of select="document(concat($sourceBaseURL, 'meta.xml'))" />
</xsl:element>
</xsl:when>
And libxslt miss to recover them with:
<xsl:copy-of select="$documentLinks/styles-file/*" />
Indeed, I tested with the following xslt file:
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0" xmlns:exslt="http://exslt.org/common" >
<xsl:template match="/">
<xsl:variable name="initial">
<xsl:element name="a">text</xsl:element>
<b/>
</xsl:variable>
<xsl:variable name="nodeset" select="exslt:node-set($initial)"/>
<out>
<xsl:copy-of select="$nodeset/a"/>
</out>
</xsl:template>
</xsl:stylesheet>
gives:
<?xml version="1.0"?>
<out xmlns:exslt="http://exslt.org/common"><a>text</a></out>
But modifying
<xsl:element name="a">text</xsl:element>
to
<xsl:element name="a" namespace="">text</xsl:element>
gives:
<?xml version="1.0"?>
<out xmlns:exslt="http://exslt.org/common"/>
Do you think that it is necessary to keep the empty namespace attribute in
the stylesheets?
Best regards,
--
Svante Schubert <svante.schubert@xxxxxxx> Sun Microsystems
Software Engineer - StarOffice Sachsenfeld 4
http://www.sun.com/staroffice 20097 Hamburg, Germany
|