Re: [xsl] Xalan won't accept QName in XPath node test

Subject: Re: [xsl] Xalan won't accept QName in XPath node test
From: Kim Thrysøe <kt@xxxxxxxx>
Date: Thu, 08 May 2003 08:35:04 +0200
Thank you for the suggestion, but it still gives me trouble -- I must be doing something else wrong. I have tried with numerous xalan versions -- "some old xalan with no version", the xalan distributed with jdk 1.4.1, and with xalan 2.5.0 -- the first two complain with the message javax.xml.transform.TransformerException: Extra illegal tokens: 'Article'.
Xalan 2.5.0 says "javax.xml.transform.TransformerException: A node test that matches either NCName:* or QName was expected."

Which XSLT engine did you get it to work with? Xalan/version?


Jim Fuller wrote:

u forgot to apply-templates

<?xml version="1.0"?>

<xsl:stylesheet xmlns:xsl="";
<xsl:template match="/">
</xsl:template> <xsl:template match="art:Article">Matched!</xsl:template>


<?xml version="1.0" ?>
<Article xmlns="/type/Article.xsd">

works for me.

good luck, jim fuller

-----Original Message----- From: Kim Thrysøe [mailto:kt@xxxxxxxx] Sent: 07 May 2003 15:24 To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx Subject: [xsl] Xalan won't accept QName in XPath node test

I hope one of you guys have seen before and can give me a hint as to what I am doing wrong. I cannot find anything pointing me to a solution either in this mailing list or elsewher.

Simple problem : Match an element in a default namespace from an XSL stylesheet.
Wrong solution: (My files are inlined below)
Declaring the same namespace as 'art' within the stylesheet and using the xpath expression "art:Article" to match <Article/> elements.

That does not work. XmlSpy / IE6 has no trouble stylesheeting the same files.

Am I doing something wrong or is Xalan doing something wrong?

Any help and hints greatly apprecieated.

*Source document* <Article xmlns="/type/Article.xsd"> <title>foo</title> <body>bar</body> </Article>

<xsl:stylesheet xmlns:xsl="";
   <xsl:template match="art:Article">Matched!</xsl:template>

Kim Thrysøe
22 48 61 54
96 35 61 00

XSL-List info and archive:

Current Thread