473,473 Members | 1,733 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Intersecting Nodeset

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
Jul 20 '05 #1
1 1513
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

"Xeon" <xd*****@zworg.com> wrote in message
news:78*************************@posting.google.co m...
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

Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Brad | last post by:
Help, I have a really complicated XPATH request I can't wrap my head around I have an XML nodeset like this: <a> <a1 attr="key">Use</a1> <a1 attr="val">Value1</a2> </a> <a> <a1...
2
by: Bryan Galvin | last post by:
Hi all, I posted a message on this topic before, but now I have a request for help. Previously "A. Bolmarcich" answered this query for me, but the problem has changed slightly... I have two...
4
by: David Blickstein | last post by:
I have an application where I have a shared "method" of selecting a nodeset. The method currently is duplicated everywhere it is needed but I'd like that code to be shared. The method also...
1
by: Damien Goutte-Gattat | last post by:
I am using the .NET framework v2.0.40607 with Visual C# Express and I would like to create some custom XPath functions to use directly in a XSLT stylesheet. I called...
0
by: KathyB | last post by:
Hi, Using the following in an asp.net procedure. I get the error "The expression passed to this method should result in a NodeSet". Dim xDoc As New Document() The line causing the error is:...
0
by: Hoi-Polloi | last post by:
Hi all I want to use an xpath query to get a set of xmlNodePtr , but I don't want to keep the xmlXPathObject around. See the function below. I want to: * make xpath query and get an...
2
by: Yarik | last post by:
Hello, I am not sure the subject of my post adequately describes the problem I am trying to solve, so I think a specific example would be helpful. Let's say there are XML descriptions of...
14
by: eric.goforth | last post by:
Hello, Is there any way to directly access an element in a nodeset? For example, if working with: <blahs rec_count="16"> <blah> <yada>abc</yada> </blah>
4
by: Weston | last post by:
Are there any quick, reliable shortcuts to determine if two arbitrary XPath expressions yield result sets that intersect? The obviously way would be to iterate over the set of nodes from one...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.