You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Benjamin (JIRA)" <xa...@xml.apache.org> on 2005/03/02 09:58:52 UTC

[jira] Created: (XALANJ-2069) XSLTC produces incorrect output for multiple default namespaces

XSLTC produces incorrect output for multiple default namespaces
---------------------------------------------------------------

         Key: XALANJ-2069
         URL: http://issues.apache.org/jira/browse/XALANJ-2069
     Project: XalanJ2
        Type: Bug
  Components: XSLTC  
    Versions: 2.6    
 Environment: Windows XP, J2SE 1.5.0 default SDK install, Eclipse 1.0.1 defualt install. JAXP interface
    Reporter: Benjamin


Input template:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
<core:Display
	xmlns:core="http://example.com/core"
	xmlns:foo="http://example.com/java/foo"
	>
	<core:Styles xmlns="http://example.com/java/foo">
		<Constant/>
	</core:Styles>
	<core:View xmlns="http://example.com/java/javax.swing">
		<!-- workaround for buggy(?) XSLT processor.-->
		<!--This should work:-->
		<foo:Constant/>
		<!--Workaround is:-->
		<!--xsl:element
			namespace="http://example.com/java/foo"
			name="Constant"
			/-->
	</core:View>
</core:Display>
</xsl:template>
</xsl:stylesheet>

Input document:
<doc/>

Expected result:
<?xml version="1.0" encoding="UTF-8"?>
<core:Display xmlns:core="http://example.com/core"
xmlns:foo="http://example.com/java/foo">
<core:Styles xmlns="http://example.com/java/foo">
<Constant/>
</core:Styles>
<core:View xmlns="http://example.com/java/javax.swing">
<foo:Constant/>
</core:View>
</core:Display>

Actual result:
<?xml version="1.0" encoding="UTF-8"?>
<core:Display xmlns:core="http://example.com/core"
xmlns:foo="http://example.com/java/foo">
<core:Styles xmlns="http://example.com/java/foo">
<Constant/>
</core:Styles>
<core:View xmlns="http://example.com/java/javax.swing">
<Constant/>
</core:View>
</core:Display>

(Note second Constant tag is missing namespace prefix)

The error only occurs when a node is defined when its namespace was the default,
then later the same node is defined when its namespace is no longer the default.
The lack of prefix the second time around means it goes into the new (now
incorrect) default namespace. This example is a cut-down version of working
software.

I'm fairly new to the Java sphere, so am not 100% sure of version numbers. I'm
running Eclipse 3.0 and the 1.5.0 Java SDK and am using whatever the combination
of these two forces brings in by default. The classes that get instantiated
appear to be XSLTC-related, and I'm using the JAXP interface. My code looks
something like this:

DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(true);
DocumentBuilder parser = factory.newDocumentBuilder();
Document template = parser.parse("transform.xsl");
Document instance = parser.parse("doc.xsli");
Document result = parser.newDocument();
TransformerFactory factory = TransformerFactory.newInstance();
Transformer transform = factory.newTransformer(new DOMSource(template));
DOMResult doc = new DOMResult(result);
transform.transform(new DOMSource(instance), doc);

This is the same bug as the misfiled Bug 33783. This may be a duplicate of XALANJ-2032, but is probably an escilation since actual incorrect output is produced.

Benjamin.

-- 
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


[jira] Updated: (XALANJ-2069) XSLTC produces incorrect output for multiple default namespaces

Posted by "Brian Minchau (JIRA)" <xa...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XALANJ-2069?page=all ]

Brian Minchau updated XALANJ-2069:
----------------------------------

    Fix Version: 2.7

> XSLTC produces incorrect output for multiple default namespaces
> ---------------------------------------------------------------
>
>          Key: XALANJ-2069
>          URL: http://issues.apache.org/jira/browse/XALANJ-2069
>      Project: XalanJ2
>         Type: Bug
>   Components: XSLTC
>     Versions: 2.6
>  Environment: Windows XP, J2SE 1.5.0 default SDK install, Eclipse 1.0.1 defualt install. JAXP interface
>     Reporter: Benjamin
>     Assignee: Henry Zongaro
>      Fix For: 2.7

