Jump to content

Xml Error With Cdata (?)


kvnmck18

Recommended Posts

I am receiving the following error:

Warning: DOMDocument::loadXML() [domdocument.loadxml]: Input is not proper UTF-8, indicate encoding ! Bytes: 0xBB 0x20 0x26 0x72 in Entity
from the following element:
<title><![CDATA[Blog test3& <>]]></title>

Is there a reason why this code is happening? Isn't this code if I am mixting UTF-8 and ISO-8859-1 - but the content is very basic html characters in a CDATA.Then a couple lines down I have:

	<meta>	  <![CDATA[   1.  »   2. dfsdfdsf   3. &   4. <   5. >]]>	</meta>

And this contains no errors at all.Is there some kind of "hidden character" in my whitespace?

Link to comment
Share on other sites

Seems OK at first read.Is the XML file saved as UTF-8? You know, from Notepad's save window kind of way. If it is... hmm...Try to debug this... like... create a new XML file that will have only those, and try to load that. If the error still occurs, strip out one of the elements (the meta I suppose), and check again. If there's still an error, remove the other element too, and leave only the root element. If the error is no longer present, add that lastly removed element, and strip down characters one by one, and trying it until you find the problematic character(s).Even if you had a hidden whitespace character, I believe UTF-8 tolerates them.

Link to comment
Share on other sites

<Items>  <Item>	<title><![CDATA[»]]></title>	<subtitle><![CDATA[»]]></subtitle>  </Item></Items>

Here's the full code - I extracted it. For some reason it adds "Â" in front of the "raquo"-- I don't know where this is coming from. When I remove the "Â" it gives me the following error:

An invalid character was found in text content. Error processing resource
Have you ever seen this? Is there a work-around?
Link to comment
Share on other sites

I've never seen this... especially when the document is valid UTF-8 (you did checked that out, right?!?!).The only workaround I can think of is the same as with any invalid in an encoding character - use an entity. Escape the text into entities, and forget about CDATA.

Link to comment
Share on other sites

It is valid UTF-8, test it yourself. It's weird.What's weird is that character doesn't post when you disable-output-escaping="yes"XML CDATA bugggggggggg?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...