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

Re: foreign keys in a xml-database, how to copy a node

Subject: Re: foreign keys in a xml-database, how to copy a node andonly one/some of its childs
From: "J.Pietschmann" <j3322ptm@xxxxxxxx>
Date: Mon, 13 May 2002 21:06:43 +0200
copy foreign keys
ChivaBaba@xxxxxxx wrote:
The PROBLEM is, that the above construction copies each tool
> with all its childs ( releases ) from second.xml and not only
> those, whose @name fits @version of the corresponding tool from first xml.

Match the release and copy stuff from the parent (the tool) as
needed:
 <xsl:key name="tool-release" match="release"
   use="concat(../@name,'#',@name)"/>
...

   <xsl:variable name="tools">
     <xsl:for-each select="tool">
      <xsl:variable name="key" select="concat(@name,'#',@version)"/>
      <xsl:for-each select="$sw-file">
        <xsl:variable name="release" select="key('tool-release',$key)"/>
        <tool>
          <xsl:copy-of select="$release/../@*"/>
          <xsl:copy-of select="$release/../*[not(self:release)]"/>
          <xsl:copy-of select="$release"/>
        </tool>
      </xsl:for-each>
     </xsl:for-each>
    </xsl:variable>

J.Pietschmann


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



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.