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

Subject: RE: [xsl] Xalan won't accept QName in XPath node test
From: "Jim Fuller" <jim.fuller@xxxxxxxxxxxxxxxxxx>
Date: Wed, 7 May 2003 15:45:27 +0100
u forgot to apply-templates

<?xml version="1.0"?>

	<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
                xmlns:art="/type/Article.xsd"
                version="1.0">
                
    <xsl:template match="/">
    		<xsl:apply-templates/>
    </xsl:template> 
              
    <xsl:template match="art:Article">Matched!</xsl:template>
</xsl:stylesheet>

with

<?xml version="1.0" ?>
<Article xmlns="/type/Article.xsd">
    <title>foo</title>
    <body>bar</body>
</Article>

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>

*Stylesheet*
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
                xmlns:art="/type/Article.xsd"
                version="1.0">
    <xsl:template match="art:Article">Matched!</xsl:template>
</xsl:stylesheet>



-- 
 Kim Thrysøe
 kt@xxxxxxxx
 22 48 61 54
 96 35 61 00



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you are not the intended recipient please contact the sender immediately. Any disclosure, copying, distribution or any other use of this communication is strictly prohibitedand may be unlawful. Stuart Lawrence Marketing Communications Limited reserves the right to monitor and intercept communications for unlawful business purposes.

This also confirms that this message has been swept for viruses, although Stuart Lawrence Marketing Communications Limited accepts no responsibility for any loss or damage resulting directly or indirectly from the use of this email or contents.

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread