|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
DOMDocument::loadCharacterEntitiesFromDtd($path);
I like to load character entities (not whole document type definition). When I try to do that by creating my own DTD with only character entities, and setting resolveExternals to true, then DTD parser complains that it didn't occur root definition. The proposed method, if called before DOMDocument::load/loadXML(), would get character entities from DTD (and its modules) and apply them during parsing XML. If called multiply, or if XML contains a DTD reference, entities put before would be overwritten. // I sent this post to php.xml.dev, but I didn't get reply for long time. -- Freyjkell |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
Freyjkell wrote:
> DOMDocument::loadCharacterEntitiesFromDtd($path); > > I like to load character entities (not whole document type definition). > > When I try to do that by creating my own DTD with only character > entities, and setting resolveExternals to true, then DTD parser > complains that it didn't occur root definition. > > The proposed method, if called before DOMDocument::load/loadXML(), would > get character entities from DTD (and its modules) and apply them during > parsing XML. If called multiply, or if XML contains a DTD reference, > entities put before would be overwritten. > > // I sent this post to php.xml.dev, but I didn't get reply for long time. > A day or two is not a long time and some things are not cut and dry, requiring a little time to think about it. If you want to override the DTD, you should look at using catalogs or create a custom stream handler to alter the XML document as it is parsed. Rob |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
Freyjkell wrote:
> DOMDocument::loadCharacterEntitiesFromDtd($path); > > I like to load character entities (not whole document type > definition). > Whilst we're on this subject - where do you guys normally load character entities from? I recently ported some stuff from the PHPH4 XSLT implementation (with saxon) to PHP5, and I seem to recall having problems with getting entities defined. /Per Jessen, Zürich |
|
![]() |
| Outils de la discussion | |
|
|