I'm doing XML to XML transformation (newbie when it comes to XML and XSLT)
Say I have an XML document like this
<element1 att1="a" att2="b">
<element11>text1</element11>
</element1>
<element2>text2</element2>
</root>
I want to delete att1 and att2 from element1 so that output will look like this:
<root>
<element1>
<element11>text1</element11>
</element1>
<element2>text2</element2>
</root>
I could write a template that call <xsl:copy-of select=3D"..." to basically
copy everything except the two attributes there. But this is just small
examples, with more complex XML files, where I want to delete things here and
there, this becomes unscalable (the problem applies to both attributes
elements, and text, not just attributes)
Basically what I want to do is to have a template for each element/attribute
that I want to "not copy" (delete), for ex:
<xsl:template match=3D"root/element1/@att1"/>
(doing nothing, essentially not copying the attribute over)
Since the built-in templates for everything else do not copy the element
nodes over (only text nodes are output), I have to provide templates for
the rest to copy them over (not sure how to do this effectively, either),
which is not very efficient.
So my question comes down to:
Can I provide rules for each of the thing I want to "delete", and then have one
template to copy over everything else
~Anh
--~------------------------------------------------------------------
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>
--~--