I am looking at the Muenchian Grouping. I tried finding examples that are similar to my xml but can't find any. Most of the examples are well structured while mine is confusing.
Here's a shortened version of my XML (note that I can't change the XML structure because it's a standard thing and out of my hands), and I'm using XSLT 1 because the system only supports that version now.
<object>
<creator id="123">
<name>ABC</name>
<city>Hamilton</city>
</creator>
<creator><references>456</references></creator>
<contact><references>123</references></contact>
<creator id="456">
<name>XYZ</name>
<city>New York</city>
</creator>
<associatedParty><references>123</references>
<role>Sponsor</role>
</associatedParty>
</object>
The output that I desire is:
<party id="123">
<name>ABC</name>
<city>Hamilton</city>
<role>Creator</role>
<role>Contact</role>
<role>Sponsor</role>
</party>
<party id="456">
<name>XYZ</name>
<city>New York</city>
<role>Creator</role>
<role>Contact</role>
</party>
Now the id attribute is being used as a value for the references element. And the tag in the output can be either creator, contact, or whatever is inside element if it's under an associatedParty element.
I'm stuck with creating the key to group them from their id/references attribute. As far as I see the examples using xsl:key is only for nodes that have the same name, and the example I posted have different node names. Any help would be appreciated!!!!