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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:26:17+00:00 2026-06-04T04:26:17+00:00

I have a large XML file, in which every nodes requires a CDATA tag.

  • 0

I have a large XML file, in which every nodes requires a CDATA tag.

<root>
    <a>
        <id>my_id</id>
        <tr><![CDATA[This is the data]]></tr>
    </a>
    <b>
        ...
    </b>
</root>

How to avoid to place CDATA in every node? Does DTD or Schema provide a method for this?

The reason for this requirement comes from a in-house framework, for localization purposes. All tags which contain the messages are to be CDATA’d, because very often they contain special characters. The XML I wrote was just for demonstration purposes and does not represent the actual data that I handle.

  • 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-04T04:26:18+00:00Added an answer on June 4, 2026 at 4:26 am

    How to avoid to place CDATA in every node? Does DTD or Schema provide
    a method for this?

    No… DTD or Schema is no help to your problem.

    The reason for this requirement comes from a in-house framework

    Well… Of course the XML parser which parses the document knows whether the section was an CDATA-section or not. This is also represented in the DOM by distinguishing between the interface CDATASection and the interface Text. So it is very easy for someone who writes an XML parser to enforce the use of CDATA-sections instead of just plain text sections. In 99.9% of the cases this is plain stupid and you should not check for that. But on the other hand I have seen so many stupid things in my life, that I would not at all be surprised if your in-house framework does just that and enforce the existence of CDATA-sections.

    If this is the case (just try it), then you have to write the CDATA sections and be happy with that. If you are not happy with that after all you can write a script that transforms your XML adding these CDATA-sections.

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

Sidebar

Related Questions

I have a very large XML file which has like 40000 data, and when
I have a large XML file which in the middle contains the following: <ArticleName>Article
I have a large xml file that looks like this: 20120124 07:30:15.301, saving to
I have a Hibernate hbm.xml mapping file which defines a large number of class
I have a very large xml file which I load as a string so
I have a large XML data file (>160M) to process, and it seems like
I have a XSLT which will split large xml file into multiple xml file
I have a very large xml file which I have stored in a longtext
I have a large XML file which is arranged like so: <item><title>...</title><link>...</link></item> How can
I have this large XML file. There is a field that I want to

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.