note 42440 deleted from function.domxml-open-file by nlopess
| From: | nlopess@php.net | Date: | Mon, 17 May 2004 18:51:17 +0000 |
| Subject: | note 42440 deleted from function.domxml-open-file by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-69729@lists.php.net to get a copy of this message | ||
Note Submitter: muramas@no.cyberdiscordia.spam.org
----
There are apparently several options you can pass (bitwise ANDed) as the second argument (a subset
of the libxml2 parser options); below is a list of defined constants from php_domxml.c:
#define DOMXML_LOAD_PARSING 0
#define DOMXML_LOAD_VALIDATING 1
#define DOMXML_LOAD_RECOVERING 2
#define DOMXML_LOAD_SUBSTITUTE_ENTITIES 4
#define DOMXML_LOAD_COMPLETE_ATTRS 8
#define DOMXML_LOAD_DONT_KEEP_BLANKS 16
In addition to the use of DOMXML_LOAD_VALIDATING mentioned earlier, you might find
DOMXML_COMPLETE_ATTRS useful in simplifying your code; if an attribute in your document is missing
an attribute (from the DTD), the parser will set it to the DTD default. With a well-defined DTD,
this means you won't have to check for empty attributes or set default ones in your code.