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

Re: Merging attributes in one XML file with node value

Subject: Re: Merging attributes in one XML file with node values in another (identical structure)
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Thu, 22 Jun 2006 11:43:45 -0400
Re:  Merging attributes in one XML file with node value
At 10:59 AM 6/22/2006, David wrote:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="*">
 <xsl:copy>
  <xsl:variable name="n" select="1+count(preceding::*)+count(ancestor::*)"/>
  <xsl:copy-of select="document('m2.xml')/descendant::*[$n]/@*"/>
  <xsl:apply-templates/>
 </xsl:copy>
</xsl:template>

</xsl:stylesheet>

Blow me away.


Actually I'm consoled a bit since even David's awesomely elegant solution works by applying a simple rule (which my non-mathematician brain had forgotten) to tell if two nodes are "the same"....

Cheers,
Wendell

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.