RE: [xsl] Best practices - correction

Subject: RE: [xsl] Best practices - correction
From: "CROFT, MICHAEL" <MCROFT@xxxxxxxxx>
Date: Tue, 18 Jun 2002 14:40:30 -0400
Sorry, 
The not(normalize-space(myelement) does work...

When I refresh the browser(IE 6) after making changes to the underlying xml,
it does not show the changes.  When I close and reopen the xml doc with the
browser, it shows the changes?



-----Original Message-----
From: Michael Kay [mailto:michael.h.kay@xxxxxxxxxxxx]
Sent: Tuesday, June 18, 2002 1:29 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE: [xsl] Best practices


> From a design standpoint, what is the "defacto" way to test 
> for an empty element?  

You have to be very careful what you mean by an "empty element". Which
of the following are empty?

<p/>
<p>  </p>
<p><!-- this is empty --></p>
<p><i></i></p>

p='' checks that the element exists and has an empty string-value: it
will match 1,3,4 in the above list, and 2 if xsl:strip-space is in use.
not(p/node()) checks that the element exists and has no children: it
will match item 1 in the above list.
not(normalize-space(p)) will match all the above.

Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx 


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


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the sender and postmaster@xxxxxxxxxx
**********************************************************************
 


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


Current Thread