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

  • Home
  • SEARCH
  • 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 1098687
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T00:36:59+00:00 2026-05-17T00:36:59+00:00

I am trying to bind a CData element to a text box, in code.

  • 0

I am trying to bind a CData element to a text box, in code.
the xml structure is like this:

<Music>
<Category>
<Albums>
 <![CDATA[
    <AlbumData>
      <Album>
          <id>A1</id>
          <Artist>artist 1</Artist>
      </Album>
      <Album>
          <id>A2</id>
          <Artist>artist 2</Artist>
      </Album>

    </AlbumData>
  ]]>
   </Albums>

  </Category>

 </Music>

How can I bind the Artist to a textbox? I want to make it a two-way binding.

  • 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-17T00:37:00+00:00Added an answer on May 17, 2026 at 12:37 am

    To get the XML that has for some insane reason been embedded into a CDATA section by your customer, you can do the following:

    XDocument xd = XDocument.Load("music.xml")
    XElement albumData = XElement.Parse(xd.Root.Element("Category").Element("Albums").Value);
    

    From there you can use the xml in an XmlDataProvider and use XPath to get to the artist’s name and display it in a TextBox.

    I think in your case (a desire to have two way access) it will be easier in the long run to create backing class (model and viewmodel) and then create them from the extracted XML. From those, instead of an XmlDataProvider, you set the DataContext of the window to the viewmodel.

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

Sidebar

Related Questions

I'm trying to bind column visibility to that of another element like this: <Window
I am trying to bind the Text of a TextBox named 'txtImage' to an
Trying to bind a String to a RichTextBox.Text property so that when the String
I am trying to bind a listview item to a member of a structure,
I am trying to bind a TextBlock 's Text property by converting the Total
I'm trying to bind a 1-many mapping using KnockoutJS, where 1 zip code can
I'm trying to bind a <ul> element to a property that is an observableArray
I'm trying to bind a XML to POJOs using Simpleframework but it doesn't work
I'm trying to bind a list of integers into an SQLTemplate IN clause like
I'm trying to bind a list of custom objects to a WPF Image like

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.