J
jdhcards
Hello,
I've been banging my head against a problem all day without a solution,
and I'm hoping you all can help. I've got a piece of XML that defines a
set of elements in a flat list. Each of these elements has an attribute
"Id" which has a unique value. Some of these elements have a
parent-child relationship, specified with a "ResultId" attribute in one
of the child nodes.
<element id=1>
<child resultid=2/>
<child resultid=3/>
</element>
<element id=2>
</element>
<element id=3>
</element>
<element id=4>
I'm trying to filter the list of elements down to only the parent
elements. My approach has been to create a list of "child ids" and
throw out an element that have an id within that set of "child ids". In
the example above, I'd keep element 1&4, but through away 2 & 3.
I'm having trouble comparing the two node sets. Can anyone offer an
approach or the XSL syntax I'll need to get my approach done?
XSL to select child id's:
<xsl:variable name="subJobResultId"
select="ResultInfo/TaskDetails/*/TaskList/Task/TaskInformation/Task[@RunJobIdResultId
!= '']"/>
I've been banging my head against a problem all day without a solution,
and I'm hoping you all can help. I've got a piece of XML that defines a
set of elements in a flat list. Each of these elements has an attribute
"Id" which has a unique value. Some of these elements have a
parent-child relationship, specified with a "ResultId" attribute in one
of the child nodes.
<element id=1>
<child resultid=2/>
<child resultid=3/>
</element>
<element id=2>
</element>
<element id=3>
</element>
<element id=4>
I'm trying to filter the list of elements down to only the parent
elements. My approach has been to create a list of "child ids" and
throw out an element that have an id within that set of "child ids". In
the example above, I'd keep element 1&4, but through away 2 & 3.
I'm having trouble comparing the two node sets. Can anyone offer an
approach or the XSL syntax I'll need to get my approach done?
XSL to select child id's:
<xsl:variable name="subJobResultId"
select="ResultInfo/TaskDetails/*/TaskList/Task/TaskInformation/Task[@RunJobIdResultId
!= '']"/>