0

I'm trying to import an XML file but there is a character that is not not being accepted by PHP.

The only non-standard characters I am seeing are the @ symbol and some encoded characters &lt; for < &gt; for > and &amp; for &. Does XML have a hard time understanding any of these?

2 Answers 2

1

In an XML document you should always encode the following characters to ensure a proper parsing:

  • < should be encoded as &lt;
  • > should be encoded as &gt;
  • & should be encoded as &amp;
  • ' should be encoded as &#39;
  • " should be encoded as &quot;
0

Remember to check whether the XML header of the document indicates

<?xml version="1.1" ?>

instead of

<?xml version="1.0" ?>

The former supports a wider character set than the latter. But remember that char(0) is always invalid.

See also this answer from user keshlam.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.