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

RE: How to delete empty element tag from output XML?

Subject: RE: How to delete empty element tag from output XML?
From: Kay Michael <Michael.Kay@xxxxxxx>
Date: Thu, 26 Oct 2000 11:20:29 +0100
java remove empty xml tag
> You may notice 
> 1). if <Sex> is empty as in Amy case, don't print <Gender /> 
> 2). if <N3> is empty as in Tom case, I need a output 
> <MI>N/A</MI>, i.e. a
> default of "N/A".
> 3). the structure and tag of output different with input.

> As I mentioned before, the last thing I want to do is use 
> <xsl:if> in XSLT
> stylesheet to compare every segment because it's too tedious 
> given the fact I have numberous tags need to process.

XSLT isn't magic, if you have lots of rules you will have to write lots of
code.

But your rules above look just like template rules, so rather than writing
lots of <xsl:if> statements I would write lots of rules.

e.g. 
Rule 1: <xsl:template match="Sex[.='']"/>
Rule 2: <xsl:template match="N3[.='']><MI>N/A</MI></xsl:template>

Mike Kay


 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.