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

Selecting Nodes by nodeset comparison

Subject: Selecting Nodes by nodeset comparison
From: <michella@xxxxxxx>
Date: Tue, 12 Apr 2005 13:38:00 +0200
xpath condition
Hello,

Unfortunately, I have a newbie question.

Given two xml data.
Each contain the same data structure.
I would like to select nodes from both of them which might fit an Xpath
condition (some attributes from xml1/nodes should be equal to attributes from
xml2/nodes).
Then I would like to select all other nodes that did not match the condition.

<xsl:variable name="input_IT_Stunde"
select="document(concat('../temp/stunde_',$Property_File/Vergleichseigenschaf
ten/Input[@Sortierungsart='Maschine']/@Input_XML,'.xml'))/EintrdgeListe"/>
<xsl:variable name="input_Manual_Stunde"
select="document(concat('../temp/stunde_',$Property_File/Vergleichseigenschaf
ten/Input[@Sortierungsart='Hand']/@Input_XML,'.xml'))/EintrdgeListe"/>

Is the following Xpath correct?

<xsl:variable name="matching_IT-Man"
	select="$input_IT_Stunde/Eintrag[@Datum=$input_Manual_Stunde/Eintrag/@BZ_Abg
angsdatum and
substring(@Zeit,1,2)=substring($input_Manual_Stunde/Eintrag/@BZ_Zeit,1,2) and
@Geographisch=$input_Manual_Stunde/Eintrag/@BZ_Geographisch and
@BBZ_Nummer=$input_Manual_Stunde/Eintrag/@BZ_BBZ_Nummer and @Leistungsangebot=
$input_Manual_Stunde/Eintrag/@BZ_DLA and
@Verarbeitungsart=$input_Manual_Stunde/Eintrag/@BZ_Verarbeitung  and
@Format=$input_Manual_Stunde/Eintrag/@BZ_Format and
@Zustellart=$input_Manual_Tage/Eintrag/@BZ_Zustellart]"
/>
... for each $matching_IT-Man, do....

THEN : (Same Xpath condition as  the first one, but with a negation not()
<xsl:variable name="NOT_matching_IT-Man"
	select="$input_IT_Stunde/Eintrag[not(@Datum=$input_Manual_Stunde/Eintrag/@BZ
_Abgangsdatum and
substring(@Zeit,1,2)=substring($input_Manual_Stunde/Eintrag/@BZ_Zeit,1,2) 	and
@Geographisch=$input_Manual_Stunde/Eintrag/@BZ_Geographisch and
@BBZ_Nummer=$input_Manual_Stunde/Eintrag/@BZ_BBZ_Nummer and @Leistungsangebot=
$input_Manual_Stunde/Eintrag/@BZ_DLA and
@Verarbeitungsart=$input_Manual_Stunde/Eintrag/@BZ_Verarbeitung  and
@Format=$input_Manual_Stunde/Eintrag/@BZ_Format and
@Zustellart=$input_Manual_Tage/Eintrag/@BZ_Zustellart)]"
/>
... for each $NOT_matching_IT-Man, do....

The final result shoud be the whole XML1 input data.

Why I ask such a question is due to the fact that when I add all values
contained within one specific attribute, the resulting sum isn't equal to the
one of the main XML1 attributes.

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.