[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Null Values
> My requirement is to remove tag names when I convert from one > xml to another > xml, if there is no data. > e.g > <F1>1234</F1> > <F2>1234</F2> > <F3></F3> > <F4>1234</F4> > > to > > <F1>1234</F1> > <F2>1234</F2> > <F4>1234</F4> > It's rather important to learn the correct terminology here, because it will help you to understand the specs. Talking about "tag names" suggests you're thinking in terms of the serialized XML rather than its tree structure, which will get you into all sorts of conceptual confusion. What you are actually trying to remove is an element node. And in fact you don't need to remove it, you just need to refrain from copying it. The way you do this depends on how you are copying the other nodes. If you're doing it using template rules, the simplest way is to have an overriding template rule that matches elements with "no data" (which we might interpret as meaning no child element or text nodes), and does nothing: <xsl:template match="*[not(* or text())]" priority="17"/> Mike Kay Software AG 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
|