>
> Input template:
> <?xml version="1.0" encoding="utf-8"?>
> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xsl:template match="/">
> <core:Display
> 	xmlns:core="http://example.com/core"
> 	xmlns:foo="http://example.com/java/foo"
> 	>
> 	<core:Styles xmlns="http://example.com/java/foo">
> 		<Constant/>
> 	</core:Styles>
> 	<core:View xmlns="http://example.com/java/javax.swing">
> 		<!-- workaround for buggy(?) XSLT processor.-->
> 		<!--This should work:-->
> 		<foo:Constant/>
> 		<!--Workaround is:-->
> 		<!--xsl:element
> 			namespace="http://example.com/java/foo"
> 			name="Constant"
> 			/-->
> 	</core:View>
> </core:Display>
> </xsl:template>
> </xsl:stylesheet>
> Input document:
> <doc/>
> Expected result:
> <?xml version="1.0" encoding="UTF-8"?>
> <core:Display xmlns:core="http://example.com/core"
> xmlns:foo="http://example.com/java/foo">
> <core:Styles xmlns="http://example.com/java/foo">
> <Constant/>
> </core:Styles>
> <core:View xmlns="http://example.com/java/javax.swing">
> <foo:Constant/>
> </core:View>
> </core:Display>
> Actual result:
> <?xml version="1.0" encoding="UTF-8"?>
> <core:Display xmlns:core="http://example.com/core"
> xmlns:foo="http://example.com/java/foo">
> <core:Styles xmlns="http://example.com/java/foo">
> <Constant/>
> </core:Styles>
> <core:View xmlns="http://example.com/java/javax.swing">
> <Constant/>
> </core:View>
> </core:Display>
> (Note second Constant tag is missing namespace prefix)
> The error only occurs when a node is defined when its namespace was the default,
> then later the same node is defined when its namespace is no longer the default.
> The lack of prefix the second time around means it goes into the new (now
> incorrect) default namespace. This example is a cut-down version of working
> software.
> I'm fairly new to the Java sphere, so am not 100% sure of version numbers. I'm
> running Eclipse 3.0 and the 1.5.0 Java SDK and am using whatever the combination
> of these two forces brings in by default. The classes that get instantiated
> appear to be XSLTC-related, and I'm using the JAXP interface. My code looks
> something like this:
> DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
> factory.setNamespaceAware(true);
> DocumentBuilder parser = factory.newDocumentBuilder();
> Document template = parser.parse("transform.xsl");
> Document instance = parser.parse("doc.xsli");
> Document result = parser.newDocument();
> TransformerFactory factory = TransformerFactory.newInstance();
> Transformer transform = factory.newTransformer(new DOMSource(template));
> DOMResult doc = new DOMResult(result);
> transform.transform(new DOMSource(instance), doc);
> This is the same bug as the misfiled Bug 33783. This may be a duplicate of XALANJ-2032, but is probably an escilation since actual incorrect output is produced.
> Benjamin.

-- 
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
-
For more information on JIRA, 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


[jira] Resolved: (XALANJ-2069) XSLTC produces incorrect output for multiple default namespaces

Posted by "Henry Zongaro (JIRA)" <xa...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XALANJ-2069?page=all ]
     
Henry Zongaro resolved XALANJ-2069:
-----------------------------------

    Resolution: Duplicate

I've confirmed that this is a duplicate of XALANJ-2032.

> XSLTC produces incorrect output for multiple default namespaces
> ---------------------------------------------------------------
>
>          Key: XALANJ-2069
>          URL: http://issues.apache.org/jira/browse/XALANJ-2069
>      Project: XalanJ2
>         Type: Bug
>   Components: XSLTC
>     Versions: 2.6
>  Environment: Windows XP, J2SE 1.5.0 default SDK install, Eclipse 1.0.1 defualt install. JAXP interface
>     Reporter: Benjamin
>     Assignee: Henry Zongaro

>
> Input template:
> <?xml version="1.0" encoding="utf-8"?>
> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xsl:template match="/">
> <core:Display
> 	xmlns:core="http://example.com/core"
> 	xmlns:foo="http://example.com/java/foo"
> 	>
> 	<core:Styles xmlns="http://example.com/java/foo">
> 		<Constant/>
> 	</core:Styles>
> 	<core:View xmlns="http://example.com/java/javax.swing">
> 		<!-- workaround for buggy(?) XSLT processor.-->
> 		<!--This should work:-->
> 		<foo:Constant/>
> 		<!--Workaround is:-->
> 		<!--xsl:element
> 			namespace="http://example.com/java/foo"
> 			name="Constant"
> 			/-->
> 	</core:View>
> </core:Display>
> </xsl:template>
> </xsl:stylesheet>
> Input document:
> <doc/>
> Expected result:
> <?xml version="1.0" encoding="UTF-8"?>
> <core:Display xmlns:core="http://example.com/core"
> xmlns:foo="http://example.com/java/foo">
> <core:Styles xmlns="http://example.com/java/foo">
> <Constant/>
> </core:Styles>
> <core:View xmlns="http://example.com/java/javax.swing">
> <foo:Constant/>
> </core:View>
> </core:Display>
> Actual result:
> <?xml version="1.0" encoding="UTF-8"?>
> <core:Display xmlns:core="http://example.com/core"
> xmlns:foo="http://example.com/java/foo">
> <core:Styles xmlns="http://example.com/java/foo">
> <Constant/>
> </core:Styles>
> <core:View xmlns="http://example.com/java/javax.swing">
> <Constant/>
> </core:View>
> </core:Display>
> (Note second Constant tag is missing namespace prefix)
> The error only occurs when a node is defined when its namespace was the default,
> then later the same node is defined when its namespace is no longer the default.
> The lack of prefix the second time around means it goes into the new (now
> incorrect) default namespace. This example is a cut-down version of working
> software.
> I'm fairly new to the Java sphere, so am not 100% sure of version numbers. I'm
> running Eclipse 3.0 and the 1.5.0 Java SDK and am using whatever the combination
> of these two forces brings in by default. The classes that get instantiated
> appear to be XSLTC-related, and I'm using the JAXP interface. My code looks
> something like this:
> DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
> factory.setNamespaceAware(true);
> DocumentBuilder parser = factory.newDocumentBuilder();
> Document template = parser.parse("transform.xsl");
> Document instance = parser.parse("doc.xsli");
> Document result = parser.newDocument();
> TransformerFactory factory = TransformerFactory.newInstance();
> Transformer transform = factory.newTransformer(new DOMSource(template));
> DOMResult doc = new DOMResult(result);
> transform.transform(new DOMSource(instance), doc);
> This is the same bug as the misfiled Bug 33783. This may be a duplicate of XALANJ-2032, but is probably an escilation since actual incorrect output is produced.
> Benjamin.

