RE: [xsl] Fwd: XSL question

Subject: RE: [xsl] Fwd: XSL question
From: "Diamond, Jason" <Jason.Diamond@xxxxxxx>
Date: Mon, 19 Mar 2001 13:35:45 -0600
Is the <xsl:if> trying to test if the elements are empty? If so, you can use
this:

<xsl:if test="Invoicing/Customer/state = '' and Invoicing/Customer/country =
''">
  <!-- both elements are empty -->
</xsl:if>

Or, you can count the child nodes (including elements, PIs, and text) like
this:

<xsl:if test="count(Invoicing/Customer/state/node()) = 0 and
count(Invoicing/Customer/country/node()) = 0">
  <!-- both elements are empty -->
</xsl:if>

This will work regardless of whether it the element was marked up like
<state/> or <state></state>.

Jason.

> -----Original Message-----
> From: B. Tommie Usdin [mailto:btusdin@xxxxxxxxxxxxxxxx]
> Sent: Sunday, January 03, 1904 3:34 PM
> To: xsl-list
> Subject: [xsl] Fwd: XSL question
> 
> 
> Date: Fri, 16 Mar 2001 15:41:51 -0500
> To: XSL List <owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
> From: Tony Felik <tony.felik@xxxxxxxxxx>
> Subject: XSL question
> X-Loop-Detect: 1
> 
> 
> Hello,
> 
> My name is Tony and my question is:
> How can I handle two empty tags?
> for example:
> 
> <xsl:if test="Invoicing/Customer/state[.!=''] and 
> Invoicing/Customer/country[.!='']">
> 
> (if both the country and the state are empty tags).
> By "empty" I meant: </state> a tag without text.
> 
> Thank You.
> 
> 
> Best Regards, Tony Felik
> - 28 Betzalel St. Ramat Gan 52521 Israel (  +972-3-753-0641 ? 
> +972-3-751-5858 * 
> <mailto:tony.felik@xxxxxxxxxx>tony.felik@extent.<mailto:tony.f
elik@xxxxxxxxxx>com 
"   http://www.extent.com
-- 
======================================================================
B. Tommie Usdin                        mailto:btusdin@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                           Phone: 301/315-9631
Suite 207                                    Direct Line: 301/315-9634
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
   Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================

 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