Letterpart
asked on
XSLT to test "sameness" of parent and child attributes, and content of child
I would like to use XSLT to match if particular attribute values of a parent and child are the same, AND if the content of the child is a single space.
Given this simplified XML:
So, specifically using the test data shown above I am trying to match on these conditions:
when the content of the subtext element only contains a single space
AND
the value of the ee attribute of the subtext element matches the value of the bb attribute of the parent text element
So, given the above XML, only the first subtext would match - the content is a single space and the value of the bb attribute of the text element matches the value of the ee attribute of the subtext element.
Can anyone help with this attribute testing and content testing puzzle?
Given this simplified XML:
<data>
<text aa="yes" bb="123.45" bc="maybe">
<subtext dd="no" ee="123.45" ff="yes"> </subtext>
</text>
<text aa="yes" bb="123.45" bc="maybe">
<subtext dd="no" ee="123.45" ff="yes">X</subtext>
</text>
<text aa="yes" bb="678.90" bc="maybe">
<subtext dd="no" ee="123.45" ff="yes"> </subtext>
</text>
</data>
So, specifically using the test data shown above I am trying to match on these conditions:
when the content of the subtext element only contains a single space
AND
the value of the ee attribute of the subtext element matches the value of the bb attribute of the parent text element
So, given the above XML, only the first subtext would match - the content is a single space and the value of the bb attribute of the text element matches the value of the ee attribute of the subtext element.
Can anyone help with this attribute testing and content testing puzzle?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for your prompt assistance.
You are welcome!
ASKER