[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

AW: Selecting Nodes by nodeset comparison

Subject: AW: Selecting Nodes by nodeset comparison
From: <michella@xxxxxxx>
Date: Tue, 12 Apr 2005 14:36:37 +0200
AW:  Selecting Nodes by nodeset comparison
Here is a better explanation of my problematic :

XML1 :

<EintrdgeListe>
<Eintrag Datum="20050212" Zeit="0800"	Menge="64"/>
<Eintrag Datum="20050214" Zeit="0800" Menge="36"/>
<Eintrag Datum="20050214" Zeit="0800" Menge="22"/>
<Eintrag Datum="20050214" Zeit="0800" Menge="2"/>
</EintrdgeListe>


XML2 :

<EintrdgeListe>
<Eintrag BZ_Abgangsdatum="20050211" BZ_Zeit="0800" 	BZF_MengeGezdhlt="147"/>
<Eintrag BZ_Abgangsdatum="20050211" BZ_Zeit="0800"  BZF_MengeGezdhlt="50"/>
<Eintrag BZ_Abgangsdatum="20050212" BZ_Zeit="0800" 	BZF_MengeGezdhlt="49"/>
<Eintrag BZ_Abgangsdatum="20050213" BZ_Zeit="0800" 	BZF_MengeGezdhlt="37"/>
</EintrdgeListe>

-----------
Is the following Xpath correct?

<xsl:variable
	name="matching_XML1"
	select="$XML1/Eintrag[@Datum=XML2/Eintrag/@BZ_Abgangsdatum and
substring(@Zeit,1,2)=substring($XML2/Eintrag/@BZ_Zeit,1,2)]"
/>
... for each $matching_IT-Man, add a copy of those nodes to output....
--> Selected should be (from XML1):
<Eintrag Datum="20050212" Zeit="0800"	Menge="64"/>


THEN : (Same Xpath condition as  the first one, but with a negation not()

<xsl:variable
	name="NOT_matching_XML1"
	select="$XML1/Eintrag[not(@Datum=$XML2/Eintrag/@BZ_Abgangsdatum and
substring(@Zeit,1,2)=substring($XML2/Eintrag/@BZ_Zeit,1,2))]"
/>
... for each $NOT_matching_IT-Man,  add a copy of those nodes to output....
--> Selected should be (from XML1):
<Eintrag Datum="20050214" Zeit="0800" Menge="36"/>
<Eintrag Datum="20050214" Zeit="0800" Menge="22"/>
<Eintrag Datum="20050214" Zeit="0800" Menge="2"/>

----------------------
The final result shoud be the whole XML1 input data.

<Eintrag Datum="20050212" Zeit="0800"	Menge="64"/>
<Eintrag Datum="20050214" Zeit="0800" Menge="36"/>
<Eintrag Datum="20050214" Zeit="0800" Menge="22"/>
<Eintrag Datum="20050214" Zeit="0800" Menge="2"/>

I hope this help

Thanks for your help

Lawrence Michel

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.