I have an XML:
<?xml version="1.0" encoding="UTF-8"?>
<ticket>
<comments type="array">
<comment>
<attachments type="array">
<attachment>
<url>I NEED WHATEVER IS IN HERE</url>
</attachment>
</attachments>
</comment>
<comment>
<attachments type="array">
<attachment>
<url>I NEED WHATEVER IS IN HERE</url>
</attachment>
</attachments>
<comment>
</comments>
</ticket>
How would I go about getting whatever is inside the URL tag and add it to a <List>? I’m using C#.
Use:
Or using XPath:
To retrieve text only from
urlelement use:or change above XPath:
//url/text()