RE: [xsl] Default Namespace version problem

Subject: RE: [xsl] Default Namespace version problem
From: "Michael Leditschke" <mike@xxxxxxxxxxx>
Date: Thu, 5 Dec 2002 14:11:52 +1100
> The reason that this is the case is if I set the default namespace to v2 
> then the stlyesheet won't transform the XML documents correctly (the output consists of just the text within the 
> elements, and nothing else). 

This behaviour suggests the inbuilt rules are coming into play, and
none of your templates are being invoked. Its important to remember
that default namespaces are ignored in the rules for patterns and
XPath expressions.


If you are attempting to match elements in your source XML that 
are in a particular namespace, you'll need to declare that namespace 
in your stylesheet and use it in the template rules e.g.

<xsl:template match="v1:someelement">

where you've declared v1 previously in the stylesheet, typically
on the stylesheet element, as

xmlns:v1="http://www.blah.com/test/v1";

To avoid having a declaration for v1 appearing in your stylesheet,
check out the exclude-result-prefixes attribute of the stylesheet
element.


Regards
Michael


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


Current Thread