1

I have a xml

<MyRoot>
  <ITEM>
    <Created>Customer created Aug 22 2011  9:28AM
Contact Details Last Updated Aug 22 2011  9:39AM</Created>
    <Name>SomeName</Name>
    <Address>High way to hell</Address>
    <Phone1>123456</Phone1>
    <Phone2></Phone2>
    <Mobile>654321</Mobile>
    <Email>[email protected]</Email>
  </ITEM>
</MyRoot>

and it's a value of xdoc ([System.RuntimeType] {System.Xml.Linq.XDocument} System.RuntimeType)

When I execute this:

var items= xdoc.Root.Elements("Item");

i get element of type

{System.Xml.Linq.XContainer+<GetElements>d__11} System.Type {System.RuntimeType}

and with 0 as number of elements.

How can I get collection of items ?

1 Answer 1

5

XML is case-sensitive.

var items= xdoc.Root.Elements("ITEM");
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.