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

XPath is a composable language ... does that mean I ca

Subject: XPath is a composable language ... does that mean I can create an XPath expression for a then-clause and simply plug it into an if-then-else?
From: "Roger L Costello costello@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 4 Dec 2022 17:11:06 -0000
 XPath is a composable language ... does that mean I ca
Hi Folks,

I have this English sentence:

if the machine = "Intel 386 or later processors and compatible processors"
then ... else ... .

I deliberately elided the then-clause and the else-clause.

I need to turn that English sentence into XPath. I created this XPath:

if (/Windows_Executable_File/Headers/File_Header/Machine = "Intel 386 or later
processors and compatible processors")
then
    ...
else
    ...

Next, I created an XPath expression for the then-clause. I created the XPath
independent of its enveloping if-then-else. Let me denote the XPath expression
I created as: then-clause-XPath.

I did the same for the else-clause.

I then plugged then-clause-XPath and else-clause-XPath into the if-then-else:

if (/Windows_Executable_File/Headers/File_Header/Machine = "Intel 386 or later
processors and compatible processors")
then
    then-clause-XPath
else
    else-clause-XPath

The XPath 3.0 specification says this:

      XPath 3.0 is a composable language

Does "composable language" mean I can do as I describe above and the result
will be a valid XPath expression?

That is, can I develop an XPath expression for the then-clause completely
independent of its enveloping if-then-else and then simply plug the XPath into
the if-then-else? Ditto for the else-clause? Does "composable language" mean I
can do this kind of thing?

/Roger

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.