RE: [xsl] Unique local-name()

Subject: RE: [xsl] Unique local-name()
From: "Dion Houston" <dionh@xxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 22 Feb 2003 21:10:12 -0800
Hi Niklas:

I don't think you'll find any context free, Xpath only method of doing
this.  Reason why is because the current() function always takes you out
to the current node.

For an XSLT solution, here's what I recommend:

<xsl:stylesheet xmlns:xsl="";
	<xsl:key match="/root/*" use="local-name()" name="local-name"/>
	<xsl:template match="root">

This is simply does a key on the local name of all children of root, and
copies a node if there is no second node with the same name.  If you
want to do any more processing on the node, simply apply-templates
instead of copy-of.



-----Original Message-----
From: Niklas Gustavsson [mailto:niklas@xxxxxxxxxxxxx] 
Sent: Saturday, February 22, 2003 6:29 PM
To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx

Hi all,

I'm really stuck on a XPpath problem that should be fairly simple (I
think): I need to check if an element that got a unique local-name()
among it's siblings. And, I have no way of actually knowing the
local-name() when I generate the XPath.

For example:
	<a />
	<b />
	<b />
	<c />
	<c />
	<d />

a and d should pass, the b's and c's shouldn't

If my question isn't clear enough I try to clarify my problem some more


 XSL-List info and archive:

 XSL-List info and archive:

Current Thread