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

Re: XPath 2.0: Conditional Expression (Was Re: XQuery

Subject: Re: XPath 2.0: Conditional Expression (Was Re: XQuery 1.0 and XPath 2.0 Functions and Operators Version 1.0)
From: "Kurt Cagle" <cagle@xxxxxxxxx>
Date: Fri, 7 Sep 2001 10:26:24 -0700
xpath conditional statement
I'd second Jeni's request on this front, though I might also see keeping in
mind the node-set aspect. If you have a conditional statement of the form

if(myNodeSet=condition,exprA,exprB) then the function will return a node-set
containing either exprA or exprB depending upon whether the given node in
the node-set satisfies or fails to satisfy the condition.  Thus, if you have
a node-set of the form
<record name="Kurt"/>
<record name="Jeni"/>
<record name="Jim"/>

called $records and myFunc returns a node of the form
<invalidRecord name="myName"/>

if($records[@name="Jeni"], . , myFunc(//crossRef[@idref=./@name]))

would return a node-set of the form
<invalidRecord name="Kurt"/>
<record name="Jeni"/>
<invalidRecord name="Jim"/>

Of course, if no second condition is imposed, this just becomes a handy way
to apply a function to a bunch of nodes one a a time, since

function($nyNodeSet)
    would act on the node-set while
if($myNodeSet,function(.))
    would act on each node of the node-set.

The ability to convert a string to an XPath expression would be nice. It
sort of exists with the common node-set() extension in XSLT, but that to me
seems to be something that should be intrinsic to the functional set.

-- Kurt



----- Original Message -----
From: "Jeni Tennison" <mail@xxxxxxxxxxxxxxxx>
To: "Jim Melton" <jim.melton@xxxxxxx>
Cc: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Friday, September 07, 2001 9:46 AM
Subject: XPath 2.0: Conditional Expression (Was Re:  XQuery 1.0 and
XPath 2.0 Functions and Operators Version 1.0)


> Hi Jim,
>
> Another XPath 2.0 requirement that doesn't seem to be present in the
> F&O WD is 2.2 "Must Provide a Conditional Expression". I imagined that
> conditional expressions would be supported with an operator, something
> like:
>
>   boolean-expression ? true-expression : false-expression
>
> Is this functionality going to appear in a different document?
>
> Cheers,
>
> Jeni
>
> ---
> Jeni Tennison
> http://www.jenitennison.com/
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>
>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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-2011 All Rights Reserved.