Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to group elements in XSLT
    primarykey
    data
    text
    <p>Faced with difficulties in solving the problem by means of grouping elements XSLT. Do I have to use the xsl: key? if so, how to do it or more xsl: for-each? Here is my problem. My XML file:</p> <pre><code>&lt;page&gt; &lt;name&gt;test&lt;/name&gt; &lt;property id="416" name="country" type="relation"&gt; &lt;title&gt;Country&lt;/title&gt; &lt;value&gt; &lt;item id="1014" name="Canada"/&gt; &lt;/value&gt; &lt;/property&gt; &lt;/page&gt; </code></pre> <p>and items such pieces 20, each has a name (non-recurring, and their own country, can be repeated) How to derive such elements grouped by country? for example:</p> <pre><code>&lt;h1&gt;Canada&lt;/h1&gt; &lt;h2&gt;test&lt;h2&gt; &lt;h2&gt;test2&lt;h2&gt; &lt;h1&gt;England&lt;/h1&gt; &lt;h2&gt;test3&lt;/h2&gt; &lt;h2&gt;test3&lt;/h2&gt; </code></pre> <p>UPDATE:</p> <pre><code> &lt;page id="423" parentId="421" link="/producers/oao_nii_elpa/" is-active="1" object-id="1020" type-id="67" type-guid="catalog-category" update-time="1350295423" alt-name="oao_nii_elpa"&gt; &lt;basetype id="44" module="catalog" method="category"&gt;Catalog category&lt;/basetype&gt; &lt;name&gt;Nii elpa&lt;/name&gt; &lt;properties&gt; &lt;group id="130" name="common"&gt; &lt;title&gt;Params&lt;/title&gt; &lt;property id="116" name="h1" type="string"&gt; &lt;title&gt;H1 field&lt;/title&gt; &lt;value&gt;Nii elpa&lt;/value&gt; &lt;/property&gt; &lt;/group&gt; &lt;group id="131" name="menu_view"&gt; &lt;title&gt;Menu View&lt;/title&gt; &lt;property id="123" name="header_pic" type="img_file"&gt; &lt;title&gt;Header_Pic&lt;/title&gt; &lt;value path="./images/cms/headers/elpa.jpg" folder="/images/cms/headers" name="elpa" ext="jpg" width="139" height="63"&gt;/images/cms/headers/elpa.jpg&lt;/value&gt; &lt;/property&gt; &lt;/group&gt; &lt;group id="133" name="additional"&gt; &lt;title&gt;Additional&lt;/title&gt; &lt;property id="416" name="country" type="relation"&gt; &lt;title&gt;Country&lt;/title&gt; &lt;value&gt; &lt;item id="3" guid="a1e3ae17e80ba2b4a3ddb1b855430346f74b8d48" name="England" type-id="4" type-guid="d69b923df6140a16aefc89546a384e0493641fbe" ownerId="42" xlink:href="uobject://3"/&gt; &lt;/value&gt; &lt;/property&gt; &lt;/group&gt; &lt;/properties&gt; &lt;/page&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    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.
 

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