I have an XML Element that may contain elements, text or both. For example:
<
testvalue="-360.0"><
testlogic="OR">fcs/heading-error-1 gt 180
fcs/heading-error-2 gt 180
</test>
fcs/heading-error gt 180
fcs/heading-error-3 gt 180
</test>
I'd like to extract the text only from each element - and ONLY the text for that element and not child elements. The XmlElement InnerText and InnerXml members return strings that are not completely what I am looking for. For example, I'd like to get the text for the top-level element as:
fcs/heading-error gt 180 fcs/heading-error-3 gt 180
And, I'd like to retrieve the nested test strings:
fcs/heading-error-1 gt 180
fcs/heading-error-2 gt 180
Notice there are not even any comments there.
Am I correct in thinking that I'm going to have to do a lot of "manual" test processing? Or, is there a better approach?
Jon