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

Using a keys to filter based on [not(someelement)]

Subject: Using a keys to filter based on [not(someelement)]
From: Jacquo Johnson <genxgeek@xxxxxxxxx>
Date: Sun, 7 Aug 2005 15:01:09 -0600
 Using a keys to filter based on [not(someelement)]
Grouping seems pretty easy when defining keys that are inclusive such as:

<xsl:key name="recordByC" match="Record" use="CodeId"/>
<xsl:variable name="uh2" select="key('recordByC','30DAYPM')"/>

but what about using a key to exclude a Record based on a certain
element.  That is, I want to ignore all Records when a <Fodder/>
element is present.

Is using the predicate after the key is resolved the only method:

<xsl:variable name="uh2" select="key('recordByC','30DAYPM')[not(Fodder)]"/>

is there anyway that I can define this within the use attribute of the key?

Thanks in advance...

XML Source:

        <Record>
               <CodeId>30DAYPM</CodeId>
               <AttributeName>LT</AttributeName>
               <OID>daa575325f8675a6</OID>
               <Id>AU  100-3</Id>
               <AttributeValue>YES</AttributeValue>
       </Record>
       <!-- Want to ignore these -->
        <Record>
               <Fodder/>
               <CodeId>30DAYPM</CodeId>
               <AttributeName>LT</AttributeName>
               <OID>daa575325f8675a6</OID>
               <Id>AU  100-3</Id>
               <AttributeValue>YES</AttributeValue>
       </Record>

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.