I'm trying to construct an XPath and it is giving me trouble. I have
Quote:
an XML that contains a "Routine". The routine contains "Steps". The
Quote:
steps have different types. Some types of steps have more steps
Quote:
contained within them (substeps). I want to get a list of all of the
Quote:
steps in a routine, including any substeps...but excluding substeps
Quote:
that occur in a particular type of step ("Subroutine").
//Step[not(ancestor::Type[. = ' Subroutine '])]
Cheers,
Dimitre Novatchev
"oopsatwork" <mkimberlin@gmail.comwrote in message
news:e5de478f-0f92-43e1-b5d2-893d6414703b@d77g2000hsb.googlegroups.com...
Quote:
I'm trying to construct an XPath and it is giving me trouble. I have
an XML that contains a "Routine". The routine contains "Steps". The
steps have different types. Some types of steps have more steps
contained within them (substeps). I want to get a list of all of the
steps in a routine, including any substeps...but excluding substeps
that occur in a particular type of step ("Subroutine").
>
Below is a simplified example XML. The query I envision would return
all of the steps in the routine, including substeps found in the
"Loop" step type and "Condition" step type...but NOT including any
steps that are anywhere within a "Subroutine" step.
>
Any thoughts? My sincerest thanks in advance!
>
-----
>
<Routine>
<Steps>
<Step>
<Type>Calculation</Type>
<Other>stuff</Other>
</Step>
<Step>
<Type>Loop</Type>
<Steps>
<Step>
<Type>Calculation</Type>
<Other>stuff</Other>
</Step>
<Step>
<Type>Loop</Type>
<Steps>
<Step>
<Type>Calculation</Type>
<Other>stuff</Other>
</Step>
</Steps>
</Step>
</Steps>
</Step>
<Step>
<Type>Calculation</Type>
<Other>stuff</Other>
</Step>
<Step>
<Type>Condition</Type>
<TrueSteps>
<Step>
<Type>Calculation</Type>
<Other>stuff</Other>
</Step>
<Step>
<Type>Loop</Type>
<Steps>
<Step>
<Type>Calculation</Type>
<Other>stuff</Other>
</Step>
</Steps>
</Step>
</TrueSteps>
<FalseSteps>
<Step>
<Type>Calculation</Type>
<Other>stuff</Other>
</Step>
</FalseSteps>
</Step>
<Step>
<Type>Calculation</Type>
<Other>stuff</Other>
</Step>
<Step>
<Type>Subroutine</Type>
<Steps>
<Step>
<Type>Calculation</Type>
<Other>stuff</Other>
</Step>
<Step>
<Type>Loop</Type>
<Steps>
<Step>
<Type>Calculation</Type>
<Other>stuff</Other>
</Step>
</Steps>
</Step>
</Steps>
</Step>
</Steps>
</Routine>