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 8350287
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T08:16:11+00:00 2026-06-09T08:16:11+00:00

I am consuming XML from a third party source but a can’t seem to

  • 0

I am consuming XML from a third party source but a can’t seem to get the xml loaded correctly into a XDocument. It loads it all into one element, and sets the value of it to the rest of the xml.

The xml string looks like this (unformated, read from the responsestream).

<ArticleDetail xmlns="http://schemas.datacontract.org/2004/07/EEL.ArticleDatabase.WebService.Model" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><Approved>false</Approved><ArticleGroupCode>5304</ArticleGroupCode><ArticleGroupName>Standblenders</ArticleGroupName><ArticleNumber>052ASB2600</ArticleNumber><BrandLogoTypeResourceId/><BrandName>Electrolux</BrandName><Denomination>Köksmaskiner ASB2600 Electrolux</Denomination><Description>Exklusiv mixer i borstat stål som enkelt krossar is, 1,6l glaskanna OBS! Levereras som 2-pack</Description><Documents/><Ean>7319590015596</Ean><Id>1649151</Id><Images/><ModelNumber>ASB2600</ModelNumber><PackageQuantity>1</PackageQuantity><Parameters><Parameter><Category>Dimensioner</Category><DataType>long</DataType><Description/><DisplayName>Bredd</DisplayName><Name>Bredd</Name><Priority>1</Priority><Unit>mm</Unit><Value>290</Value></Parameter><Parameter><Category>Dimensioner</Category><DataType>long</DataType><Description/><DisplayName>Djup</DisplayName><Name>Djup</Name><Priority>2</Priority><Unit>mm</Unit><Value>240</Value></Parameter><Parameter><Category>Dimensioner</Category><DataType>long</DataType><Description/><DisplayName>Höjd</DisplayName><Name>Höjd</Name><Priority>3</Priority><Unit>mm</Unit><Value>380</Value></Parameter></Parameters><Published>false</Published><ReplacedByArticleNumber/><ReplacesArticleNumber/><SellText1>Kraftfull - perfekt för att krossa is.</SellText1><SellText2>Glaskanna som rymmer 1,6 liter, med 6-bladigt knivsystem.</SellText2><SellText3>Väldigt enkel rengöring av kanna och knivsystem</SellText3><SellText4/><SellText5/><StatusCode>0</StatusCode><SupplierArticleNumber>ASB2600</SupplierArticleNumber><SupplierCode>150</SupplierCode><SupplierName>Elon Elkedjan Logistic AB</SupplierName><Texts><TextItem><Text>Test</Text><Type>Short</Type></TextItem><TextItem><Text>Elon</Text><Type>Long</Type></TextItem></Texts></ArticleDetail>

And the rest of the code looks like this.

var xDoc = XDocument.Parse(xmlString);

For some reason everything is loaded into the one element and the value is set to.

false5304Standblenders052ASB2600ElectroluxKöksmaskiner ASB2600 ElectroluxExklusiv mixer i borstat stål som enkelt krossar is, 1,6l glaskanna OBS! Levereras som 2-pack73195900155961649151ASB26001DimensionerlongBreddBredd1mm290DimensionerlongDjupDjup2mm240DimensionerlongHöjdHöjd3mm380falseKraftfull - perfekt för att krossa is.Glaskanna som rymmer 1,6 liter, med 6-bladigt knivsystem.Väldigt enkel rengöring av kanna och knivsystem0ASB2600150Elon Elkedjan Logistic ABTestShortElonLong
  • 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-06-09T08:16:12+00:00Added an answer on June 9, 2026 at 8:16 am

    Cannot reproduce; it works fine. I think you are reading it wrong. For example, the following draws out the node names as a tree:

    static void Main()
    {
        string xmlString = @"<ArticleDetail xmlns=""http://schemas.datacontract.org/2004/07/EEL.ArticleDatabase.WebService.Model"" xmlns:i=""http://www.w3.org/2001/XMLSchema-instance""><Approved>false</Approved><ArticleGroupCode>5304</ArticleGroupCode><ArticleGroupName>Standblenders</ArticleGroupName><ArticleNumber>052ASB2600</ArticleNumber><BrandLogoTypeResourceId/><BrandName>Electrolux</BrandName><Denomination>Köksmaskiner ASB2600 Electrolux</Denomination><Description>Exklusiv mixer i borstat stål som enkelt krossar is, 1,6l glaskanna OBS! Levereras som 2-pack</Description><Documents/><Ean>7319590015596</Ean><Id>1649151</Id><Images/><ModelNumber>ASB2600</ModelNumber><PackageQuantity>1</PackageQuantity><Parameters><Parameter><Category>Dimensioner</Category><DataType>long</DataType><Description/><DisplayName>Bredd</DisplayName><Name>Bredd</Name><Priority>1</Priority><Unit>mm</Unit><Value>290</Value></Parameter><Parameter><Category>Dimensioner</Category><DataType>long</DataType><Description/><DisplayName>Djup</DisplayName><Name>Djup</Name><Priority>2</Priority><Unit>mm</Unit><Value>240</Value></Parameter><Parameter><Category>Dimensioner</Category><DataType>long</DataType><Description/><DisplayName>Höjd</DisplayName><Name>Höjd</Name><Priority>3</Priority><Unit>mm</Unit><Value>380</Value></Parameter></Parameters><Published>false</Published><ReplacedByArticleNumber/><ReplacesArticleNumber/><SellText1>Kraftfull - perfekt för att krossa is.</SellText1><SellText2>Glaskanna som rymmer 1,6 liter, med 6-bladigt knivsystem.</SellText2><SellText3>Väldigt enkel rengöring av kanna och knivsystem</SellText3><SellText4/><SellText5/><StatusCode>0</StatusCode><SupplierArticleNumber>ASB2600</SupplierArticleNumber><SupplierCode>150</SupplierCode><SupplierName>Elon Elkedjan Logistic AB</SupplierName><Texts><TextItem><Text>Test</Text><Type>Short</Type></TextItem><TextItem><Text>Elon</Text><Type>Long</Type></TextItem></Texts></ArticleDetail>";
        var xDoc = XDocument.Parse(xmlString);
        Write(xDoc.Root, 0);
    }
    
    static void Write(XElement el, int offset)
    {
        Console.Write(new string(' ', offset));
        Console.WriteLine(el.Name.LocalName);
        foreach (var child in el.Elements())
        {
            Write(child, offset + 1);
        }
    }
    

    I suspect you are accessing xDoc.Root.Value – indeed, what you display is the composed value of the root; but that doesn’t mean the structure is missing. If that isn’t what you wanted, then don’t ask if for that value – walk the structure instead.

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

Sidebar

Related Questions

I have been scouring the net but I can't seem to find any examples
I'm consuming a third-party web service in an ASP.NET webforms application. I simply added
I am having some issues with consuming an XML and applying multiple conditions on
I'm consuming some data using the fogbugz XML API. This API always offers data
when ever i am consuming a web service xml is received and sent right...is
I am consuming the international weather forecasts via Wunderground's XML API: http://wiki.wunderground.com/index.php/API_-_XML Looking at
While consuming SOAP service, I am getting this error. I just dun get it
When consuming a .NET WCF webservice I get the following response (error): Unsupported HTTP
I am consuming a cpp COM object from c# code. My c# code looks
I've got some code to convert a large (many gigabytes) XML file into another

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.