xsl-list
[Top] [All Lists]

Re: [xsl] How to merge translated XML files with the same IDs

2009-04-30 11:00:54
using xml:lang preferable

On Thu, Apr 30, 2009 at 6:58 PM, David Carlisle 
<davidc(_at_)nag(_dot_)co(_dot_)uk> wrote:

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

________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs.
________________________________________________________________________

--~------------------------------------------------------------------
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>
--~--



--~------------------------------------------------------------------
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>
--~--

<Prev in Thread] Current Thread [Next in Thread>