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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T03:48:40+00:00 2026-06-10T03:48:40+00:00

I am trying to parse an XML with CDATA elements…my below code blows up

  • 0

I am trying to parse an XML with CDATA elements…my below code blows up if content in CDATA is xml encoded…is there any way i can decode all the xml before i parse..

—Code to parse

if (formText.FirstNode.NodeType == XmlNodeType.CDATA)
{ return formText.Value; }
else { throw new applicatinException("ERROR")}

this code works if formText has

  "<Text><![CDATA[Sample Text<b>BoldText </b>]]></m:FormText>"

but blows up if formText has (encoded values)

  "<Text>&lt;[CDATA[Sample Text &lt;b&gt;BoldText&lt;/b&gt; ]]&gt;</m:FormText>"
  • 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-10T03:48:41+00:00Added an answer on June 10, 2026 at 3:48 am
    "<Text>&lt;[CDATA[Sample Text &lt;b&gt;BoldText&lt;/b&gt; ]]&gt;</m:FormText>"
    

    This is not a CDATA segment, it is a text segment. You will have to handle it as basic text and handle extracting the CDATA information yourself. By encoding the CDATA information, you have made it no longer match that format.

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

Sidebar

Related Questions

I am trying to parse XML with jsoup, but I can't find any examples
I'm trying to parse CDATA tpyes in XML. The code runs fine and it
I have an xml feed at this url Now im trying parse the content,
I'm trying to parse a XML, <entry> <title type=html><![CDATA[TITLE]]></title> </entry> Using Hpple, I'm trying
I am trying to figure out a way to parse an xml tag where
I am trying to figure out how I can parse this xml : <item>
I was wondering if there is any way to escape a CDATA end token
I am trying to parse XML files using Nokogiri, Ruby and XPath. I usually
I'm trying to parse xml done like this: <foreign lang=gre>&lsquo;<LM lemma=auieo catg=fg>auieo</LM>&rsquo;</foreign> I'm using
Trying to parse some XML but apparently this is too much for a lazy

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.