| 1 |
<?php |
| 2 |
|
| 3 |
// Start of xmlreader v.0.1 |
| 4 |
|
| 5 |
class XMLReader { |
| 6 |
const NONE = 0; |
| 7 |
const ELEMENT = 1; |
| 8 |
const ATTRIBUTE = 2; |
| 9 |
const TEXT = 3; |
| 10 |
const CDATA = 4; |
| 11 |
const ENTITY_REF = 5; |
| 12 |
const ENTITY = 6; |
| 13 |
const PI = 7; |
| 14 |
const COMMENT = 8; |
| 15 |
const DOC = 9; |
| 16 |
const DOC_TYPE = 10; |
| 17 |
const DOC_FRAGMENT = 11; |
| 18 |
const NOTATION = 12; |
| 19 |
const WHITESPACE = 13; |
| 20 |
const SIGNIFICANT_WHITESPACE = 14; |
| 21 |
const END_ELEMENT = 15; |
| 22 |
const END_ENTITY = 16; |
| 23 |
const XML_DECLARATION = 17; |
| 24 |
const LOADDTD = 1; |
| 25 |
const DEFAULTATTRS = 2; |
| 26 |
const VALIDATE = 3; |
| 27 |
const SUBST_ENTITIES = 4; |
| 28 |
|
| 29 |
|
| 30 |
/** |
| 31 |
* Close the XMLReader input |
| 32 |
* @link http://www.php.net/manual/en/xmlreader.close.php |
| 33 |
* @return bool Returns true on success, false on failure. |
| 34 |
*/ |
| 35 |
public function close () {} |
| 36 |
|
| 37 |
/** |
| 38 |
* Get the value of a named attribute |
| 39 |
* @link http://www.php.net/manual/en/xmlreader.getattribute.php |
| 40 |
* @param name string <p> |
| 41 |
* The name of the attribute. |
| 42 |
* </p> |
| 43 |
* @return string The value of the attribute, or &null; if no attribute with the given |
| 44 |
* name is found or not positioned on an element node. |
| 45 |
*/ |
| 46 |
public function getAttribute ($name) {} |
| 47 |
|
| 48 |
/** |
| 49 |
* Get the value of an attribute by index |
| 50 |
* @link http://www.php.net/manual/en/xmlreader.getattributeno.php |
| 51 |
* @param index int <p> |
| 52 |
* The position of the attribute. |
| 53 |
* </p> |
| 54 |
* @return string The value of the attribute, or an empty string (before PHP 5.6) or &null; |
| 55 |
* (from PHP 5.6 onwards) if no attribute exists at |
| 56 |
* index or is not positioned on the element. |
| 57 |
*/ |
| 58 |
public function getAttributeNo ($index) {} |
| 59 |
|
| 60 |
/** |
| 61 |
* Get the value of an attribute by localname and URI |
| 62 |
* @link http://www.php.net/manual/en/xmlreader.getattributens.php |
| 63 |
* @param localName string <p> |
| 64 |
* The local name. |
| 65 |
* </p> |
| 66 |
* @param namespaceURI string <p> |
| 67 |
* The namespace URI. |
| 68 |
* </p> |
| 69 |
* @return string The value of the attribute, or an empty string (before PHP 5.6) or &null; |
| 70 |
* (from PHP 5.6 onwards) if no attribute with the given |
| 71 |
* localName and namespaceURI is |
| 72 |
* found or not positioned of element. |
| 73 |
*/ |
| 74 |
public function getAttributeNs ($localName, $namespaceURI) {} |
| 75 |
|
| 76 |
/** |
| 77 |
* Indicates if specified property has been set |
| 78 |
* @link http://www.php.net/manual/en/xmlreader.getparserproperty.php |
| 79 |
* @param property int <p> |
| 80 |
* One of the parser option |
| 81 |
* constants. |
| 82 |
* </p> |
| 83 |
* @return bool Returns true on success, false on failure. |
| 84 |
*/ |
| 85 |
public function getParserProperty ($property) {} |
| 86 |
|
| 87 |
/** |
| 88 |
* Indicates if the parsed document is valid |
| 89 |
* @link http://www.php.net/manual/en/xmlreader.isvalid.php |
| 90 |
* @return bool Returns true on success, false on failure. |
| 91 |
*/ |
| 92 |
public function isValid () {} |
| 93 |
|
| 94 |
/** |
| 95 |
* Lookup namespace for a prefix |
| 96 |
* @link http://www.php.net/manual/en/xmlreader.lookupnamespace.php |
| 97 |
* @param prefix string <p> |
| 98 |
* String containing the prefix. |
| 99 |
* </p> |
| 100 |
* @return bool Returns true on success, false on failure. |
| 101 |
*/ |
| 102 |
public function lookupNamespace ($prefix) {} |
| 103 |
|
| 104 |
/** |
| 105 |
* Move cursor to an attribute by index |
| 106 |
* @link http://www.php.net/manual/en/xmlreader.movetoattributeno.php |
| 107 |
* @param index int <p> |
| 108 |
* The position of the attribute. |
| 109 |
* </p> |
| 110 |
* @return bool Returns true on success, false on failure. |
| 111 |
*/ |
| 112 |
public function moveToAttributeNo ($index) {} |
| 113 |
|
| 114 |
/** |
| 115 |
* Move cursor to a named attribute |
| 116 |
* @link http://www.php.net/manual/en/xmlreader.movetoattribute.php |
| 117 |
* @param name string <p> |
| 118 |
* The name of the attribute. |
| 119 |
* </p> |
| 120 |
* @return bool Returns true on success, false on failure. |
| 121 |
*/ |
| 122 |
public function moveToAttribute ($name) {} |
| 123 |
|
| 124 |
/** |
| 125 |
* Move cursor to a named attribute |
| 126 |
* @link http://www.php.net/manual/en/xmlreader.movetoattributens.php |
| 127 |
* @param localName string <p> |
| 128 |
* The local name. |
| 129 |
* </p> |
| 130 |
* @param namespaceURI string <p> |
| 131 |
* The namespace URI. |
| 132 |
* </p> |
| 133 |
* @return bool Returns true on success, false on failure. |
| 134 |
*/ |
| 135 |
public function moveToAttributeNs ($localName, $namespaceURI) {} |
| 136 |
|
| 137 |
/** |
| 138 |
* Position cursor on the parent Element of current Attribute |
| 139 |
* @link http://www.php.net/manual/en/xmlreader.movetoelement.php |
| 140 |
* @return bool true if successful and false if it fails or not positioned on |
| 141 |
* Attribute when this method is called. |
| 142 |
*/ |
| 143 |
public function moveToElement () {} |
| 144 |
|
| 145 |
/** |
| 146 |
* Position cursor on the first Attribute |
| 147 |
* @link http://www.php.net/manual/en/xmlreader.movetofirstattribute.php |
| 148 |
* @return bool Returns true on success, false on failure. |
| 149 |
*/ |
| 150 |
public function moveToFirstAttribute () {} |
| 151 |
|
| 152 |
/** |
| 153 |
* Position cursor on the next Attribute |
| 154 |
* @link http://www.php.net/manual/en/xmlreader.movetonextattribute.php |
| 155 |
* @return bool Returns true on success, false on failure. |
| 156 |
*/ |
| 157 |
public function moveToNextAttribute () {} |
| 158 |
|
| 159 |
/** |
| 160 |
* Set the URI containing the XML to parse |
| 161 |
* @link http://www.php.net/manual/en/xmlreader.open.php |
| 162 |
* @param URI string <p> |
| 163 |
* URI pointing to the document. |
| 164 |
* </p> |
| 165 |
* @param encoding string[optional] <p> |
| 166 |
* The document encoding or &null;. |
| 167 |
* </p> |
| 168 |
* @param options int[optional] <p> |
| 169 |
* A bitmask of the LIBXML_* |
| 170 |
* constants. |
| 171 |
* </p> |
| 172 |
* @return bool Returns true on success, false on failure. If called statically, returns an |
| 173 |
* XMLReader&return.falseforfailure;. |
| 174 |
*/ |
| 175 |
public function open ($URI, $encoding = null, $options = null) {} |
| 176 |
|
| 177 |
/** |
| 178 |
* Move to next node in document |
| 179 |
* @link http://www.php.net/manual/en/xmlreader.read.php |
| 180 |
* @return bool Returns true on success, false on failure. |
| 181 |
*/ |
| 182 |
public function read () {} |
| 183 |
|
| 184 |
/** |
| 185 |
* Move cursor to next node skipping all subtrees |
| 186 |
* @link http://www.php.net/manual/en/xmlreader.next.php |
| 187 |
* @param localname string[optional] <p> |
| 188 |
* The name of the next node to move to. |
| 189 |
* </p> |
| 190 |
* @return bool Returns true on success, false on failure. |
| 191 |
*/ |
| 192 |
public function next ($localname = null) {} |
| 193 |
|
| 194 |
/** |
| 195 |
* Retrieve XML from current node |
| 196 |
* @link http://www.php.net/manual/en/xmlreader.readinnerxml.php |
| 197 |
* @return string the contents of the current node as a string. Empty string on failure. |
| 198 |
*/ |
| 199 |
public function readInnerXml () {} |
| 200 |
|
| 201 |
/** |
| 202 |
* Retrieve XML from current node, including it self |
| 203 |
* @link http://www.php.net/manual/en/xmlreader.readouterxml.php |
| 204 |
* @return string the contents of current node, including itself, as a string. Empty string on failure. |
| 205 |
*/ |
| 206 |
public function readOuterXml () {} |
| 207 |
|
| 208 |
/** |
| 209 |
* Reads the contents of the current node as a string |
| 210 |
* @link http://www.php.net/manual/en/xmlreader.readstring.php |
| 211 |
* @return string the content of the current node as a string. Empty string on |
| 212 |
* failure. |
| 213 |
*/ |
| 214 |
public function readString () {} |
| 215 |
|
| 216 |
/** |
| 217 |
* Validate document against XSD |
| 218 |
* @link http://www.php.net/manual/en/xmlreader.setschema.php |
| 219 |
* @param filename string <p> |
| 220 |
* The filename of the XSD schema. |
| 221 |
* </p> |
| 222 |
* @return bool Returns true on success, false on failure. |
| 223 |
*/ |
| 224 |
public function setSchema ($filename) {} |
| 225 |
|
| 226 |
/** |
| 227 |
* Set parser options |
| 228 |
* @link http://www.php.net/manual/en/xmlreader.setparserproperty.php |
| 229 |
* @param property int <p> |
| 230 |
* One of the parser option |
| 231 |
* constants. |
| 232 |
* </p> |
| 233 |
* @param value bool <p> |
| 234 |
* If set to true the option will be enabled otherwise will |
| 235 |
* be disabled. |
| 236 |
* </p> |
| 237 |
* @return bool Returns true on success, false on failure. |
| 238 |
*/ |
| 239 |
public function setParserProperty ($property, $value) {} |
| 240 |
|
| 241 |
/** |
| 242 |
* Set the filename or URI for a RelaxNG Schema |
| 243 |
* @link http://www.php.net/manual/en/xmlreader.setrelaxngschema.php |
| 244 |
* @param filename string <p> |
| 245 |
* filename or URI pointing to a RelaxNG Schema. |
| 246 |
* </p> |
| 247 |
* @return bool Returns true on success, false on failure. |
| 248 |
*/ |
| 249 |
public function setRelaxNGSchema ($filename) {} |
| 250 |
|
| 251 |
/** |
| 252 |
* Set the data containing a RelaxNG Schema |
| 253 |
* @link http://www.php.net/manual/en/xmlreader.setrelaxngschemasource.php |
| 254 |
* @param source string <p> |
| 255 |
* String containing the RelaxNG Schema. |
| 256 |
* </p> |
| 257 |
* @return bool Returns true on success, false on failure. |
| 258 |
*/ |
| 259 |
public function setRelaxNGSchemaSource ($source) {} |
| 260 |
|
| 261 |
/** |
| 262 |
* Set the data containing the XML to parse |
| 263 |
* @link http://www.php.net/manual/en/xmlreader.xml.php |
| 264 |
* @param source string <p> |
| 265 |
* String containing the XML to be parsed. |
| 266 |
* </p> |
| 267 |
* @param encoding string[optional] <p> |
| 268 |
* The document encoding or &null;. |
| 269 |
* </p> |
| 270 |
* @param options int[optional] <p> |
| 271 |
* A bitmask of the LIBXML_* |
| 272 |
* constants. |
| 273 |
* </p> |
| 274 |
* @return bool Returns true on success, false on failure. If called statically, returns an |
| 275 |
* XMLReader&return.falseforfailure;. |
| 276 |
*/ |
| 277 |
public function XML ($source, $encoding = null, $options = null) {} |
| 278 |
|
| 279 |
/** |
| 280 |
* Returns a copy of the current node as a DOM object |
| 281 |
* @link http://www.php.net/manual/en/xmlreader.expand.php |
| 282 |
* @param basenode DOMNode[optional] |
| 283 |
* @return DOMNode The resulting DOMNode or false on error. |
| 284 |
*/ |
| 285 |
public function expand (DOMNode $basenode = null) {} |
| 286 |
|
| 287 |
} |
| 288 |
// End of xmlreader v.0.1 |
| 289 |
?> |