Subject:Adding values with document() lookup Author:Rick Scofield Date:07 Oct 2006 05:37 PM
This forum is the best reason to use SS, so here is my question. I have a source file with product quantities and I want to lookup that product in another xml file to add the lookup quantity to the source quantity. So if the <upc> string in the source file matches the <upc> in the lookup file, then add <qtyavail> to <qty> otherwise use the <qtyavail>..I have also attached my current XSLT file.
Subject:Adding values with document() lookup Author:Rick Scofield Date:08 Oct 2006 03:02 PM
Thank you Minola for the prompt reply. Your example worked great!, however my lookup xml file is around 30,000 lines...so the lookup takes bery long to complete. Is there a way to use the xsl:key on the lookup to sped things up, or maybe you have another suggestion.
Subject:Adding values with document() lookup Author:Rick Scofield Date:09 Oct 2006 09:03 AM Originally Posted: 09 Oct 2006 09:02 AM
Ivan,
Thank you for the help on speeding up the lookup process, dare I ask one more question please? If the upc number is not found in UpcQty.xml the I get 'NaN' as the qtyavail...what is this and how can I just use the qtyvail in the source if the upc number is not found. I have attached a sample of my UpcQTy.xml file.
Subject:Adding values with document() lookup Author:Rick Scofield Date:10 Oct 2006 12:17 PM
Thank you Ivan, I used the following and seems to work!
<xsl:choose>
<xsl:when test="$rproqty > 1">
<xsl:value-of select="qtyavail + $rproqty"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="qtyavail"/>
</xsl:otherwise>
</xsl:choose>