XMLScanner - XML/HTML tokenzier. Also known as XML push parser.
return values of token() method
<tag ...
^-- happens here
<tag ... >
^-- happens here
<tag ... />
^-- happens here
</tag>
^-- happens here
<tag attr="value" >
^-- happens here
Attribute can be with or without (html style) value. scanner.attribute is the name of attribute and scanner.value - is a value of attribute.
scanner.value contains the text.
<![CDATA[ ...value... ]]>
^-- happens here
scanner.value contains text of the cdata.
<? ...value... ?>
^-- happens here
scanner.value contains text of the instruction.
<!DOCTYPE ...value... >
^-- happens here
scanner.value contains text of the doctype declaration: characters after <!DOCTYPE and before closing '>
'
( ) returns: int
Returns one of constants above. Use them in fully qualified form, e.g. XMLScanner.HEAD, XMLScanner.TAIL, etc.