xsl-list
[Top] [All Lists]

Re: [xsl] Merge 2 xmls : Loop through one xml and get elements from second xml

2020-09-01 10:57:15
Am 01.09.2020 um 17:41 schrieb Prady Prady 
prady(_dot_)chin(_at_)gmail(_dot_)com:

Why can't I do something like this?  But below one i*s NOT working .. *

*I need to know how to select amount based on the supplied order num: *
     <xsl:value-of
select="$Orders_Part2/orders*/order_num[$ordernum]*/amount"/> ==> not
working

Well, what do you expect it to do? It doesn't seem to make sense to me.

If the key use in my original XSLT 1 suggestion seems too complicated
then use plain XPath

<xsl:template match="order">
  <xsl:copy>
    <xsl:apply-templates select="@* | node()"/>
    <xsl:apply-templates select="$doc2//order[order_number =
current()/order_number]/amount"/>
  </xsl:copy>
</xsl:template>

But don't come along tomorrow or next week and complain that it doesn't
perform well on larger input documents.
--~----------------------------------------------------------------
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>