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

Re: except (was: Keys with duplicates should be simple

Subject: Re: except (was: Keys with duplicates should be simple)
From: Graydon <graydon@xxxxxxxxx>
Date: Sun, 2 Feb 2014 16:50:51 -0500
Re:  except (was: Keys with duplicates should be simple
On Sun, Feb 02, 2014 at 09:04:28PM +0000, Michael Kay scripsit:
> Perhaps you are reading "except" as "that are not", i.e. a negated
> predicate rather than a set difference). In English this reading would
> often work, as in "all vehicles that are not bicycles". But in English
> grammar, what follows "except" is not a predicate that qualifies what
> precedes it: you cannot say "all vehicles except blue". So I think the
> XPath usage is aligned with English usage in this instance.

I've found it useful to read "except" as "without"; I have a sequence,
and what I get is that sequence without the members of this other
sequence which I get to define.

The place I usually get snarled up is remembering that the sequences
are.

* except heading

is easy, that's "all the element children without any heading children", 
(child::*) except (child::heading)

* except (heading, references)

is easy, that's "all the element children without any members of this
thing that's really a sequence which happens to be defined as heading or
reference elements",
(child::*) except (child::heading,child::references)

descendant::* except heading

is really "all the descendant elements without any child heading
elements of the context node", and that's usually a source of
intractable bugs.  I think it should be

descendant::* except self::heading

if I want all the descendant elements without any of the descendant
elements who happen to be heading elements.

But then in XSLT 3.0 (at least as currently available) I can say

<xsl:template match="descendant::* except self::heading">
<!-- something happens -->
</xsl:template>

and I get lost because I have no idea how the first sequence is defined.

-- Graydon

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.