xsl-list
[Top] [All Lists]

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

2005-08-07 14:01:09
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>

--~------------------------------------------------------------------
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>