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

RE: Testing for Missing or Empty Tags

Subject: RE: Testing for Missing or Empty Tags
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Thu, 8 Jan 2004 17:02:00 -0000
xsl test tag
Your terminology is very confused.

By "Tag" I assume you mean "element".

What do you mean by a "set of empty tags". Do you mean "a set of zero or
more Tag elements in which all the Tag elements have no children"? If
so, test="not(Tag/node())" does it. Your test

Tag = ''

will match the element <Tag><x/></Tag> (which I don't regard as empty),
and it will also return true given <Tag/><Tag>xxx</Tag> (which I
wouldn't describe as a set of empty tags).

Michael Kay


> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of 
> Schwartz, Rechell R, ALABS
> Sent: 08 January 2004 14:13
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Testing for Missing or Empty Tags
> 
> 
> All,
> 
> Is there a simpler/more efficient way to test for a missing 
> tag or set of empty tags than the following code (let's 
> assume the XML tag name is called "Tag").
> 
> <xsl:if test="not(Tag[1]) or Tag ='' ">
> 
> 
> Rechell Schwartz
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 


 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.