Hello,
I'm back with a problem, where I need help with starting.
I got an XML file that contains a number of elements with IDREF type attributes:
in XSL I want to loop over each group of <item> inside the <collection> (ideally using the idref() function) but I do not know all the values of the IDREF attribute (this number may change over time/file/element). Is there any way to get these values?
I know that I could loop over all elements (using <xsl:sort>) and check if the attribute value is still the same. Is there a more elegant way? (something like getting the IDREF attribute values first and then call it by idref() (or @group))
Is it possible to somehow get all the ID values of <group> and iterate over each of them?
thanks
PS: once I know all the IDREFS inside <collection> there are no problems I can foresee
I'm back with a problem, where I need help with starting.
I got an XML file that contains a number of elements with IDREF type attributes:
Code:
<?xml version="1.0" ?>
<root>
// these elements contain all the info for the groups
// name is of type ID
<group name="group1" … />
<group name="group2" … />
<group name="group3" … />
<collection>
// group is of type IDREF
// there can be any number of elements
<item group="group1">…</item>
<item group="group1">…</item>
<item group="group2">…</item>
<collection>
<root>
Code:
// desired result <div id="group1"> <a … > <a … > </div> <div id="group2"> <a … > </div>
Is it possible to somehow get all the ID values of <group> and iterate over each of them?
thanks
PS: once I know all the IDREFS inside <collection> there are no problems I can foresee
Comment