[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Using Lookup file in XSLT to cross reference old a
On 06.04.2021 19:05, Deiter, Cathy E (US) cathy.deiter@xxxxxxxxxxxxxx wrote:
select="./@wpid"/></xsl:variable>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. <xsl:variable name="NEWFILE">file:///C:/BAE/FAASV/OldnumberFAASV/Newfile_lookup.xml</xsl:va riable> <xref> <xsl:attribute name="wpid"> <xsl:choose> <xsl:when test="$OLDFILE = document($NEWFILE)//NewFile/@id"> <xsl:value-of select="document($NEWFILE)//NewFile[@id=$OLDFILE]"/> </xsl:when> <xsl:otherwise> <xsl:copy-of select="."></xsl:copy-of> </xsl:otherwise> </xsl:choose> </xsl:attribute> </xref> Currently it is only returning the original value, not the new file number.
On the other hand, "it is only returning the original value" sounds odd or suggests not even the match="xref" works (due to namespaces?), as with a match for those elements where the xsl:when doesn't evaluate to true you would simply create a new "xref" with an empty "wpid" attribute as your "xref" input elements are empty, meaning the <xsl:copy-of select="."></xsl:copy-of> can't create any output.
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|