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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T05:50:43+00:00 2026-05-24T05:50:43+00:00

<![CDATA[ and ]]> are not allowed inside a <![CDATA[ … ]]> block. That is

  • 0

<![CDATA[ and ]]> are not allowed inside a <![CDATA[ … ]]> block. That is understandable.

Now, I have to transmit user entered data inside a <![CDATA[ … ]]> block. And a malicious user might enter either <![CDATA[ or ]]> or both.

The question is: what is the preferred way to handle this situation?

  • Strip <![CDATA[ and ]]>?
  • Replace it with spaces?
  • Smack the user with an error message?
  • Or is there an official way of actually transmitting them?
  • 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-24T05:50:45+00:00Added an answer on May 24, 2026 at 5:50 am

    I think you are thinking about CDATA sections in the wrong way – CDATA stands for “Character data” and the CDATA syntax is simply syntax for a block of data that shouldn’t be interpreted as markup. CDATA sections are useful for embedding xml documents inside another xml document, however when including character data (i.e. text) in a document it shouldn’t change the meaning of the data if it is enclosed in a CDATA section over simply being encoded as text data (possibly with certain characters escaped).

    The short version of this is that your application shouldn’t care whether the data is encoded as CDATA or not. If the text you are encoding isn’t overly heavy with xml-like syntax then you may be better off simply escaping & and < characters – something that your XML API will probably do for you anyway. For example the InnerText property of XmlNode will escape characters as required.

    If you still want to use CDATA tags (escaping a large xml fragment may overly inflate the size of the resulting document) then you only need to escape the code CDATA syntax fragement (]]>), for example this can be done by simply replacing ]]> with ]]]]><![CDATA[>.

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

Sidebar

Related Questions

I have the following serialization method: Private Function SerializeData(ByVal data As cData) As String
I want to replace some HTML tags that I have in a CDATA element,
it seems that a loose definition of PCDATA and CDATA is that PCDATA is
i have a small problem i have xome xml with a cdata section. This
I have a NumericStepper declared as a UIComponent: <![CDATA[ private var component:UIComponent; component =
Okay. Here's the code. XML Parsing Error: not well-formed <item_to_page_title><![CDATA[Breaking news, real-time scores and
I often find this strange CDATA tag in XML files: <![CDATA[some stuff]]> I have
I have an XML file with some CDATA nodes. I want to change the
I have a code like the one below <mx:Button id=TestingID width=100% height=20> <mx:Script> <![CDATA[
I am not understanding how to get the content of CDATA, I NSString* htmlString

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.