Intersecting Nodeset

X

Xeon

Hi,

I got a XML data node like this :

<item firstkey="01" secondkey="02"/>

I setup 2 lookup tables by :

<xsl:key name="key1" match="item" use="@firstkey"/>
<xsl:key name="key2" match="item" use="@secondkey"/>

Now, I need to extract nodes with specific @firstkey & @seconkey. So
how do I do this intersecting nodes extraction? or do I have to
concede to using :

key('key1', $somekey)[@secondkey = $someotherkey]

Any help appreciated
TIA
 
D

Dimitre Novatchev

Solution 1:
Define the following:

<xsl:key name="k1-2" match="item" use="concat(@firstkey, '|',
@secondkey)"/>

Then all "item" elements that have specific values for their "firstkey" and
"secondkey" attributes will be selected by:

key('k1-2', concat($somekey, '|', $someotherkey))


Solution2:

key('key1', $somekey)
[count(. | key('key2', $someotherkey))
=
count(key('key2', $someotherkey))
]


=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top