Note that there are some explanatory texts on larger screens.

plurals
  1. POGet Element Value according to another element in XSL
    primarykey
    data
    text
    <p>I need to retrieve the Code of supplier according to the price retrieved previously</p> <p>the price was retrieved like so </p> <pre><code>&lt;xsl:template match="Price"&gt; &lt;xsl:if test="position() = 1"&gt; &lt;xsl:value-of select="."/&gt; &lt;/xsl:if&gt; &lt;/xsl:template&gt; &lt;xsl:apply-templates select="current-group()/Price"&gt; &lt;xsl:sort select="." data-type="text" order="ascending"/&gt; &lt;/xsl:apply-templates&gt; </code></pre> <p>is there anything i can do to get the supplier code for that price</p> <pre><code>&lt;xsl:variable name="SupplierCode" select="current-group()/SupplierCode"/&gt; </code></pre> <p>XML Sample</p> <pre><code>&lt;Search-Request search-term="1 tb"&gt; &lt;Items&gt; &lt;Item href="SEA1TBST31000524AS.jpg" model="ST31000524AS"&gt; &lt;Name&gt;Seagate Hard disk 1TB ST31000524AS 3.5"&lt;/Name&gt; &lt;Price&gt;60.50&lt;/Price&gt; &lt;SupplierCode&gt;TECSEA1TB&lt;/SupplierCode&gt; &lt;Supplier&gt;TEC001&lt;/Supplier&gt; &lt;Manufacturer&gt;Seagate&lt;/Manufacturer&gt; &lt;/Item&gt; &lt;Item href="" model="ST31000524AS"&gt; &lt;Name&gt;Seagate Hard disk 1TB ST31000524AS 3.5 inch&lt;/Name&gt; &lt;Price&gt;55.50&lt;/Price&gt; &lt;SupplierCode&gt;SCASEA1TB&lt;/SupplierCode&gt; &lt;Supplier&gt;SCA001&lt;/Supplier&gt; &lt;Manufacturer&gt;Seagate&lt;/Manufacturer&gt; &lt;/Item&gt; &lt;/Items&gt; &lt;/Search-Request&gt; </code></pre> <p>also I am grouping in the following manner.</p> <pre><code>&lt;xsl:for-each-group select="Items/Item" group-by="@model"&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload