Linq to XML question

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
I have a xml file like this:
<pre class="prettyprint <User xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema
<UserName>asd</UserName>
<Password>123</Password>
<Email>asdf@asd.com</Email>
</User>[/code]
<br/>
Some user elements contain Avatar element, but some doesnt contain, like above. How to query out the Password value and the Avatar value? Not all the User has the Avatar element, if dont have, assign it a null value.
Anyone can help?

View the full article
 
Back
Top