|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: deleting nodes that does not have attribute
Hi Mo,
> I want to copy everything from the input xml...
Then you need an identity transformation:
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()" />
</xsl:copy>
</xsl:template>
> except the nodes that does not have any attibues.
The only things that can have attributes are elements, so I guess you
want to just exclude the elements that don't have attributes (not
exclude text just because they can't have attributes!). So you need
another template that overrides the identity template by doing
nothing. This template has to match elements that don't have
attributes, so:
<xsl:template match="*[not(@*)]" />
I hope that helps,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
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
|

Cart








