XML parsing error: undefined entity - special characters

Why is there an error displaying XML on some special characters, and some are okay?

For example, an error will be generated below,

<?xml version="1.0" standalone="yes"?>
<Customers>
    <Customer>
        <Name>L&ouml;ic</Name>
    </Customer>
</Customers>

but it normal,

<?xml version="1.0" standalone="yes"?>
<Customers>
    <Customer>
        <Name>&amp;</Name>
    </Customer>
</Customers>

I am converting a special character through php - htmlentities('Löic',ENT_QUOTES). By the way

How can I get around this?

Thank.

EDIT:

I found that it works fine if I use a numeric character like L&#243;ic

now I have to find how to use php to convert special characters to numeric characters!

+5
source share
2 answers

The XML specification, there are five objects - &amp;, &lt;, &gt;, &apos;and&quot;

, DTD HTML.

HTML XML.

, , , ( :

  • , UTF-8
  • , , UTF-8
  • , , UTF-8
  • , , HTTP , UTF-8 ( XML UTF-8 , - )

)

+17

, DTD.

+3

All Articles