You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by "Dale F. McIntosh" <dm...@forwardslope.com> on 2004/12/06 10:07:22 UTC

A node test that matches either NCName:* or QName was expected

I have a stylesheet that begins with:

 

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema">
  <xsl:template match="z:row">

 ...

 </xsl:template>
</xsl:stylesheet>

The stylesheet performs a transformation on a Microsoft ADO rowset. When
I use the Xalan 2.2.D11, or Saxon 6.5.3, the transformation is
successful. However when I use Xalan 2.6.0, I get the following
exception: javax.xml.transform.TransformerConfigurationException:
javax.xml.transform.TransformerException:
javax.xml.transform.TransformerException: A node test that matches
either NCName:* or QName was expected.

 

This exception occurs when the Transformer is being instantiated from
the Factory, prior to document transformation. If I remove the z:
namespace reference from the <xsl:template match="z:row">, the
Transformer is instantiated , but of course, doesn't perform the desired
transformation.

 

Any help would be appreciated.

 

    Thanks,

    Dale McIntosh

 

 


Re: A node test that matches either NCName:* or QName was expected

Posted by Henry Zongaro <zo...@ca.ibm.com>.
Hi, Dale.

> I have a stylesheet that begins with:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform
> " xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:rs="urn:
> schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema">
>   <xsl:template match="z:row">
>  ...
>  </xsl:template>
> </xsl:stylesheet>
> The stylesheet performs a transformation on a Microsoft ADO rowset. 
> When I use the Xalan 2.2.D11, or Saxon 6.5.3, the transformation is 
> successful. However when I use Xalan 2.6.0, I get the following 
exception: 
> javax.xml.transform.TransformerConfigurationException: javax.xml.
> transform.TransformerException: javax.xml.transform.
> TransformerException: A node test that matches either NCName:* or 
> QName was expected.

     It looks like Xalan-J Interpretive is somehow getting confused by the 
fragment identifier in the namespace declaration.  As a work-around, would 
it possible for you to use an absolute URI rather than a relative URI 
reference?  While your example ought to work, the use of relative URI 
references in namespace declarations is deprecated.[1]

     In the meanwhile, please open a bug report against Xalan-J in 
Jira.[2]

Thanks,

Henry
[1] http://www.w3.org/XML/xml-names-19990114-errata#NE04
[2] http://issues.apache.org/jira
------------------------------------------------------------------
Henry Zongaro      Xalan development
IBM SWS Toronto Lab   T/L 969-6044;  Phone +1 905 413-6044
mailto:zongaro@ca.ibm.com