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

Re: Is XPath and/or XSLT designed such that I should

Subject: Re: Is XPath and/or XSLT designed such that I should never have to write special case code?
From: "Mukul Gandhi mukulg@xxxxxxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 23 Jun 2021 03:49:29 -0000
Re:  Is XPath and/or XSLT designed such that I should
On Tue, Jun 22, 2021 at 10:34 PM Roger L Costello costello@xxxxxxxxx <
xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:


> <xsl:if test="empty(Cell[2]/Data)"> do something </xsl:if>
>
> Bad, bad, bad.
>


>
> Question #1: is XPath and/or XSLT designed such that I should never have
> to write special case code?
>
> Question #2: If I find myself writing special case code, should I stop and
> say, "How can I modify this XPath and/or XSLT so that I do not have to
> write special case code?
>

I don't think that, using an "if" (xsl:if / xsl:choose in XSLT, "if" in
XPath) control flow mechanism in the code (and equally well in XSLT) is
always a bad idea. It's an integral programming tool to solve problems. To
have code look nicer, may be we can encapsulate the "if" logic within a
function.


-- 
Regards,
Mukul Gandhi

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.