You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Roland Zorn (JIRA)" <xa...@xml.apache.org> on 2004/12/08 08:41:09 UTC

[jira] Created: (XALANJ-2011) xmlns not resolved

xmlns not resolved
------------------

         Key: XALANJ-2011
         URL: http://nagoya.apache.org/jira/browse/XALANJ-2011
     Project: XalanJ2
        Type: Bug
  Components: Xalan  
    Versions: 2.6    
 Environment: xalan-j-2_6_0 with xerces-2_6_2
    Reporter: Roland Zorn


Hi,

see attached xls. I tried to create attribute with "namespace"-prefix xmlns. This results in error: prefix xmlns can't be resolved. But it's also not possible to use namespace-alias, cause defined by w3c ("The prefix xmlns is used only for namespace bindings and is not itself bound to any namespace name") xlmns has no URI.  So as xmlns is more a keyword than a prefix it must be work without namespace checking. This is for special functionality of xmlns and so I think a bug.

Thanks Roland

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

	<xsl:output method="xml" 
		version="1.0"
		encoding="UTF-16" 
		standalone="yes"
		indent="yes" 
	/>
		
	<xsl:template match="/">
		<xsl:element name="newDocWithNamepaceOfOldDoc">
			<xsl:for-each select="//namespace::*">
				<xsl:attribute name="{concat('xmlns:',name())}"> 
					<xsl:value-of select="." />
				</xsl:attribute> 
			</xsl:for-each>
		</xsl:element>
	</xsl:template>

</xsl:stylesheet>


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.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] Resolved: (XALANJ-2011) xmlns not resolved

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

    Resolution: Invalid

XSLT 1.0 doesn't permit a namespace declaration to be created by an xsl:attribute instruction.  From Section 7.1.3 of that document[1]

  XSLT processors may make use of the prefix of the
  QName specified in the name attribute when
  selecting the prefix used for outputting the
  created attribute as XML; however, they are not
  required to do so and, if the prefix is xmlns, they
  must not do so. Thus, although it is not an error
  to do:

  <xsl:attribute name="xmlns:xsl" namespace="whatever">http://www.w3.org/1999/XSL/Transform</xsl:attribute>

  it will not result in a namespace declaration being
  output.

In your example, you should be able to use xsl:copy to copy namespace declarations, as in the following:

  <xsl:template match="/">
  <xsl:element name="newDocWithNamepaceOfOldDoc">
  <xsl:for-each select="//namespace::*">
  <xsl:copy/>
  </xsl:for-each>
  </xsl:element>
  </xsl:template>

I don't know whether you have other scenarios in which that technique is insufficient.

[1] http://www.w3.org/TR/xslt#creating-attributes

> xmlns not resolved
> ------------------
>
>          Key: XALANJ-2011
>          URL: http://nagoya.apache.org/jira/browse/XALANJ-2011
>      Project: XalanJ2
>         Type: Bug
>   Components: Xalan
>     Versions: 2.6
>  Environment: xalan-j-2_6_0 with xerces-2_6_2
>     Reporter: Roland Zorn

>
> Hi,
> see attached xls. I tried to create attribute with "namespace"-prefix xmlns. This results in error: prefix xmlns can't be resolved. But it's also not possible to use namespace-alias, cause defined by w3c ("The prefix xmlns is used only for namespace bindings and is not itself bound to any namespace name") xlmns has no URI.  So as xmlns is more a keyword than a prefix it must be work without namespace checking. This is for special functionality of xmlns and so I think a bug.
> Thanks Roland
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> 	<xsl:output method="xml" 
> 		version="1.0"
> 		encoding="UTF-16" 
> 		standalone="yes"
> 		indent="yes" 
> 	/>
> 		
> 	<xsl:template match="/">
> 		<xsl:element name="newDocWithNamepaceOfOldDoc">
> 			<xsl:for-each select="//namespace::*">
> 				<xsl:attribute name="{concat('xmlns:',name())}"> 
> 					<xsl:value-of select="." />
> 				</xsl:attribute> 
> 			</xsl:for-each>
> 		</xsl:element>
> 	</xsl:template>
> </xsl:stylesheet>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.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-2011) xmlns not resolved

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

Brian Minchau updated XALANJ-2011:
----------------------------------

    Fix Version: 2.7

> xmlns not resolved
> ------------------
>
>          Key: XALANJ-2011
>          URL: http://issues.apache.org/jira/browse/XALANJ-2011
>      Project: XalanJ2
>         Type: Bug
>   Components: Xalan
>     Versions: 2.6
>  Environment: xalan-j-2_6_0 with xerces-2_6_2
>     Reporter: Roland Zorn
>      Fix For: 2.7

>
> Hi,
> see attached xls. I tried to create attribute with "namespace"-prefix xmlns. This results in error: prefix xmlns can't be resolved. But it's also not possible to use namespace-alias, cause defined by w3c ("The prefix xmlns is used only for namespace bindings and is not itself bound to any namespace name") xlmns has no URI.  So as xmlns is more a keyword than a prefix it must be work without namespace checking. This is for special functionality of xmlns and so I think a bug.
> Thanks Roland
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> 	<xsl:output method="xml" 
> 		version="1.0"
> 		encoding="UTF-16" 
> 		standalone="yes"
> 		indent="yes" 
> 	/>
> 		
> 	<xsl:template match="/">
> 		<xsl:element name="newDocWithNamepaceOfOldDoc">
> 			<xsl:for-each select="//namespace::*">
> 				<xsl:attribute name="{concat('xmlns:',name())}"> 
> 					<xsl:value-of select="." />
> 				</xsl:attribute> 
> 			</xsl:for-each>
> 		</xsl:element>
> 	</xsl:template>
> </xsl:stylesheet>

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