Well-formed character data or markup

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
BigAbe
Forum Commoner
Posts: 66
Joined: Fri Mar 31, 2006 7:41 pm

Well-formed character data or markup

Post by BigAbe »

I am getting this error message, and I have no clue as to it's meaning.
The content of elements must consist of well-formed character data or markup.
If someone could shed some light, I'd be greatly appreciative!

-- Abe --
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

What type of error is it? What are you trying to do? Hard to say without seeing any code ;)
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

It looks like XML (RSS, perhaps?). Are you sure you entity-ized your quotes and ampersands?
BigAbe
Forum Commoner
Posts: 66
Joined: Fri Mar 31, 2006 7:41 pm

Post by BigAbe »

hawleyjr wrote:What type of error is it? What are you trying to do? Hard to say without seeing any code ;)
I'm bringing html into an xml environment. Not by choice.
It looks like XML (RSS, perhaps?). Are you sure you entity-ized your quotes and ampersands?
Could you please explain "entity-ized"?

-- Abe 00
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

You may want to read up on htmlentities() and related functions.
(#10850)
BigAbe
Forum Commoner
Posts: 66
Joined: Fri Mar 31, 2006 7:41 pm

Post by BigAbe »

arborint wrote:You may want to read up on htmlentities() and related functions.
So basically, I'm going to have to recode everything based upon htmlentities if I want this to work? Ouch.
BigAbe
Forum Commoner
Posts: 66
Joined: Fri Mar 31, 2006 7:41 pm

Post by BigAbe »

Ambush Commander wrote:It looks like XML (RSS, perhaps?). Are you sure you entity-ized your quotes and ampersands?
Do I need to entity-ize my quotes and ampersands in the html code or the output as well?

By that I mean, do I have to do anything to the following instances:

Code: Select all

<img src="images89.jpg">
Do I need to change these quotes?

Code: Select all

<a href="index.php?var=1&var2=2">
would I need to convert these ampersands in the link?
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

Once again, it depends on context. If the XML dtd doesn't permit HTML like tags, yes, they will all have to be entity-ized in order to maintain info. The processing applciation will then grab the data and reparse it.

CDATA sections can be quite convenient in cases like this.
Post Reply