Issue 49392 - problem with namespace="" in sx2ml stylesheets
Summary: problem with namespace="" in sx2ml stylesheets
Status: CONFIRMED
Alias: None
Product: xml
Classification: Code
Component: external filters (show other issues)
Version: OOo 2.0 Beta
Hardware: All All
: P3 Trivial (vote)
Target Milestone: AOO Later
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-17 15:21 UTC by mobouille
Modified: 2013-02-07 21:53 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description mobouille 2005-05-17 15:21:34 UTC
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,
                                                                               
                                           
--
Marc-Olivier BERNARD
Comment 1 svante.schubert 2005-05-17 16:04:21 UTC
Confirming this issue, after review of current issue got to select target OOo 2.0.2
Comment 2 svante.schubert 2005-05-17 16:33:06 UTC
The following should be fixed along:


>
>3. in export/common/body.xsl:
>
><xsl:template name="encode-string">
>(...)
>
><xsl:otherwise>
>  <xsl:message terminate="no">ERROR: Function not found:
java:java.net.URLEncoder.encode</xsl:message>
>  <xsl:value-of select="$textToBeEncoded"/>
></xsl:otherwise>
>
>Thus terminate="no" instead of "yes" and add <xsl:value-of 
>select="$textToBeEncoded"/>
>
>I suppose that incoming XML is UTF-8.
>
Yes, but not the character encoding was meant, more the string encoding.
Used for referencing child documents from the content table of a master document
by URLs.
You won't need it, as the transformation of  master documents would work only
with Java and is not supported anyway.

I will add your proposed change (of 3.) to the exisiting issue and will enhance
the comment of

<xsl:template name="encode-string"> as well.

Comment 3 svante.schubert 2005-11-14 12:49:31 UTC
Due to heavy workload the work on the XHTML sample filter had to be downgraded
in priority.
Comment 4 inlawcada 2010-11-10 21:19:08 UTC
Created attachment 73647