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

Re: How to merge translated XML files with the same ID

Subject: Re: How to merge translated XML files with the same IDs
From: Michael Müller-Hillebrand <mmh@xxxxxxxxxxxxx>
Date: Thu, 30 Apr 2009 17:44:38 +0200
Re:  How to merge translated XML files with the same ID
Wow, a use case for tunnel parameters. Even if it does not help the performance (which would not be a problem), it is a cool ,concept and a good reason to learn about it.

Thanks for the hint,

- Michael

Am 30.04.2009 um 16:58 schrieb David Carlisle:

Or is there a more elegant way? I will be using XSLT 2.0.

That's about it really. As an alternative to going back up each time ancestor::doc you could pass it down as you go along

<xsl:template match="@idref | @id">
   <xsl:param name="lang" tunnel="yes"/>
  <xsl:attribute name="{name()}"
  select="concat($lang, '_', .)"/>
</xsl:template>

and use
xsl:with-param to set this in the template for doc.

However I have no idea on the relative costs of doing ancestor:: or
passing down a tunnel param. Presumably depends on whether you use
an idiom that causes Michael's optimiser to do something clever or
whether the code actually implements the document traversal..

David

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-2007 All Rights Reserved.