[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
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|