[TYPO3-dev] PHP5 xmlReader and entities
Elmar Hinz
elmar.DOT.hinz at team.MINUS.red.DOT.net
Wed Jul 4 20:24:52 CEST 2007
ries van Twisk wrote:
> 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?
>
> ======================================
> 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">
> ======================================
>
>
> Ries
>
Thank you Ries, you seem to be more successfull in unsing search engines.
Meanwhile I also discovered the hot lines within the few comments on
typo3.org:
$xml = new XMLReader();
$xml->open("example.xml");
$xml->setParserProperty(XMLReader::LOADDTD, TRUE);
$xml->setParserProperty(XMLReader::VALIDATE, TRUE);
This is the trick that does it for me: As soon as I set the first property
line (LOADDTD) the warnings are gone and the output comes.
I didn't need to set up a dtd explicitly, like suggested above. On Ubuntu I
found a package w3c-dtd-xhtml wich seems to contain the required DTD, but I
didn't need to install it so far.
Still the entity is lost in my output, but that's a completely different
matter ...
Have a nice evening
Elmar
More information about the TYPO3-dev
mailing list