Re: elements in a namespace

Subject: Re: elements in a namespace
From: Francis Norton <francis@xxxxxxxxxxx>
Date: Sun, 06 Jun 1999 23:21:56 +0100
<deepGroan/>

I can't believe I cut and pasted the wrong doc...

Here's the complete stylesheet:

<xsl:stylesheet indent-result="yes" default-space="strip" 
	xmlns="urn:myElements"
	xmlns:xsl="http://www.w3.org/XSL/Transform/1.0";>
	<xsl:template match="/Person">
		<xsl:for-each select="./Identity/Name">
			<xsl:value-of select="."/>
		</xsl:for-each>
	</xsl:template>
</xsl:stylesheet>

The line I referred to is the second line where we set the default
namespace to match that of the elements in the input doc. XML would not
see any unqualified element names to apply the default namespace to, but
XSL picks it up and applies it to unqualified element names in template
"select" and "match" attributes.

You can also use a namespace prefix, declared in the usual way, and
explicitly applied to the element names in the "select" and "match"
attributes.

Apologies for the excessive haste -

Francis.

Mike Brown wrote:
> 
> > Francis Norton wrote:
> > Try adding one line to your stylesheet ...
> >
> > <?xml version="1.0"?>
> > <Powers xmlns="urn:myElements">
> > [...]
> > ... works with XT.
> 
> Huh? That's the XML document, not the stylesheet. I think he was asking:
> What changes need to be made to the stylesheet (the XSL document) in order
> to access the source tree nodes that are defined, in the XML document, as
> being in this non-default namespace?
> 
> I need to do the same thing, so any further replies would be helpful..
> 

-- 
Francis Norton.

Air Rage - a "flight *and* fight" reaction?


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


Current Thread