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

Re: Stripping empty elements while still conforming to

Subject: Re: Stripping empty elements while still conforming to DTD
From: andrew welch <andrew.j.welch@xxxxxxxxx>
Date: Wed, 28 Sep 2005 17:13:30 +0100
xml strip empty elements
On 9/28/05, watchstone@xxxxxxxxxxx <watchstone@xxxxxxxxxxx> wrote:
> 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.

You mean text() right?  And how can you make choices in the stylesheet
based on the DTD - the stylesheet doesn't know about the DTD.

If you mean you don't want to copy nodes without any children through
to the output, then you want a no-op template:

<xsl:template match="*[not(node())]"/>

...or something similar, depending on the rest of your stylesheet.  An
example of what you are trying to achieve would be good here.

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.