-- 
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
-
For more information on JIRA, 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


[jira] Assigned: (XALANJ-2069) XSLTC produces incorrect output for multiple default namespaces

Posted by "Brian Minchau (JIRA)" <xa...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XALANJ-2069?page=history ]

Brian Minchau reassigned XALANJ-2069:
-------------------------------------

    Assign To: Henry Zongaro

Assigning to Henry Z. per the Xalan JIRA meeting April 5, 2005.

Dave Marston thinks there may already be testcases on Apache that should have detected this.

> XSLTC produces incorrect output for multiple default namespaces
> ---------------------------------------------------------------
>
>          Key: XALANJ-2069
>          URL: http://issues.apache.org/jira/browse/XALANJ-2069
>      Project: XalanJ2
>         Type: Bug
>   Components: XSLTC
>     Versions: 2.6
>  Environment: Windows XP, J2SE 1.5.0 default SDK install, Eclipse 1.0.1 defualt install. JAXP interface
>     Reporter: Benjamin
>     Assignee: Henry Zongaro

>
> Input template:
> <?xml version="1.0" encoding="utf-8"?>
> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xsl:template match="/">
> <core:Display
> 	xmlns:core="http://example.com/core"
> 	xmlns:foo="http://example.com/java/foo"
> 	>
> 	<core:Styles xmlns="http://example.com/java/foo">
> 		<Constant/>
> 	</core:Styles>
> 	<core:View xmlns="http://example.com/java/javax.swing">
> 		<!-- workaround for buggy(?) XSLT processor.-->
> 		<!--This should work:-->
> 		<foo:Constant/>
> 		<!--Workaround is:-->
> 		<!--xsl:element
> 			namespace="http://example.com/java/foo"
> 			name="Constant"
> 			/-->
> 	</core:View>
> </core:Display>
> </xsl:template>
> </xsl:stylesheet>
> Input document:
> <doc/>
> Expected result:
> <?xml version="1.0" encoding="UTF-8"?>
> <core:Display xmlns:core="http://example.com/core"
> xmlns:foo="http://example.com/java/foo">
> <core:Styles xmlns="http://example.com/java/foo">
> <Constant/>
> </core:Styles>
> <core:View xmlns="http://example.com/java/javax.swing">
> <foo:Constant/>
> </core:View>
> </core:Display>
> Actual result:
> <?xml version="1.0" encoding="UTF-8"?>
> <core:Display xmlns:core="http://example.com/core"
> xmlns:foo="http://example.com/java/foo">
> <core:Styles xmlns="http://example.com/java/foo">
> <Constant/>
> </core:Styles>
> <core:View xmlns="http://example.com/java/javax.swing">
> <Constant/>
> </core:View>
> </core:Display>
> (Note second Constant tag is missing namespace prefix)
> The error only occurs when a node is defined when its namespace was the default,
> then later the same node is defined when its namespace is no longer the default.
> The lack of prefix the second time around means it goes into the new (now
> incorrect) default namespace. This example is a cut-down version of working
> software.
> I'm fairly new to the Java sphere, so am not 100% sure of version numbers. I'm
> running Eclipse 3.0 and the 1.5.0 Java SDK and am using whatever the combination
> of these two forces brings in by default. The classes that get instantiated
> appear to be XSLTC-related, and I'm using the JAXP interface. My code looks
> something like this:
> DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
> factory.setNamespaceAware(true);
> DocumentBuilder parser = factory.newDocumentBuilder();
> Document template = parser.parse("transform.xsl");
> Document instance = parser.parse("doc.xsli");
> Document result = parser.newDocument();
> TransformerFactory factory = TransformerFactory.newInstance();
> Transformer transform = factory.newTransformer(new DOMSource(template));
> DOMResult doc = new DOMResult(result);
> transform.transform(new DOMSource(instance), doc);
> This is the same bug as the misfiled Bug 33783. This may be a duplicate of XALANJ-2032, but is probably an escilation since actual incorrect output is produced.
> Benjamin.

-- 
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