xsl-list
[Top] [All Lists]

AW: Selecting Nodes by nodeset comparison

2005-04-12 05:36:37
Here is a better explanation of my problematic :

XML1 :

<EinträgeListe>
<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"/>
</EinträgeListe>


XML2 :

<EinträgeListe>
<Eintrag BZ_Abgangsdatum="20050211" BZ_Zeit="0800"      BZF_MengeGezählt="147"/>
<Eintrag BZ_Abgangsdatum="20050211" BZ_Zeit="0800"  BZF_MengeGezählt="50"/>
<Eintrag BZ_Abgangsdatum="20050212" BZ_Zeit="0800"      BZF_MengeGezählt="49"/>
<Eintrag BZ_Abgangsdatum="20050213" BZ_Zeit="0800"      BZF_MengeGezählt="37"/>
</EinträgeListe>

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

<xsl:variable 
        name="matching_XML1" 
        select="$XML1/Eintrag[(_at_)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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>