MediaWiki
1.23.0
|
Public Member Functions | |
__construct ( $input, $filterCallback=null, $isFile=true, $options=array()) | |
getRootElement () | |
Get the root element. More... | |
Static Public Member Functions | |
static | newFromFilename ( $fname, $filterCallback=null) |
Alternative constructor: from filename. More... | |
static | newFromString ( $string, $filterCallback=null) |
Alternative constructor: from string. More... | |
Public Attributes | |
$filterMatch = false | |
Will be set to true if the optional element filter returned a match at some point. More... | |
$rootElement = '' | |
Name of the document's root element, including any namespace as an expanded URL. More... | |
$wellFormed = false | |
Will be set to true or false to indicate whether the file is well-formed XML. More... | |
Private Member Functions | |
elementOpen ( $parser, $name, $attribs) | |
getParser () | |
Get an XML parser with the root element handler. More... | |
processingInstructionHandler ( $parser, $target, $data) | |
rootElementOpen ( $parser, $name, $attribs) | |
validateFromFile ( $fname) | |
validateFromString ( $string) | |
Private Attributes | |
$parserOptions | |
Additional parsing options. More... | |
Definition at line 23 of file XmlTypeCheck.php.
string | $input | a filename or string containing the XML element |
callable | $filterCallback | (optional) Function to call to do additional custom validity checks from the SAX element handler event. This gives you access to the element namespace, name, and attributes, but not to text contents. Filter should return 'true' to toggle on $this->filterMatch |
boolean | $isFile | (optional) indicates if the first parameter is a filename (default, true) or if it is a string (false) |
array | $options | list of additional parsing options: processing_instruction_handler: Callback for xml_set_processing_instruction_handler |
Definition at line 61 of file XmlTypeCheck.php.
References $options, validateFromFile(), and validateFromString().
|
private |
$parser | |
$name | |
$attribs |
Definition at line 195 of file XmlTypeCheck.php.
References $attribs, and $name.
Referenced by rootElementOpen().
|
private |
Get an XML parser with the root element handler.
Definition at line 116 of file XmlTypeCheck.php.
References $parser, and array().
Referenced by validateFromFile(), and validateFromString().
XmlTypeCheck::getRootElement | ( | ) |
Get the root element.
Simple accessor to $rootElement
Definition at line 107 of file XmlTypeCheck.php.
References $rootElement.
|
static |
Alternative constructor: from filename.
string | $fname | the filename of an XML document |
callable | $filterCallback | (optional) Function to call to do additional custom validity checks from the SAX element handler event. This gives you access to the element namespace, name, and attributes, but not to text contents. Filter should return 'true' to toggle on $this->filterMatch |
Definition at line 83 of file XmlTypeCheck.php.
|
static |
Alternative constructor: from string.
string | $string | a string containing an XML element |
callable | $filterCallback | (optional) Function to call to do additional custom validity checks from the SAX element handler event. This gives you access to the element namespace, name, and attributes, but not to text contents. Filter should return 'true' to toggle on $this->filterMatch |
Definition at line 98 of file XmlTypeCheck.php.
References false.
Referenced by XmlTypeCheckTest\testMalFormedXML(), and XmlTypeCheckTest\testWellFormedXML().
|
private |
$parser | |
$target | |
$data |
Definition at line 207 of file XmlTypeCheck.php.
|
private |
$parser | |
$name | |
$attribs |
Definition at line 178 of file XmlTypeCheck.php.
References $attribs, $name, $parser, array(), and elementOpen().
|
private |
string | $fname | the filename |
Definition at line 133 of file XmlTypeCheck.php.
References $file, $fname, $parser, $ret, and getParser().
Referenced by __construct().
|
private |
string | $string | the XML-input-string to be checked. |
Definition at line 162 of file XmlTypeCheck.php.
References $parser, $ret, and getParser().
Referenced by __construct().
XmlTypeCheck::$filterMatch = false |
Will be set to true if the optional element filter returned a match at some point.
Definition at line 34 of file XmlTypeCheck.php.
|
private |
Additional parsing options.
Definition at line 45 of file XmlTypeCheck.php.
XmlTypeCheck::$rootElement = '' |
Name of the document's root element, including any namespace as an expanded URL.
Definition at line 40 of file XmlTypeCheck.php.
Referenced by getRootElement().
XmlTypeCheck::$wellFormed = false |
Will be set to true or false to indicate whether the file is well-formed XML.
Note that this doesn't check schema validity.
Definition at line 28 of file XmlTypeCheck.php.