The xml_parser_set_option() function sets options for XML parsing.
If successful, the function returns TRUE. If it fails, returns FALSE.
xml_parser_set_option(parser,option,value)
parameter | describe |
---|---|
parser | Required. Specifies the XML parser to use. |
option | need. Specifies the options to set. Possible values: XML_OPTION_CASE_FOLDING - Specifies whether case-folding is allowed. Default is allowed. Can be 1 (TRUE) or 0 (FALSE). XML_OPTION_SKIP_TAGSTART - Specifies the number of characters that should be skipped at the beginning of a tag name. XML_OPTION_SKIP_WHITE - Specifies whether values consisting of space characters should be skipped. Can be 1 (TRUE) or 0 (FALSE). XML_OPTION_TARGET_ENCODING - Specifies which target encoding to use in the XML parser. By default, it has the same settings as the xml_parser_create() function, and the target encodings it supports are: ISO-8859-1, US-ASCII and UTF-8. |
value | necessary. Specifies the new value of the option. |
<?php$xmlparser = xml_parser_create();xml_parser_set_option($xmlparser, XML_OPTION_SKIP_WHITE, 1);xml_parser_free($xmlparser);?>