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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:24:17+00:00 2026-06-11T13:24:17+00:00

I am re-wording my question because the ‘parsed entity’ thing has nothing to do

  • 0

I am re-wording my question because the ‘parsed entity’ thing has nothing to do with the problem at hand.

XML 1.1 versus 1.0

Is an xml 1.1 library is to escape illegal characters before serializing/deserializing them? Or is the library is to forbid them outright? Which is the correct way to set Text on an xml element?

if Element e = new Element(“foo”)

Should I do this:

e.setText(sanitized_text_illegal_characters_removed_or_escaped) ?

or

e.setText(any_text)

  • 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-11T13:24:18+00:00Added an answer on June 11, 2026 at 1:24 pm

    A parsed entity is something you don’t really need to worry about unless you’re writing an XML parser. It’s things like < and &. You can define your own in the document DTD, but it’s a rarely used feature. An external parsed entity is one whose contents reside in another file or network resource or somewhere like that.

    As to your main question:

    Which is the correct way to set Text on an xml element?

    if Element e = new Element(“foo”)

    Should I do this:

    e.setText(string_of_sanitized_data_with_illegal_characters_escaped) ?

    or

    e.setText(any_text)

    You should set the text as you would like it to come out the other end, when the document is deserialized. This normally means you should not escape the data, and the XML library will do this for you.

    e.g.:

    1. You insert the text “bed & breakfast”.
    2. The XML library converts this to “bed &amp; breakfast” or “<![CDATA[bed & breakfast]]>” or some other representation, it doesn’t really matter.
    3. You send the document somewhere else.
    4. The other parser reads the document and converts the text back.
    5. The end software retrieves the string “bed & breakfast”.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a wierd problem. This will be a terrible question because I have
Sorry about the wording of the question, I don't really know how to put
Sorry about the wording for my question title. I have a basic HTML anchor
UPDATE: I've changed the wording of the question. Previously it was a yes/no question
I'm sure this was asked somewhere in another question, but the wording used there
Edit: I'm rewriting this question because I apparently wasn't clear. Sometimes the GPS service
(i changed question because i discovered this conflict) http://pedroversolato.com/EASB (the page im working on)
It could seem a stupid question because in my code everything is working, but
This looks like a long question because of all the context. There are 2
I was confused about the wording of a particular exam question about hash tables.

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.