|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Is there a way to avoid Empty Values?
Hi,
You can serialize the XML in the way you want, for instance you can parse it again and serialize empty elements with start and end tags. In XSLT 2.0 you can use a trick to achieve that. For instance if you know that a character, let's say # does not appear in the output then you can use a character map to map it to nothing and generate # in every element: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:character-map name="test"> <xsl:output-character character="#" string=""/> </xsl:character-map> <xsl:output use-character-maps="test"/> <xsl:template match="*"> <xsl:element name="{name()}" namespace="{namespace-uri()}"> <xsl:copy-of select="@*"/> <xsl:apply-templates/> <xsl:text>#</xsl:text> </xsl:element> </xsl:template> </xsl:stylesheet> Best Regards, George --------------------------------------------------------------------- George Cristian Bina <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com binu.idicula@xxxxxxxxx wrote: Hi,
|
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
|






