XML Help

So I have an xml file and have managed to extract most of the elements thus far except example below.

<fees>
            <document-id lang="EN">              
                <country>EP</country>
                <doc-number>12345678</doc-number>
                <date>20150603</date>                
            </document-id>
            <file-reference-id>XYZ</file-reference-id>            
            <owner>blahblahblah</owner> 
            <fee>
                <type-of-fee>038</type-of-fee>
                <fee-sub-amount>136</fee-sub-amount>
                <fee-factor>1</fee-factor>
                <fine fine-code="098">0</fine>
                <fee-total-amount>136</fee-total-amount>
            </fee>
        </fees>

specifically im after

the EN

and the 098
0
this one I can get the 0 just fine

grafik
xDoc.Root.element("document-id").Attribute("lang").Value

1 Like

 xDoc.Descendants("fine").first().Attribute("fine-code").Value
 "098"
 xDoc.Root.XPathSelectElement("//fine").Attribute("fine-code").Value
 "098"

Perfect thankyou. mangaed to get the lang one myself in the end :slight_smile:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.