-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Wed, 23 Jun 2004 20:32:22 -0700, Jacinle Young wrote:
Sorry, there is a simple way to do it in vanilla xslt, and here it is.
=================== XSLT =======================
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output indent="yes"/>
<xsl:template match="root">
<addressbook>
<xsl:copy-of select="child::*"/>
<xsl:copy-of select="document('test2.xml')/root/*[name(.)!='nickname']"/>
</addressbook>
</xsl:template>
</xsl:stylesheet>
================= TEST1.XML ===================
<?xml version="1.0" encoding="UTF-8"?>
<root>
<nickname>Fred</nickname>
<email>fred@barneys.house</email>
<html>TRUE</html>
<firstname>Fred</firstname>
<lastname>Flintstone</lastname>
</root>
================ TEST2.XML ===================
<?xml version="1.0" encoding="UTF-8"?>
<root>
<nickname>Fred</nickname>
<work>999-Quarry</work>
<home>999-BedrockLane</home>
<fax>888-Squawk</fax>
<pager>777-pager</pager>
<cell>555-cell</cell>
</root>
================ OUTPUT ======================
<?xml version="1.0" encoding="UTF-8"?>
<addressbook>
<nickname>Fred</nickname>
<email>fred@barneys.house</email>
<html>TRUE</html>
<firstname>Fred</firstname>
<lastname>Flintstone</lastname>
<work>999-Quarry</work>
<home>999-BedrockLane</home>
<fax>888-Squawk</fax>
<pager>777-pager</pager>
<cell>555-cell</cell>
</addressbook>
Quite a neat trick? And I wouldn't have know about it without your question
8^).
- --
Cat
http://www.ratrobot.com/java/menu/ Simple menu applet that lets you
set colors,fonts and use it with a tiled background. It is completely FREE
for any use.
Sun Jun 27 21:12:05 UTC 2004
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFA3zglKHRjYtwQ1QARAtwMAKDacBKFEsI4lsCl/xLWqqb+Hy13mQCfT5iF
3qypgKEWF/Oop3EzNFIL5S8=
=sW2r
-----END PGP SIGNATURE-----