[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: 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
|
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
|