The XmlReader class allows XML strings to be iterated and parsed piecewise.
Table 4.1062. XmlReader Class Method Overview
Method |
Except? |
Description |
---|---|---|
Y |
Creates the XmlReader object based on the XmlDoc object or XML string passed. | |
N |
Destroys the XmlReader object. | |
N |
Creates an independent copy of the XmlReader object. | |
Y |
Moves the position of the current instance to the next node in the stream. | |
Y |
Moves the position of the current instance to the next node in the stream, skipping any whitespace nodes. | |
N |
Returns the node type of the current node; for return values, see XML Node Type Constants. | |
N |
Returns a string giving the node type of the current node; for possible return values, see the values of the NodeTypeMap constant. | |
N |
Returns the depth of the node in the tree. | |
N |
Returns the qualified name of the node (prefix:LocalName) or NOTHING if no name is available. | |
N |
Returns the text value of the node or NOTHING if not available. | |
N |
Returns True if the node has attributes or False if not. | |
N |
Returns True if the node has a text value or False if not. | |
N |
Returns True if an attribute node was generated from the default value defined in the DTD or schema, False if not. | |
N |
Returns True if the current node is empty or False if not. | |
N |
Returns True if the current node is a namespace declaration rather than a regular attribute or False if not. | |
N |
Returns True if the current reader parser context is valid, False if not | |
Y |
Returns a hash corresponding to the XML string from the current node position, including all its children. | |
Y |
Returns a hash corresponding to the XML string from the current node position, including all its children. | |
N |
Returns the number of attributes of the current node | |
N |
Returns the base URI of the node if known, NOTHING if not. | |
N |
Returns the encoding of the XML string | |
N |
Returns the local name of the node or NOTHING if no name is available. | |
N |
Returns the URI defining the namespace associated with the node, or NOTHING if not available. | |
N |
Returns the shorthand reference to the namespace associated with the node, or NOTHING if not available. | |
N |
Returns the xml:lang scope within which the node resides or NOTHING if there is none. | |
N |
Returns a string giving the XML version of the source document (normally "1. | |
Y |
Returns the value of the attribute matching the qualified name passed, or NOTHING if no such attribute exists in the current XmlReader. | |
Y |
Returns the value of the given attribute anchored in the given namespace, or NOTHING if no such attribute exists in the current XmlReader. | |
N |
Returns the value of the attribute with the specified index relative to the containing element, or NOTHING if no such attribute exists in the current XmlReader. | |
N |
returns the namespace corresponding to the given prefix in the scope of the current element. | |
Y |
Moves the position of the current instance to the attribute with the specified qualified name. | |
Y |
Moves the position of the current instance to the attribute with the specified local name and namespace URI. | |
N |
Moves the position of the current instance to the attribute with the specified index relative to the containing element. | |
N |
Moves the position of the current instance to the element node containing the current attribute node. | |
N |
Moves the position of the current instance to the first attribute of the current node. | |
N |
Moves the position of the current instance to the next attribute of the current node. | |
Y |
Moves the position of the current instance to the next node in the tree at the same level, skipping any subtree. | |
N |
Returns an XML string of the contents of the all current node's child nodes and markup, or NOTHING if the current node is neither an element nor an attribute or has no child nodes. | |
N |
Returns an XML string of the contents of the current node and all child nodes and markup, or NOTHING if the current node is neither an element nor an attribute or has no child nodes. | |
Y |
Set a RelaxNG schema for schema validation while parsing the XML document. This method must be called before the first call to XmlReader::read() | |
Y |
Set an XSD schema for schema validation while parsing the XML document. This method must be called before the first call to XmlReader::read() |
Creates the XmlReader object based on the XmlDoc object or XML string passed.
XmlReader::constructor(xmldoc | xmlstr
)
$xmlreader = new XmlReader($xml);
Table 4.1063. Arguments for XmlReader::constructor()
Argument |
Type |
Description |
---|---|---|
|
The pre-parsed XML document object to iterate through. | |
|
String |
The XML string to parse. |
Table 4.1064. Return Values for XmlReader::constructor()
Return Type |
Description |
---|---|
Object |
The XmlReader object is returned |
Table 4.1065. Exceptions thrown by XmlReader::constructor()
err |
desc |
---|---|
|
missing or invalid arguments |
Destroys the XmlReader object.
delete lvalue
delete $xmlreader;
Creates an independent copy of the XmlReader object.
XmlReader::copy()
$value = $xmlreader.copy();
Table 4.1066. Return Values for XmlReader::copy()
Return Type |
Description |
---|---|
a copy of the current object |
Moves the position of the current instance to the next node in the stream. Returns True if the read was successful, False if there are no more nodes to read. If an error occurs parsing the XML string, an exception is raised (see below).
See also XmlReader::readSkipWhitespace().
XmlReader::read()
$value = $xmlreader.read();
Table 4.1067. Arguments for XmlReader::read()
Argument |
Type |
Description |
---|---|---|
n/a |
n/a |
This method takes no arguments. |
Table 4.1068. Return Values for XmlReader::read()
Return Type |
Description |
---|---|
Boolean |
True if the read was successful, False if there are no more nodes to read |
Table 4.1069. Exceptions thrown by XmlReader::read()
err |
desc |
---|---|
|
cannot move to next node due to an error parsing the XML string (exception description string contains details about the error) |
Moves the position of the current instance to the next node in the stream, skipping any whitespace nodes. Returns True if the read was successful, False if there are no more nodes to read. If an error occurs parsing the XML string, an exception is raised (see below).
See also XmlReader::read().
XmlReader::readSkipWhitespace()
$value = $xmlreader.readSkipWhitespace();
Table 4.1070. Arguments for XmlReader::readSkipWhitespace()
Argument |
Type |
Description |
---|---|---|
n/a |
n/a |
This method takes no arguments. |
Table 4.1071. Return Values for XmlReader::readSkipWhitespace()
Return Type |
Description |
---|---|
Boolean |
True if the read was successful, False if there are no more nodes to read |
Table 4.1072. Exceptions thrown by XmlReader::readSkipWhitespace()
err |
desc |
---|---|
|
cannot move to next node due to an error parsing the XML string (exception description string contains details about the error) |
Returns the node type of the current node; for return values, see XML Node Type Constants.
See also NodeTypeMap.
See also XmlReader::nodeTypeName()
XmlReader::nodeType()
$value = $xmlreader.nodeType();
Table 4.1073. Arguments for XmlReader::nodeType()
Argument |
Type |
Description |
---|---|---|
n/a |
n/a |
This method takes no arguments. |
Table 4.1074. Return Values for XmlReader::nodeType()
Return Type |
Description |
---|---|
Integer |
the node type of the current node; for return values, see XML Node Type Constants |
Returns a string giving the node type of the current node; for possible return values, see the values of the NodeTypeMap constant.
See also XmlReader::nodeType()
XmlReader::nodeTypeName()
$value = $xmlreader.nodeTypeName();
Table 4.1075. Arguments for XmlReader::nodeTypeName()
Argument |
Type |
Description |
---|---|---|
n/a |
n/a |
This method takes no arguments. |
Table 4.1076. Return Values for XmlReader::nodeTypeName()
Return Type |
Description |
---|---|
String |
a string giving the node type of the current node; for possible return values, see the values of the NodeTypeMap constant |
Returns the depth of the node in the tree.
XmlReader::depth()
$value = $xmlreader.depth();
Table 4.1077. Arguments for XmlReader::depth()
Argument |
Type |
Description |
---|---|---|
n/a |
n/a |
This method takes no arguments. |
Table 4.1078. Return Values for XmlReader::depth()
Return Type |
Description |
---|---|
Integer |
the depth of the node in the tree |
Returns the qualified name of the node (prefix:LocalName) or NOTHING if no name is available.
See also XmlReader::localName().
XmlReader::name()
$value = $xmlreader.name();
Table 4.1079. Arguments for XmlReader::name()
Argument |
Type |
Description |
---|---|---|
n/a |
n/a |
This method takes no arguments. |
Table 4.1080. Return Values for XmlReader::name()
Return Type |
Description |
---|---|
String |
the qualified name of the node (prefix:LocalName) or NOTHING if no name is available |
Returns the text value of the node or NOTHING if not available.
XmlReader::value()
$value = $xmlreader.value();
Table 4.1081. Arguments for XmlReader::value()
Argument |
Type |
Description |
---|---|---|
n/a |
n/a |
This method takes no arguments. |
Table 4.1082. Return Values for XmlReader::value()
Return Type |
Description |
---|---|
String |
the text value of the node or NOTHING if not available |
Returns True if the node has attributes or False if not.
XmlReader::hasAttributes()
$value = $xmlreader.hasAttributes();
Table 4.1083. Arguments for XmlReader::hasAttributes()
Argument |
Type |
Description |
---|---|---|
n/a |
n/a |
This method takes no arguments. |
Table 4.1084. Return Values for XmlReader::hasAttributes()
Return Type |
Description |
---|---|
Boolean |
True if the node has attributes, False if not |
Returns True if the node has a text value or False if not.
XmlReader::hasValue()
$value = $xmlreader.hasValue();
Table 4.1085. Arguments for XmlReader::hasValue()
Argument |
Type |
Description |
---|---|---|
n/a |
n/a |
This method takes no arguments. |
Table 4.1086. Return Values for XmlReader::hasValue()
Return Type |
Description |
---|---|
Boolean |
True if the node has a text value, False if not |
Returns True if an attribute node was generated from the default value defined in the DTD or schema, False if not.
XmlReader::isDefault()
$value = $xmlreader.isDefault();
Table 4.1087. Arguments for XmlReader::isDefault()
Argument |
Type |
Description |
---|---|---|
n/a |
n/a |
This method takes no arguments. |
Table 4.1088. Return Values for XmlReader::isDefault()
Return Type |
Description |
---|---|
Boolean |
True if the node an attribute node was generated from the default value defined in the DTD or schema, False if not |
Returns True if the current node is empty or False if not.
XmlReader::isEmptyElement()
$value = $xmlreader.isEmptyElement();
Table 4.1089. Arguments for XmlReader::isEmptyElement()
Argument |
Type |
Description |
---|---|---|
n/a |
n/a |
This method takes no arguments. |
Table 4.1090. Return Values for XmlReader::isEmptyElement()
Return Type |
Description |
---|---|
Boolean |
True if the current node is empty, False if not |
Returns True if the current node is a namespace declaration rather than a regular attribute or False if not.
XmlReader::isNamespaceDecl()
$value = $xmlreader.isNamespaceDecl();
Table 4.1091. Arguments for XmlReader::isNamespaceDecl()
Argument |
Type |
Description |
---|---|---|
n/a |
n/a |
This method takes no arguments. |
Table 4.1092. Return Values for XmlReader::isNamespaceDecl()
Return Type |
Description |
---|---|
Boolean |
True if the current node is a namespace declaration rather than a regular attribute, False if not |
Returns True if the current reader parser context is valid, False if not
XmlReader::isValid()
$value = $xmlreader.isValid();
Table 4.1093. Arguments for XmlReader::isValid()
Argument |
Type |
Description |
---|---|---|
n/a |
n/a |
This method takes no arguments. |
Table 4.1094. Return Values for XmlReader::isValid()
Return Type |
Description |
---|---|
Boolean |
True if the current reader parser context is valid, False if not |
Returns a hash corresponding to the XML string from the current node position, including all its children. If duplicate, out-of-order XML elements are found in the input string, they are deserialized to Qore hash elements with the same name as the XML element but including a caret "^" and a numeric prefix to maintain the same key order in the Qore hash as in the input XML string.
Functionally similar to parseXML()
XmlReader::toQore()
$value = $xmlreader.toQore();
Table 4.1095. Arguments for XmlReader::toQore()
Argument |
Type |
Description |
---|---|---|
n/a |
n/a |
This method takes no arguments. |
Table 4.1096. Return Values for XmlReader::toQore()
Return Type |
Description |
---|---|
Hash |
a hash corresponding to the XML string from the current node position, including all its children; maintains XML element order by appending a suffix to key names |
Table 4.1097. Exceptions thrown by XmlReader::toQore()
err |
desc |
---|---|
|
error parsing the XML string (exception description string contains details about the error) |
Returns a hash corresponding to the XML string from the current node position, including all its children. Note that data deserialized with this method may not be reserialized to an identical XML string due to the fact that XML elements with the same name are collapsed into Qore lists in the resulting Qore hash irrespective of the order in the original XML string.
Functionally similar to parseXMLAsData()
XmlReader::toQoreData()
$value = $xmlreader.toQoreData();
Table 4.1098. Arguments for XmlReader::toQoreData()
Argument |
Type |
Description |
---|---|---|
n/a |
n/a |
This method takes no arguments. |
Table 4.1099. Return Values for XmlReader::toQoreData()
Return Type |
Description |
---|---|
Hash |
a hash corresponding to the XML string from the current node position, including all its children; does not guarantee to maintain XML element order in the hash as elements at the same level with the same name are collapsed to a Qore list |
Table 4.1100. Exceptions thrown by XmlReader::toQoreData()
err |
desc |
---|---|
|
error parsing the XML string (exception description string contains details about the error) |
Returns the number of attributes of the current node
XmlReader::attributeCount()
$value = $xmlreader.attributeCount();
Table 4.1101. Arguments for XmlReader::attributeCount()
Argument |
Type |
Description |
---|---|---|
n/a |
n/a |
This method takes no arguments. |
Table 4.1102. Return Values for XmlReader::attributeCount()
Return Type |
Description |
---|---|
Integer |
the number of attributes of the current node |
Returns the base URI of the node if known, NOTHING if not.
XmlReader::baseUri()
$value = $xmlreader.baseUri();
Table 4.1103. Arguments for XmlReader::baseUri()
Argument |
Type |
Description |
---|---|---|
n/a |
n/a |
This method takes no arguments. |
Table 4.1104. Return Values for XmlReader::baseUri()
Return Type |
Description |
---|---|
String |
the base URI of the node if known, NOTHING if not |
Returns the encoding of the XML string
XmlReader::encoding()
$value = $xmlreader.encoding();
Table 4.1105. Arguments for XmlReader::encoding()
Argument |
Type |
Description |
---|---|---|
n/a |
n/a |
This method takes no arguments. |
Table 4.1106. Return Values for XmlReader::encoding()
Return Type |
Description |
---|---|
String |
the encoding of the XML string |
Returns the local name of the node or NOTHING if no name is available.
XmlReader::localName()
$value = $xmlreader.localName();
Table 4.1107. Arguments for XmlReader::localName()
Argument |
Type |
Description |
---|---|---|
n/a |
n/a |
This method takes no arguments. |
Table 4.1108. Return Values for XmlReader::localName()
Return Type |
Description |
---|---|
String |
the local name of the node or NOTHING if no name is available |
Returns the URI defining the namespace associated with the node, or NOTHING if not available.
XmlReader::namespaceUri()
$value = $xmlreader.namespaceUri();
Table 4.1109. Arguments for XmlReader::namespaceUri()
Argument |
Type |
Description |
---|---|---|
n/a |
n/a |
This method takes no arguments. |
Table 4.1110. Return Values for XmlReader::namespaceUri()
Return Type |
Description |
---|---|
String |
the URI defining the namespace associated with the node or NOTHING if not available |
Returns the shorthand reference to the namespace associated with the node, or NOTHING if not available.
XmlReader::prefix()
$value = $xmlreader.prefix();
Table 4.1111. Arguments for XmlReader::prefix()
Argument |
Type |
Description |
---|---|---|
n/a |
n/a |
This method takes no arguments. |
Table 4.1112. Return Values for XmlReader::prefix()
Return Type |
Description |
---|---|
String |
the shorthand reference to the namespace associated with the node or NOTHING if not available |
Returns the xml:lang scope within which the node resides or NOTHING if there is none.
XmlReader::xmlLang()
$value = $xmlreader.xmlLang();
Table 4.1113. Arguments for XmlReader::xmlLang()
Argument |
Type |
Description |
---|---|---|
n/a |
n/a |
This method takes no arguments. |
Table 4.1114. Return Values for XmlReader::xmlLang()
Return Type |
Description |
---|---|
String |
the xml:lang scope within which the node resides or NOTHING if there is none |
Returns a string giving the XML version of the source document (normally "1.0").
XmlReader::xmlVersion()
$value = $xmlreader.xmlVersion();
Table 4.1115. Arguments for XmlReader::xmlVersion()
Argument |
Type |
Description |
---|---|---|
n/a |
n/a |
This method takes no arguments. |
Table 4.1116. Return Values for XmlReader::xmlVersion()
Return Type |
Description |
---|---|
String |
a string giving the XML version of the source document (normally "1.0") |
Returns the value of the attribute matching the qualified name passed, or NOTHING if no such attribute exists in the current XmlReader.
See also XmlReader::getAttributeNs()
XmlReader::getAttribute(name
)
$value = $xmlreader.getAttribute($name);
Table 4.1117. Arguments for XmlReader::getAttribute()
Argument |
Type |
Description |
---|---|---|
|
String |
The qualified name of the attribute to retrieve |
Table 4.1118. Return Values for XmlReader::getAttribute()
Return Type |
Description |
---|---|
String |
the value of the attribute or NOTHING if it does not exist |
Table 4.1119. Exceptions thrown by XmlReader::getAttribute()
err |
desc |
---|---|
|
missing or invalid argument |
Returns the value of the given attribute anchored in the given namespace, or NOTHING if no such attribute exists in the current XmlReader.
See also XmlReader::getAttribute()
XmlReader::getAttributeNs(localname, namespaceuri
)
$value = $xmlreader.getAttributeNs($localname, $namespaceuri);
Table 4.1120. Arguments for XmlReader::getAttributeNs()
Argument |
Type |
Description |
---|---|---|
|
String |
The local name of the attribute to retrieve |
|
String |
The namespace URI of the attribute |
Table 4.1121. Return Values for XmlReader::getAttributeNs()
Return Type |
Description |
---|---|
String |
the value of the attribute or NOTHING if it does not exist |
Table 4.1122. Exceptions thrown by XmlReader::getAttributeNs()
err |
desc |
---|---|
|
missing or invalid argument |
Returns the value of the attribute with the specified index relative to the containing element, or NOTHING if no such attribute exists in the current XmlReader.
See also XmlReader::getAttribute()
XmlReader::getAttributeOffset(offset
)
$value = $xmlreader.getAttributeOffset($offset);
Table 4.1123. Arguments for XmlReader::getAttributeOffset()
Argument |
Type |
Description |
---|---|---|
|
Integer |
the index of the attribute relative to the containing element |
Table 4.1124. Return Values for XmlReader::getAttributeOffset()
Return Type |
Description |
---|---|
String |
the value of the attribute or NOTHING if it does not exist |
returns the namespace corresponding to the given prefix in the scope of the current element. If no prefix is given, the default namespace is returned.
XmlReader::lookupNamespace(prefix
)
$value = $xmlreader.lookupNamespace($prefix);
Table 4.1125. Arguments for XmlReader::lookupNamespace()
Argument |
Type |
Description |
---|---|---|
|
String |
The namespace prefix to resolve; if no value is sent for this argument, the default namespace is returned. |
Table 4.1126. Return Values for XmlReader::lookupNamespace()
Return Type |
Description |
---|---|
String |
The namespace corresponding to the given prefix in the scope of the current element or NOTHING if the prefix could not be resolved. |
Moves the position of the current instance to the attribute with the specified qualified name.
See also XmlReader::moveToAttributeNs()
XmlReader::moveToAttribute(name
)
$value = $xmlreader.moveToAttribute($name);
Table 4.1127. Arguments for XmlReader::moveToAttribute()
Argument |
Type |
Description |
---|---|---|
|
String |
The qualified name of the attribute to move to |
Table 4.1128. Return Values for XmlReader::moveToAttribute()
Return Type |
Description |
---|---|
Integer |
1 in case of success, -1 in case of error, 0 if not found |
Table 4.1129. Exceptions thrown by XmlReader::moveToAttribute()
err |
desc |
---|---|
|
missing or invalid argument |
Moves the position of the current instance to the attribute with the specified local name and namespace URI.
See also XmlReader::moveToAttribute()
XmlReader::moveToAttributeNs(localname, namespaceuri
)
$value = $xmlreader.moveToAttributeNs($localname, $namespaceuri);
Table 4.1130. Arguments for XmlReader::moveToAttributeNs()
Argument |
Type |
Description |
---|---|---|
|
String |
The local name of the attribute to move to |
|
String |
The namespace URI of the attribute |
Table 4.1131. Return Values for XmlReader::moveToAttributeNs()
Return Type |
Description |
---|---|
Integer |
1 in case of success, -1 in case of error, 0 if not found |
Table 4.1132. Exceptions thrown by XmlReader::moveToAttributeNs()
err |
desc |
---|---|
|
missing or invalid argument |
Moves the position of the current instance to the attribute with the specified index relative to the containing element.
See also XmlReader::moveToAttribute()
XmlReader::moveToAttributeOffset(offset
)
$value = $xmlreader.moveToAttributeOffset($offset);
Table 4.1133. Arguments for XmlReader::moveToAttributeOffset()
Argument |
Type |
Description |
---|---|---|
|
Integer |
the index of the attribute relative to the containing element to move to |
Table 4.1134. Return Values for XmlReader::moveToAttributeOffset()
Return Type |
Description |
---|---|
Integer |
1 in case of success, -1 in case of error, 0 if not found |
Moves the position of the current instance to the element node containing the current attribute node.
XmlReader::moveToElement()
$value = $xmlreader.moveToElement();
Table 4.1135. Arguments for XmlReader::moveToElement()
Argument |
Type |
Description |
---|---|---|
n/a |
n/a |
This method takes no arguments. |
Table 4.1136. Return Values for XmlReader::moveToElement()
Return Type |
Description |
---|---|
Integer |
1 in case of success, -1 in case of error, 0 if not found |
Moves the position of the current instance to the first attribute of the current node.
XmlReader::moveToFirstAttribute()
$value = $xmlreader.moveToFirstAttribute();
Table 4.1137. Arguments for XmlReader::moveToFirstAttribute()
Argument |
Type |
Description |
---|---|---|
n/a |
n/a |
This method takes no arguments. |
Table 4.1138. Return Values for XmlReader::moveToFirstAttribute()
Return Type |
Description |
---|---|
Integer |
1 in case of success, -1 in case of error, 0 if not found |
Moves the position of the current instance to the next attribute of the current node.
XmlReader::moveToNextAttribute()
$value = $xmlreader.moveToNextAttribute();
Table 4.1139. Arguments for XmlReader::moveToNextAttribute()
Argument |
Type |
Description |
---|---|---|
n/a |
n/a |
This method takes no arguments. |
Table 4.1140. Return Values for XmlReader::moveToNextAttribute()
Return Type |
Description |
---|---|
Integer |
1 in case of success, -1 in case of error, 0 if not found |
Moves the position of the current instance to the next node in the tree at the same level, skipping any subtree. Returns True if the operation succeeded, False if there are no more nodes to read. If an error occurs parsing the XML string, an exception is raised.
XmlReader::next()
$value = $xmlreader.next();
Table 4.1141. Arguments for XmlReader::next()
Argument |
Type |
Description |
---|---|---|
n/a |
n/a |
This method takes no arguments. |
Table 4.1143. Exceptions thrown by XmlReader::next()
err |
desc |
---|---|
|
an error occured parsing the XML string |
Returns an XML string of the contents of the all current node's child nodes and markup, or NOTHING if the current node is neither an element nor an attribute or has no child nodes.
See also XmlReader::getOuterXml().
XmlReader::getInnerXml()
$value = $xmlreader.getInnerXml();
Table 4.1144. Arguments for XmlReader::getInnerXml()
Argument |
Type |
Description |
---|---|---|
n/a |
n/a |
This method takes no arguments. |
Table 4.1145. Return Values for XmlReader::getInnerXml()
Return Type |
Description |
---|---|
String |
an XML string of the contents of all the current node's child nodes and markup, or NOTHING if the current node is neither an element nor an attribute or has no child nodes |
Returns an XML string of the contents of the current node and all child nodes and markup, or NOTHING if the current node is neither an element nor an attribute or has no child nodes.
See also XmlReader::getInnerXml().
XmlReader::getOuterXml()
$value = $xmlreader.getOuterXml();
Table 4.1146. Arguments for XmlReader::getOuterXml()
Argument |
Type |
Description |
---|---|---|
n/a |
n/a |
This method takes no arguments. |
Table 4.1147. Return Values for XmlReader::getOuterXml()
Return Type |
Description |
---|---|
String |
an XML string of the contents of the current node and all child nodes and markup, or NOTHING if the current node is neither an element nor an attribute or has no child nodes |
Set a RelaxNG schema for schema validation while parsing the XML document. This method must be called before the first call to XmlReader::read()
If any errors occur, an exception is thrown (see below).
XmlReader::relaxNGValidate(rng
)
$xmlreader.relaxNGValidate($rng);
Table 4.1148. Arguments for XmlReader::relaxNGValidate()
Argument |
Type |
Description |
---|---|---|
|
String |
The RelaxNG schema string to use for validation |
Table 4.1149. Return Values for XmlReader::relaxNGValidate()
Return Type |
Description |
---|---|
n/a |
This method returns no value |
Table 4.1150. Exceptions thrown by XmlReader::relaxNGValidate()
err |
desc |
---|---|
|
missing or invalid argument |
|
invalid RelaxNG schema or method called after the first call to XmlReader::read() |
Set an XSD schema for schema validation while parsing the XML document. This method must be called before the first call to XmlReader::read()
If any errors occur, an exception is thrown (see below).
XmlReader::schemaValidate(xsd
)
$xmlreader.schemaValidate($xsd);
Table 4.1151. Arguments for XmlReader::schemaValidate()
Argument |
Type |
Description |
---|---|---|
|
String |
The XSD schema string to use for validation |
Table 4.1152. Return Values for XmlReader::schemaValidate()
Return Type |
Description |
---|---|
n/a |
This method returns no value |
Table 4.1153. Exceptions thrown by XmlReader::schemaValidate()
err |
desc |
---|---|
|
missing or invalid argument |
|
invalid RelaxNG schema or method called after the first call to XmlReader::read() |