Re: [xsl] inserting data from second file using key and document

Subject: Re: [xsl] inserting data from second file using key and document
From: "Jim Albright jim_albright@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 14 Jan 2019 11:49:57 -0000
Peter

That is what I am trying to do but something is wrong with my attempt.  Any
clues?

    <xsl:variable name="LN" select="document('LN-PT-converted2.html')"/>
    <xsl:key name="insert" match="$LN/html/body/p" use="@domain"/>

  <xsl:template match="Comments[parent::LEXSense[@LanguageCode='pt']]">
  	 <xsl:variable name="item_number" select="preceding::LEXDomain"/>
   	<xsl:element name="Comments">
           		<xsl:apply-templates select="key('insert', $item_number)"/>
   	</xsl:element>
         </xsl:template>

-----Original Message-----
From: Pieter Masereeuw pieter@xxxxxxxxxxxx
[mailto:xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx]
Sent: Monday, January 14, 2019 12:46 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [xsl] inserting data from second file using key and document

Hi Jim,

I have once been struggling too to solve this. The way I do it now is by
placing the key() function after a variable that references a node in the
external document. E.g.:

<xsl:variable name="doc" select="doc('some-uri')"/> ...
<xsl:apply-templates select="$doc/key(...)"/>

Pieter

Current Thread