Re: Stripping empty elements while still conforming to
<xsl:template match="*"> <xsl:if test="child::* or (string-length(.) != 0)"> <xsl:copy> <xsl:apply-templates match="@*|node()" /> </xsl:copy> </xsl:if> </xsl:template>
Though I don't see how this will make sure that the result 'still conforms the DTD'...
Is there a simple way to strip empty elements from an XML while still conforming to the requirements of the DTD? I know how to use the string() function to copy only those elements that contain data, but this often removes child elements required by the DTD.
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