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

RE: determining if one or more instances of a child ar

Subject: RE: determining if one or more instances of a child are present in the current node element
From: Jarno.Elovirta@xxxxxxxxx
Date: Thu, 18 Sep 2003 12:38:23 +0300
one ar
Hi,

> Because my current node will be <Paragraph> and not <paraitem>.

The child axis is used on abbreviated steps -- you should know, having read the spec, right -- so

  <xsl:if test="ParaItem"/>

if the same as

  <xsl:if test="child::ParaItem"/>
 
> Also, it can have other elements as children. So I need to have a
> specific "test" that checks if that child exists before APPLYING
> stylesheets for that child.
> 
> <Paragraph>
> 	<ParaItem>
> 	<ParaItem>
> 	<ParaItem>
> ....
> <Paragraph>
> 
> Let me know :). Is there a better expression to check if the current
> NODE (paragraph) contains ATLEAST one child PARAITEM.

Makes no difference if there are other child elements, because

  <xsl:if test="ParaItem"/>

selects all the "ParaItem" child elements of the current node, casts the node-set to a boolean, and that will be true if the node-set contains more than zero nodes.
 
Cheers,

Jarno

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.