Another DOMDocument question

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I create a document using $xmlDoc = new DOMDocument, and then create
some elements, add them to the document, and when it's time to save, I
use $xmlDoc->saveXML(). I am seeing things like this:


in the saved document. Is this XML encoding, or is it some sort of
mixing up the translation from some code page to another (for instance
LATIN to utf8)..

Any ideas?

Re: Another DOMDocument question

Quoted text here. Click to load it

Those are encoded HTML special charaters
&lt; - "<" (lesser than)
&gt; - ">" (greater than)

But, I don't know why are they encoded in your case ... Maybe this
"add to the document" encodes HTML special charaters, but that's a
guess since you haven't provide any source code.


Re: Another DOMDocument question

El 09/12/2009 18:08, JustWondering escribió:
Quoted text here. Click to load it

You haven't created the elements you think. You possibly have inserted
them as text.

-- - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web:
-- Mi web de humor satinado:

Re: Another DOMDocument question

On Thu, 10 Dec 2009 09:35:15 +0100, Álvaro G. Vicario wrote:
Quoted text here. Click to load it

And possibly overly-sanitized them someplace along the way...

57. Before employing any captured artifacts or machinery, I will
    carefully read the owner's manual.
    --Peter Anspach's list of things to do as an Evil Overlord

Site Timeline