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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T16:33:25+00:00 2026-06-07T16:33:25+00:00

I am trying to parse this xml and can successfully get the name and

  • 0

I am trying to parse this xml and can successfully get the name and description but putting together the image is tricky. Both separate code parses work but I’d like to do one parse so I can bind them all to one listbox.

The xml looks like this

<stickers>
    <sticker>
        <imageData>
            <baseImageUrl> ... want this  </baseImageUrl>
            <sizes>
                <size>  don't care about this </size>
            </size>
            <imageUrlSuffix> ..want this </imageUrlSuffix>
        </imageData>
        <description>.... want this </description>
        <name>  --want this </name>
    <sticker>
<stickers>

My code works for both but separately. How do I combine this into one parse…

XDocument streamFeed = XDocument.Load(new StringReader(response.Content));
var imagedata = from query in streamFeed.Descendants("sticker").Elements("imageData")
    select new Stickers
    {
        image = (string)query.Element("baseImageUrl") + "huge" + (string)query.Element("imageUrlSuffix"),
    };


var data = from query in streamFeed.Descendants("sticker")
    select new Stickers
    {
        name = (string)query.Element("name"),
        description = (string)query.Element("description"),   
    };

stickersListBox.ItemsSource = imagedata.Union(data);

The data displays in the listbox but with the stickers above the description and not side by side.

Thanks


Thanks to Thomas below, the following code works but some user profiles get a Null Referenced Exception (including my own profile which obviously has data) Thanks Thoamas for the assistance perhaps this is an unrelated bug?

XDocument streamFeed = XDocument.Load(new StringReader(response.Content));

                    var query =
                        from sticker in streamFeed.Root.Descendants("sticker")
                        let imageData = sticker.Element("imageData")
                        select new Stickers
                        {
                            name = (string)sticker.Element("name"),
                            description = (string)sticker.Element("description"),
                            image = (string)imageData.Element("baseImageUrl") + "huge" + (string)imageData.Element("imageUrlSuffix")
                        };

                    stickersListBox.ItemsSource = query;
  • 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-07T16:33:27+00:00Added an answer on June 7, 2026 at 4:33 pm

    If I understood the question correctly, this should do what you want:

    XDocument streamFeed = XDocument.Load(new StringReader(response.Content));
    var query =
        from sticker in streamFeed.Root.Elements("sticker")
        let imageData = sticker.Element("imageData")
        select new Stickers
        {
            name = (string)sticker.Element("name"),
            description = (string)sticker.Element("description"),   
            image = (string)imageData.Element("baseImageUrl") + "huge" + (string)imageData.Element("imageUrlSuffix")
        };
    
    stickersListBox.ItemsSource = query;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i'm trying to parse this xml file but i can't find a way to
I'm trying to parse this XML I want to get a list of all
Trying to parse some XML but apparently this is too much for a lazy
I am trying to parse some XML, however, I get the error above this
So, i'm trying to parse some xml that looks this way: <image size=extralarge> http://...
I'm trying to parse the xml response of http://api.hostip.info/?ip=12.215.42.19 with SimpleXML but I can't
I'm trying to validate an XML file, but I get the following error: Can
I am trying to figure out how I can parse this xml : <item>
I'm trying to parse this XML string: <?xml version=1.0 encoding=UTF-8 standalone=no?> <response type=success> <lots>
I am beginner in PHP. I am trying to parse this xml file. <relationship>

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.