1

Id like to grab the text values from multiple instance of the same XPATH which occur in different parts of an XML document. Example:

<explanation>
<NodeExplanations>
    <IDAfterSkipProcessing>/Temporary/EIC/EarnedIncomeWorksheetPP/SpouseLongSESelfEmploymentTaxAmtNotBlank</IDAfterSkipProcessing>
    <NodeExplanation>
        <Title>Spouse's self-employment tax</Title>
        <Phrase>
            <Text>your spouse does not have self-employment tax</Text>
        </Phrase>
        <Question>
            <Text>Why doesn't my spouse have self-employment tax?</Text>
        </Question>
        <ExplanationText>
            <Text>We can't get any more details on </Text>
            <NodeName>
                <Text>your spouse does not have self-employment tax</Text>
            </NodeName>
            <Text> right now.</Text>
        </ExplanationText>
    </NodeExplanation>
<NodeExplanations>  
</explanation>

I'd like to parsed out:

1. "We can't get any more details on "
2. "your spouse does not have self-employment tax"
3. " right now."

How can I grab the text values from the XPATHs mentioned? I want to avoid using DOM

mosawi
  • 1,283
  • 5
  • 25
  • 48

0 Answers0