|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: if child element does not exist stop generation
At 06:20 AM 5/3/2005, David wrote:
> Hi, > You can do this using: > ><xsl:if test="*[self::length]"> or Translations from XPath short to long syntax: "length" is short for "child::length" (set of 'length' element children of context node) "*[self::length]" is short for "child::*[self::length] (set of element children that have a 'length' element on the self axis) "*[name() = 'length']" is short for
"child::*[name() = 'length']"
(set of element children that return 'length' as the result
of the name() function with an implicit argument of "self::node()")The xsl:if test works by evaluating the test expression and returning a Boolean; then depending on the Boolean value, the contents of the xsl:if are processed (or not). When the result is not already a Boolean, it is "coerced" using the XPath casting rules. All these tests work because the casting rule for a node-set to a Boolean is that the set is true if it has any members, false if it is empty. Cheers, Wendell
|
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
|

Cart








