Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1081291
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:09:01+00:00 2026-05-16T22:09:01+00:00

<Response SessionId=55C10AC0E63B44FCB1868FF4B49E6DF7 xmlns=http://MySample.Sample.com/Sample.xsd> <Status Success=true Message=OK ErrorCode=0 /> <Data> <List Name=My.API.Customer.Customers Type=My.API.Customer.Customers> <Item Key=12345678-0

  • 0
<Response SessionId="55C10AC0E63B44FCB1868FF4B49E6DF7" xmlns="http://MySample.Sample.com/Sample.xsd">
  <Status Success="true" Message="OK" ErrorCode="0" /> 
  <Data>
  <List Name="My.API.Customer.Customers" Type="My.API.Customer.Customers">
    <Item Key="12345678-0" State="Unchanged">
    <Value Name="MasterCustomerId" Value="12345678" /> 
     <Value Name="SubCustomerId" Value="0" /> 
    <Value Name="IsAbstractAuthor" Value="False" /> 
    <Value Name="LastFirstName" Value="Cal, Duke" /> 
    <Value Name="IsAbstractReviewer" Value="False" /> 
    <Value Name="NamePrefix" Value="" /> 
    <Value Name="FirstName" Value="Cal" /> 
    <Value Name="MiddleName" Value="" /> 
    <Value Name="LastName" Value="Duke" /> 
    <Value Name="NameSuffix" Value="" /> 
    <Value Name="NameCredentials" Value="" /> 
    <Value Name="SearchName" Value="DUKE;CAL" /> 
    <Value Name="LabelName" Value="Cal Duke" /> 
    <Value Name="FormalSalutation" Value="Mr. Duke" /> 
    <Value Name="IsCustomerStatusActive" Value="True" /> 
    <Value Name="OrganizationId" Value="" /> 
    <Value Name="OrganizationUnitId" Value="" /> 
    <Value Name="RecordType" Value="I" /> 
    <Value Name="CanPlaceOrderFlag" Value="True" /> 
    <Value Name="CanCreateSegmentsFlag" Value="False" /> 
    <Value Name="BillPrimaryAccountFlag" Value="True" /> 
    <Value Name="Nickname" Value="" /> 
    <Value Name="InformalSalutation" Value="Cal" /> 
    <Value Name="CustomerClassCode" Value="INDIV" /> 
    <Value Name="CustomerStatusCode" Value="ACTIVE" /> 
    <Value Name="CustomerStatusDate" Value="8/9/2010 4:17:23 PM" /> 
    <Value Name="AllowFaxFlag" Value="True" /> 
    <Value Name="AllowEmailFlag" Value="True" /> 
    <Value Name="AllowPhoneFlag" Value="True" /> 
    <Value Name="AllowLabelSalesFlag" Value="True" /> 
    <Value Name="AllowSolicitationFlag" Value="True" /> 
    <Value Name="AllowInternalMailFlag" Value="True" /> 
    <Value Name="SolicitationRemovalDate" Value="12:00:00 AM" /> 
    <Value Name="TaxableFlag" Value="True" /> 
    <Value Name="FederalTaxId" Value="" /> 
    <Value Name="VATId" Value="" /> 
    <Value Name="TaxExemptId" Value="" /> 
    <Value Name="Ssn" Value="" /> 
    <Value Name="GenderCode" Value="M" /> 
    <Value Name="BirthDate" Value="12:00:00 AM" /> 
    <Value Name="EthnicityCode" Value="99" /> 
    <Value Name="AnnualIncomeRangeCode" Value="" /> 
   </Item>
 </List>
    </Data>
</Response>

If I have C# class called SampleUser with properties for FirstName,LastName etc., how can I use linq-to-Xml and get the values from the XML to be assigned to the appropriate C# class properties.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T22:09:02+00:00Added an answer on May 16, 2026 at 10:09 pm

    The descendants of Item all having the same ID sort of makes this difficult for Linq-to-XML (from a code-bloating standpoint), but not impossible.

    A short example to get you started is this

    XDocument document = XDocument.Parse(xml);
    XNamespace ns = "http://MySample.Sample.com/Sample.xsd";
    
    var sampleUsers = from item in document.Root.Element(ns + "Data").Element(ns + "List").Elements(ns + "Item")
                      select new SampleUser
                      {
                          FirstName = item.Elements(ns + "Value").First(v => v.Attribute("Name").Value.Equals("FirstName")).Attribute("Value").Value,
                          LastName = item.Elements(ns + "Value").First(v => v.Attribute("Name").Value.Equals("LastName")).Attribute("Value").Value
                      };
    

    It would be far better if the XML was like

    <Item>
      <FirstName>Bob</FirstName>
      <LastName>Smith</LastName>
    </Item>
    

    Perhaps you can explore a transformation to actually get there.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

` XElement config = XElement.Parse ( @<Response SessionId='426D9AEB1F684849A16D79A6CF48582B' xmlns='http://schemas.tmaresources.com/timssws60.xsd'> <Status Success='true' Message='Connected' ErrorCode='0' />
I have a json response like: { total: 2, success: true, rows: [ {a1_id:7847TK10,
How can i parse this url which gives Json response ? $.getJSON('http://url.php?id=chat_init&sess_d='+sessionID+'&user_id='+document.getElementById(user_id).value+ '&to_id='+document.getElementById(to_id).value,function (data)
I'm trying to decode a selenium server's response. The server returns: {sessionId:null,status:0,value:{os:{arch:amd64,name: Windows Server
The response data in my test has this line: <head><title> My Title </title><meta charset
I know all about this exception, read the msdn article here http://support.microsoft.com/kb/312629/EN-US/ but I
I am trying to upload data as multipart using RestClient like so: response =
This web page http://www.w3schools.com/ASP/prop_sessionid.asp states that a session ID is generated on the ServerSide.
I'm validating the form data as the response I'm getting total feed of that
i need to parse that response take from: $client->__getLastResponse(); uuid:9e0096e0-de0f-11e1-8035-e656d1754971 http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous 0 ContentType text/xml

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.