Re: Templates aplied to namespaces

Subject: Re: Templates aplied to namespaces
From: "Mark D. Anderson" <mda@xxxxxxxxxxxxxx>
Date: Sun, 19 Dec 1999 12:37:20 -0800
i'm doing exactly this, successfully, so it must be some small
detail. 

in this case, it'd be something like this:
<xsl:stylesheet 
		version="1.0" 
		xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
        xmlns:whatever="http://www.somewhere.com/mynamespace";
        exclude-result-prefixes="whatever"
>
<xsl:template match="//whatever:title">
....

xsl has no way to separately specify a default input and output
namespace, which is a bit of a pain. so if your result namespace
is not also "whatever", you end up having to have explicit
prefixes for all your select expressions, as shown above.

if your result namespace *is* the same (and not html or
something) then specifying xmlns="http://www.somewhere.com/mynamespace";
in the xsl:stylesheet, and not using any prefixes should also 
work.

but you have to do something -- xsl is very much namespace aware
and that element that looks like "title" isn't really....

-mda


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


Current Thread