[TYPO3-dev] PHP5 xmlReader and entities

ries van Twisk typo3 at rvt.dds.nl
Wed Jul 4 20:04:57 CEST 2007


Hey Elmar,

I found this answer on teh net. I didn't try it myself:
Would this give you a push into the right direction?

======================================
As many of you may have noticed, DOM parser gives errors if the  
' ' entity is present. The E_WARN message looks like:

Warning: DOMDocument::load() [function.load]: Entity 'nbsp' not  
defined in ...

There're many ways to solve this:
a) The hard way
<xsl:text disable-output-escaping="yes"> &amp;nbsp;</xsl:text>

b) Defining &nbsp;
At the top of the document, after the <?xml?> definition, add:
    <!DOCTYPE xsl:stylesheet [
     <!ENTITY nbsp "&#160;" >
     ]>

c) External Doctype
Just in case you want need other HTML entities, you can call an  
external doctype with the proper definitions

<!DOCTYPE page SYSTEM "http://gv.ca/dtd/character-entities.dtd">

Of course, you can download the file and place it in your server.
======================================


Ries

On Jul 4, 2007, at 12:43 PM, Elmar Hinz wrote:

> Hi,
>
> I want to find out what the PHP5 XMLReader functions are helpfull for.
>
> http://www.php.net/manual/en/ref.xmlreader.php
>
> I use a file with the doctype definition:
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
>         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
>
> As soon as I have an entity like &nbsp; I get errors and the parser  
> breaks.
> Unfortunatly there are still few comments on php.org and my  
> searches on
> google return unspecific results.
>
> parser error : Entity 'nbsp' not defined
>
> Could it be that I need to do an entire setup of DTD catalogues to  
> use this
> PHP extension? I would expect that standards like xhtml DTD are  
> build in.
>
> Does anybody have a clue?
>
> Regards
>
> Elmar
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> _______________________________________________
> TYPO3-dev mailing list
> TYPO3-dev at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-dev





More information about the TYPO3-dev mailing list