Hi all,
Can anyone help me with this little issue I am having.
The XML
<MPN>
<MTR MSN="AB123456"/>
<MTR MSN="AB654321"/>
<MTR MSN="AB654322"/>
<MTR MSN="AB654323”/>
<MTR MSN="AB654324"/>
<JOB JobId="136">
<JMR MSN="AB123456">
<JRA DateActionRequiredBy="20090701120012" />
</JMR>
<JMR MSN="AB654321">
<JRA DateActionRequiredBy="20090701100010" />
</JMR>
</JOB>
</MPN>
I would like to retrieve the DateActionRequiredBy from the JRA element, when the parser is sitting at the MTR Element, only one should be returned.
I have tried.
../JOB/JMR[@MSN = @MSN]/JRA/@DateActionRequiredBy
which returns {Dimension:[2]} NodeSet, this matches everything due to the @MSN attribute effectively matching itself not the parent.
../JOB/JMR[@MSN = ./@MSN]/JRA/@DateActionRequiredBy
which returns {Dimension:[2]} NodeSet
I have found a solution but it will require a variable inside every xsl:attribute which doesn't seem right to me.
<xsl:variable name="storeMSN" select="@MSN"/>
../JOB/JMR[@MSN = $storeMSN]/JRA/@DateActionRequiredBy
which returns 20090701120012 Attribute
This is what i am after, but there must be an easier way to achieve this other than a variable for every attribute.
Thanks in advance.