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

How to test if a value itn't in a nodeset

Subject: How to test if a value itn't in a nodeset
From: "Jaime Stuardo" <jstuardo@xxxxxxxxxxx>
Date: Thu, 7 Apr 2005 10:31:05 -0400
xsl test if value
Hi all...

If I have this xml

<doc>
  <valid_combination>
    <ROW>
      <CAD>a</CAD>
      <COB>b</COB>
    </ROW>
    <ROW>
      <CAD>a</CAD>
      <COB>c</COB>
    </ROW>
    <ROW>
      <CAD>b</CAD>
      <COB>d</COB>
    </ROW>
  </valid_combination>
  <current_values>
    <ROW>
      <COB>b</COB>
	<DESC>d1</DESC>
    </ROW>
    <ROW>
      <COB>e</COB>
	<DESC>d2</DESC>
    </ROW>
    <ROW>
      <COB>f</COB>
	<DESC>d3</DESC>
    </ROW>
    <ROW>
      <COB>c</COB>
	<DESC>d4</DESC>
    </ROW>
    <ROW>
      <COB>d</COB>
	<DESC>d5</DESC>
    </ROW>
  </current_values>
</doc>

where CAD field is used to group mutually exclusive elements of current_value
set, for instance, that means that I have to show 2 listings of elements of
the current_values group. The first listing has to show these COB's: b, e, f,
c ("d" is missing because "d" is mutually exclusive with "b" and "c" according
to valid_combination configuration). The second listing has to show these
COB's: e, f, d.

If I use this XSLT:

<xsl:apply-templates select="current_values/ROW[COB = //valid_combination[CAD
= 'a']/COB]" />
<xsl:apply-templates select="current_values/ROW[COB = //valid_combination[CAD
= 'b']/COB]" />

It show:s
1 list.- "b" and "c"
2 list.- "d"

But I need to do the union with the other elements, not present in
valid_combination group. I tried, for example for the first listing:

<xsl:apply-templates select="current_values/ROW[COB = //valid_combination[CAD
= 'a']/COB] | current_values/ROW[COB != //valid_combination/COB]" />

But it didn't work. I interpret that union as:
"show elements of 'current_values' where their COB is present in
'valid_combination' under CAD = 'a' category (to include 'b' and 'c'), plus
the elements where COB isn't in 'valid_combination' (to include only 'e' and
'f', not 'c')."

That is the simplified scenario what I'm trying to achieve.

Any help would be greatly appreciated.

Thanks in advance
Jaime

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.