SimpleXML not recognizing predifined XML entities

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
pedrotuga
Forum Contributor
Posts: 249
Joined: Tue Dec 13, 2005 11:08 pm

SimpleXML not recognizing predifined XML entities

Post by pedrotuga »

I am not quite getting this behaviour, isn't it part of the XML specification itself should handle the five predefined entities?

I have this in my XML file

Code: Select all

 
<?xml version="1.0"?>
<xml>
  <el attr="<&rt;">
  </el>
</xml>
 
then when i try to load it into a SimpleXML object like this:

Code: Select all

simplexml_load_file('test.xml');
I get this error

Code: Select all

parser error : Entity 'rt' not defined
What am I missing in here?
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: SimpleXML not recognizing predifined XML entities

Post by requinix »

&rt; is not an entity. Are you thinking of >?
User avatar
pedrotuga
Forum Contributor
Posts: 249
Joined: Tue Dec 13, 2005 11:08 pm

Re: SimpleXML not recognizing predifined XML entities

Post by pedrotuga »

I was :banghead: :banghead: :banghead:

Thank you
Post Reply