xsl-list
[Top] [All Lists]

Re: Stripping empty elements while still conforming to DTD

2005-09-28 09:13:30
On 9/28/05, watchstone(_at_)netzero(_dot_)com 
<watchstone(_at_)netzero(_dot_)com> 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.

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>