You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by xa...@xml.apache.org on 2004/09/07 15:41:38 UTC

[jira] Commented: (XALANJ-1923)

The following comment has been added to this issue:

     Author: Henry Zongaro
    Created: Tue, 7 Sep 2004 6:41 AM
       Body:
Hi, Dave.  Your last post points out some unfortunate use of terminology in the Namespaces in XML Recommendation.  It speaks both of situations in which there is no default namespace and situations in which the deault namespace is empty.  Section 5.2 [1] of that document has this to say:

  A default namespace is considered to apply to the element where it
  is declared (if that element has no namespace prefix), and to all
  elements with no prefix within the content of that element. If the
  URI reference in a default namespace declaration is empty, then
  unprefixed elements in the scope of the declaration are not
  considered to be in any namespace....  The default namespace can be
  set to the empty string. This has the same effect, within the scope
  of the declaration, of there being no default namespace. 

So for the following example, there is no default namespace on element A (as no xlmns attribute appears on that element or any of its ancestor elements), there is a default namespace of uri1 on element B, and the default namespace is empty on element C, which has the same effect as there being none.

<A><B xmlns="uri1"><C/></B></A>

[1] http://www.w3.org/TR/REC-xml-names/#defaulting
---------------------------------------------------------------------
View this comment:
  http://issues.apache.org/jira/browse/XALANJ-1923?page=comments#action_52919

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/XALANJ-1923

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: XALANJ-1923
    Summary: <xsl:namespace-alias stylesheet-prefix="foo" result-prefix="#default" />
       Type: Bug

     Status: Open

    Project: XalanJ2
 Components: 
             Xalan-interpretive transformation
   Versions:
             2.6

   Assignee: Yash Talwar
   Reporter: Galen Sampson

    Created: Sun, 15 Aug 2004 5:11 PM
    Updated: Tue, 7 Sep 2004 6:41 AM
Environment: Operating System: All
Platform: Other

Description:
This bug exists in the implementation shipped with the JWSDP-1.4:JAXP-1.2.6 on 
Sun's java xml site:
    http://java.sun.com/xml/jaxp/index.jsp

If the result-prefix is "#default" then the output should make the source
prefix's URI the outputs default namespace, removing any prefixes from nodes in
templates.  This is not the case.

See:
    http://www.w3.org/TR/xslt#literal-result-element

XSLT file "bug.xslt":
<?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:html="http://http://www.w3.org/1999/xhtml">
    <xsl:output method="xml" version="1.0" encoding="utf-8" indent="yes"
        doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
        doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" />
    <xsl:namespace-alias stylesheet-prefix="html" result-prefix="#default" />
    <xsl:strip-space elements="*" />
    <xsl:template match="/adoc">
        <html:html>
        <html:head>
            <html:title>
                A title
            </html:title>
        </html:head>
        <html:body>
            Some text
        </html:body>
        </html:html>
    </xsl:template>
</xsl:stylesheet>

Source Document "bug.xml":
<?xml version="1.0" ?>
<adoc />

Command:
    java org.apache.xalan.xslt.Process -IN bug.xml -XSL bug.xslt -OUT out.html
Produces:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html:html PUBLIC "-//W3C//DTD XHTML 1.0 
Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html:html>
<html:head>
<html:title>
                A title
            </html:title>
</html:head>
<html:body>
            Some text
        </html:body>
</html:html>

The output should be:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>
       A title
    </title>
  </head>
  <body>
     Some text
  </body>
</html>


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org