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

Re: Counting Child Nodes?

Subject: Re: Counting Child Nodes?
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Sun, 21 Oct 2007 17:53:13 +0200
Re: Counting Child Nodes?
Alice Ju-Hsuan Wei wrote:

Thanks to all of you who helped pitch in to make this code work. Now, this code is basically working, but I don't know why it generates the background image as either _med.png or _large.png, while those with string length smaller than 25 characters still generate the second <xsl:if> statement, by generating the _med.png just the same as the second condition.

Is this another boolean problem I am having? Any suggestions?

Yes. Re-read the comments of Scott and Michael. You haven't (yet) applied their advice. Comparing numbers as strings (MK & Scott), using xsl:if when xsl:when is better and vv (Scott & MK), being overly verbose (Scott & MK), a possible full solution (Scott) and questions about the code in general (MK) were all points of attention not reflected in this new post of you. Maybe you missed their messages? Check back what they wrote (19-10-2007 17:01 and 17:02 resp). If things are not clear, ask them to clarify.

Some of the points mentioned are well-explained in "Beginning XSLT" by Tennison. which you mention in your sample xml: if you don't have it yet, I recommend buying it, it is a good read and may very well teach you how to write XSLT declarative instead of imperative (which it is now), making your code more adapt to changes and less error prone.

-- Abel Braaksma

Current Thread


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.
First Name
Last Name
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.