Re: Entity 'reg' not defined

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Oct 22, 2010 at 1:19 PM, TR Shaw <tshaw@xxxxxxxx> wrote:

>
> On Oct 22, 2010, at 12:03 PM, Adam Richardson wrote:
>
> > On Fri, Oct 22, 2010 at 11:47 AM, TR Shaw <tshaw@xxxxxxxx> wrote:
> >
> >> Anyone have an idea how to work around this? I tried:
> >>
> >> define ('reg', '®');
> >> define ('&reg;', '®');
> >>
> >> can't figure how to override the entity table.  Errors follw:
> >>
> >> Warning: simplexml_load_string():
> >>
> o.cc/46/e53d68e007fd45c2fccb502f2e7ccad5.php?user_id=47&amp;sub_id=61862469&reg
> ;
> >> in checkifup.php on line 5119
> >>
> >> Warning: simplexml_load_string():
> >>                                     ^ in checkifup.php on line 5119
> >>
> >> Warning: simplexml_load_string(): Entity: line 220: parser error :
> Entity
> >> 'reg' not defined in checkifup.php on line 5119
> >>
> >> Warning: simplexml_load_string():
> >>
> /office/e53d68e007fd45c2fccb502f2e7ccad5.php?user_id=47&amp;sub_id=89877485&reg;
> >> in checkifup.php on line 5119
> >>
> >>
> >> --
> >> PHP General Mailing List (http://www.php.net/)
> >> To unsubscribe, visit: http://www.php.net/unsub.php
> >>
> >>
> > Does doing a str_replace and changing it to the corresponding entity
> number
> > (&#174;) before parsing with simple_xml work?
> >
> > Here's a more robust function:
> >
> http://www.sourcerally.net/Scripts/39-Convert-HTML-Entities-to-XML-Entities
> >
>
> Thanks Adam I know I can read and deal with it befor passing to the parser
> but I thought that was klugie unless that's the only workaround I can find.
>
> Tom
>
>
>
XML only has 5 pre-defined entity references:
http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references

Although you can entities via a DTD, SimpleXML is not DTD aware, so this
won't work.  That's why you'll have to use the numeric character reference.

Sorry,

Adam

-- 
Nephtali:  PHP web framework that functions beautifully
http://nephtaliproject.com

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux