I have:
XML
<TestCases>
<TestCase>
<TestCaseElement>
<Name><![CDATA[Start]]></Name>
<Role><![CDATA[TESTSTEP]]></Role>
</TestCaseElement>
<TestCaseElement>
<Name><![CDATA[Content]]></Name>
<Role><![CDATA[TESTSTEP]]></Role>
<Code>
<Line><![CDATA[some Content]></Line>
<Line><![CDATA[some Content]></Line>
</Code>
</TestCaseElement>
<TestCaseElement>
<Name><![CDATA[End]]></Name>
<Role><![CDATA[TESTSTEP]]></Role>
</TestCaseElement>
**n of these Start-Content-Stop Triplets are in the XML Document**
</TestCase>
</TestCases>
I want to "group" this Elements with XSLT.
Each group should start with Start and should end with End My first idea was to do that with this solution: stackoverflow combining xslt issue
This would be:
<xsl:for-each select="/TestCases/TestCase/TestCaseElement[../TestCaseElement[Name='Step-Start'] << . and . >> ../TestCaseElement[Name='Step-End']]">
But I think I should group with key and / or generate-id and use following-sibling and preceding-sibling
My desired output: I want to have all the Content that is precise covered by the Start and End Element.
It is not clear how to ask for the Name Start because this is one tier under the TestCaseElement wich i want to "group"?
How can I access each group if they is available some day.