[xsl] match + default namespace

Subject: [xsl] match + default namespace
From: philippe drix <phdrix@xxxxxxx>
Date: Fri, 16 Nov 2001 16:03:22 +0100
Sorry if my question is FAQ, but I found nothing in the archive.

I have a small xml file, like this :

  <table xmlns="http://abcd"; border="1" bgcolor="#E0E0E0">
	 <caption align="right" class="listingTitle">bar.java</caption>
			<pre class="programlisting">
import java.io.*;
public class bar {

I want to write a XSL Transformation, with a rule matching <pre> like
this :

    <xsl:template match="pre[@class='programlisting']">
    	<pre class="programlisting">
    	     <xsl:call-template name="replace_first_tabs_on_all_lines">
			<xsl:with-param name="codeSource" select="." />
and a another rule like this :

    <xsl:template match="*">
			<xsl:apply-templates select="@*"/>
The problem is that the pattern "pre[@class='programlisting']" never
matches the tag <pre>.

Why ? Because it is too much selective. Even if I relax it, like that :
match="pre", it is still too selective.
To get the match, I must write : match="*[name() = 'pre']".

So, match="pre" is not the same than match="*[name() = 'pre']"
Actually, this oddity disappears if I suppress the default namespace
declared with the <table> element.

Why ? This time, I have not really the true answer ...

Any idea ?

Best regards,
Philippe Drix

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

Current Thread