Subject: Re: [xsl] Using Lookup file in XSLT to cross reference old and pull in new numbers From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Tue, 6 Apr 2021 17:33:52 -0000 |
I am a Newbie and am having difficulties with an XSLT doing a lookup. I need to lookup up an old file number based off of an attribute, look at the lookup file and pull in the new number. I am using Oxygen Editor version 22.1.
My XML file looks like this. I need to find the highlighted file in my lookup and replace with the new file number. <proc> <title>FOLLOW-ON MAINTENANCE</title> <step1 id="M20340-03.01.01"> <para> Install access cover. <xref wpid="M20236" pretext="(" posttext=")"/> </para> </step1> <step1 id="M20340-03.01.02"> <para> Fill cooling system to proper fluid level. <xref wpid="M20333" pretext="(" posttext=")"/> </para> </step1>
My Lookup file looks like this (only added a few rows) <row><NewFile id="M20236">M20016-9-2350-372</Newfile></row> <row><NewFile id="M20234">M20381-9-2350-372</Newfile></row> <row><NewFile id="M20232">M20017-9-2350-372</Newfile></row>
<xsl:template match="xref/@wpid[key('file-ref', ., doc('lookup.xml'))]"> <xsl:attribute name="{name()}" select="key('file-ref', ., doc('lookup.xml')"/> </xsl:template>
Of course the path and the lookup document is bested stored in a global parameter or variable.
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Using Lookup file in XSLT to , Deiter, Cathy E (US) | Thread | Re: [xsl] Using Lookup file in XSLT, Martin Honnen martin |
[xsl] Using Lookup file in XSLT to , Deiter, Cathy E (US) | Date | Re: [xsl] Using Lookup file in XSLT, Martin Honnen martin |
Month |