xsl-list
[Top] [All Lists]

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

2019-01-14 05:50:04
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(_at_)masereeuw(_dot_)nl 
[mailto:xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com] 
Sent: Monday, January 14, 2019 12:46 AM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
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
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--

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