|
[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?
> 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
|
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
|

Cart








