pub struct XmlTextReader { /* private fields */ }Implementations§
Source§impl XmlTextReader
impl XmlTextReader
Sourcepub unsafe fn Read(&mut self) -> c_int
pub unsafe fn Read(&mut self) -> c_int
Read the next node in document order.
Returns 1 if a node was read, 0 if no more nodes (EOF), -1 on error.
§SAFETY
self must be a valid XmlTextReader obtained from a reader
constructor (xmlReaderForDoc/xmlReaderForFile/xmlReaderForMemory/
xmlReaderForIO or xmlNewTextReader) and not yet closed or freed.
The &mut self borrow excludes concurrent access from other threads.
Pointers returned by this method are valid only until the next
traversal operation invalidates them, per the C API contract.
Sourcepub unsafe fn Next(&mut self) -> c_int
pub unsafe fn Next(&mut self) -> c_int
Skip to the next sibling of the current node.
Returns 1 on success, 0 if no more siblings, -1 on error.
§SAFETY
self must be a valid XmlTextReader obtained from a reader
constructor (xmlReaderForDoc/xmlReaderForFile/xmlReaderForMemory/
xmlReaderForIO or xmlNewTextReader) and not yet closed or freed.
The &mut self borrow excludes concurrent access from other threads.
Pointers returned by this method are valid only until the next
traversal operation invalidates them, per the C API contract.
Sourcepub unsafe fn MoveToElement(&mut self) -> c_int
pub unsafe fn MoveToElement(&mut self) -> c_int
Move to the parent element (if currently on an attribute).
Returns 1 on success, 0 if not on an attribute, -1 on error.
§SAFETY
self must be a valid XmlTextReader obtained from a reader
constructor (xmlReaderForDoc/xmlReaderForFile/xmlReaderForMemory/
xmlReaderForIO or xmlNewTextReader) and not yet closed or freed.
The &mut self borrow excludes concurrent access from other threads.
Pointers returned by this method are valid only until the next
traversal operation invalidates them, per the C API contract.
Sourcepub unsafe fn MoveToAttribute(&mut self, name: *const xmlChar) -> c_int
pub unsafe fn MoveToAttribute(&mut self, name: *const xmlChar) -> c_int
Move to an attribute by name.
Returns 1 on success, 0 if attribute not found, -1 on error.
§SAFETY
self must be a valid XmlTextReader obtained from a reader
constructor (xmlReaderForDoc/xmlReaderForFile/xmlReaderForMemory/
xmlReaderForIO or xmlNewTextReader) and not yet closed or freed.
The &mut self borrow excludes concurrent access from other threads.
Pointers returned by this method are valid only until the next
traversal operation invalidates them, per the C API contract.
Sourcepub unsafe fn MoveToAttributeNo(&mut self, index: c_int) -> c_int
pub unsafe fn MoveToAttributeNo(&mut self, index: c_int) -> c_int
Move to an attribute by index.
Returns 1 on success, 0 if index out of range, -1 on error.
§SAFETY
self must be a valid XmlTextReader obtained from a reader
constructor (xmlReaderForDoc/xmlReaderForFile/xmlReaderForMemory/
xmlReaderForIO or xmlNewTextReader) and not yet closed or freed.
The &mut self borrow excludes concurrent access from other threads.
Pointers returned by this method are valid only until the next
traversal operation invalidates them, per the C API contract.
Sourcepub unsafe fn MoveToFirstAttribute(&mut self) -> c_int
pub unsafe fn MoveToFirstAttribute(&mut self) -> c_int
Move to the first attribute of the current element.
Returns 1 on success, 0 if no attributes, -1 on error.
§SAFETY
self must be a valid XmlTextReader obtained from a reader
constructor (xmlReaderForDoc/xmlReaderForFile/xmlReaderForMemory/
xmlReaderForIO or xmlNewTextReader) and not yet closed or freed.
The &mut self borrow excludes concurrent access from other threads.
Pointers returned by this method are valid only until the next
traversal operation invalidates them, per the C API contract.
Sourcepub unsafe fn MoveToNextAttribute(&mut self) -> c_int
pub unsafe fn MoveToNextAttribute(&mut self) -> c_int
Move to the next attribute.
Returns 1 on success, 0 if no more attributes, -1 on error.
§SAFETY
self must be a valid XmlTextReader obtained from a reader
constructor (xmlReaderForDoc/xmlReaderForFile/xmlReaderForMemory/
xmlReaderForIO or xmlNewTextReader) and not yet closed or freed.
The &mut self borrow excludes concurrent access from other threads.
Pointers returned by this method are valid only until the next
traversal operation invalidates them, per the C API contract.
Sourcepub unsafe fn Prev(&mut self) -> c_int
pub unsafe fn Prev(&mut self) -> c_int
Move to the previous sibling.
Returns 1 on success, 0 if no previous sibling, -1 on error.
§SAFETY
self must be a valid XmlTextReader obtained from a reader
constructor (xmlReaderForDoc/xmlReaderForFile/xmlReaderForMemory/
xmlReaderForIO or xmlNewTextReader) and not yet closed or freed.
The &mut self borrow excludes concurrent access from other threads.
Pointers returned by this method are valid only until the next
traversal operation invalidates them, per the C API contract.
Sourcepub const fn NodeType(&self) -> ReaderNodeType
pub const fn NodeType(&self) -> ReaderNodeType
Get the node type of the current node.
Sourcepub unsafe fn Name(&self) -> *mut xmlChar
pub unsafe fn Name(&self) -> *mut xmlChar
Get the name of the current node.
Returns a pointer to a newly allocated string (caller must free with xmlFree),
or NULL if there is no name.
§SAFETY
self must be a valid XmlTextReader obtained from a reader
constructor (xmlReaderForDoc/xmlReaderForFile/xmlReaderForMemory/
xmlReaderForIO or xmlNewTextReader) and not yet closed or freed.
The &mut self borrow excludes concurrent access from other threads.
Pointers returned by this method are valid only until the next
traversal operation invalidates them, per the C API contract.
Sourcepub unsafe fn Value(&self) -> *mut xmlChar
pub unsafe fn Value(&self) -> *mut xmlChar
Get the value of the current node.
Returns a pointer to a newly allocated string (caller must free with xmlFree),
or NULL if there is no value.
§SAFETY
self must be a valid XmlTextReader obtained from a reader
constructor (xmlReaderForDoc/xmlReaderForFile/xmlReaderForMemory/
xmlReaderForIO or xmlNewTextReader) and not yet closed or freed.
The &mut self borrow excludes concurrent access from other threads.
Pointers returned by this method are valid only until the next
traversal operation invalidates them, per the C API contract.
Sourcepub const fn ConstName(&self) -> *const xmlChar
pub const fn ConstName(&self) -> *const xmlChar
Get a constant pointer to the name (no copy).
The returned pointer is valid only while the reader is alive and positioned on the same node.
Sourcepub const fn ConstValue(&self) -> *const xmlChar
pub const fn ConstValue(&self) -> *const xmlChar
Get a constant pointer to the value (no copy).
The returned pointer is valid only while the reader is alive and positioned on the same node.
Sourcepub fn HasAttributes(&self) -> c_int
pub fn HasAttributes(&self) -> c_int
Check if the current node has attributes.
Sourcepub fn IsEmptyElement(&self) -> c_int
pub fn IsEmptyElement(&self) -> c_int
Check if the current element is an empty element (no children).
Sourcepub unsafe fn BaseUri(&self) -> *mut xmlChar
pub unsafe fn BaseUri(&self) -> *mut xmlChar
Get the base URI of the current node.
Returns a newly allocated string (caller must free with xmlFree),
or NULL if not available.
§SAFETY
self must be a valid XmlTextReader obtained from a reader
constructor (xmlReaderForDoc/xmlReaderForFile/xmlReaderForMemory/
xmlReaderForIO or xmlNewTextReader) and not yet closed or freed.
The &mut self borrow excludes concurrent access from other threads.
Pointers returned by this method are valid only until the next
traversal operation invalidates them, per the C API contract.
Sourcepub unsafe fn LocalName(&self) -> *mut xmlChar
pub unsafe fn LocalName(&self) -> *mut xmlChar
Get the local name of the current node.
For namespaced names, this strips the prefix. Returns a newly allocated string, or NULL.
§SAFETY
self must be a valid XmlTextReader obtained from a reader
constructor (xmlReaderForDoc/xmlReaderForFile/xmlReaderForMemory/
xmlReaderForIO or xmlNewTextReader) and not yet closed or freed.
The &mut self borrow excludes concurrent access from other threads.
Pointers returned by this method are valid only until the next
traversal operation invalidates them, per the C API contract.
Sourcepub unsafe fn NamespaceUri(&self) -> *mut xmlChar
pub unsafe fn NamespaceUri(&self) -> *mut xmlChar
Get the namespace URI of the current node.
Returns a newly allocated string, or NULL.
§SAFETY
self must be a valid XmlTextReader obtained from a reader
constructor (xmlReaderForDoc/xmlReaderForFile/xmlReaderForMemory/
xmlReaderForIO or xmlNewTextReader) and not yet closed or freed.
The &mut self borrow excludes concurrent access from other threads.
Pointers returned by this method are valid only until the next
traversal operation invalidates them, per the C API contract.
Sourcepub unsafe fn Prefix(&self) -> *mut xmlChar
pub unsafe fn Prefix(&self) -> *mut xmlChar
Get the prefix of the current node.
Returns a newly allocated string, or NULL.
§SAFETY
self must be a valid XmlTextReader obtained from a reader
constructor (xmlReaderForDoc/xmlReaderForFile/xmlReaderForMemory/
xmlReaderForIO or xmlNewTextReader) and not yet closed or freed.
The &mut self borrow excludes concurrent access from other threads.
Pointers returned by this method are valid only until the next
traversal operation invalidates them, per the C API contract.
Sourcepub const fn AttributeCount(&self) -> c_int
pub const fn AttributeCount(&self) -> c_int
Get the attribute count of the current element.
Sourcepub unsafe fn GetAttribute(&self, name: *const xmlChar) -> *mut xmlChar
pub unsafe fn GetAttribute(&self, name: *const xmlChar) -> *mut xmlChar
Get an attribute value by name.
Returns a newly allocated string, or NULL.
§SAFETY
self must be a valid XmlTextReader obtained from a reader
constructor (xmlReaderForDoc/xmlReaderForFile/xmlReaderForMemory/
xmlReaderForIO or xmlNewTextReader) and not yet closed or freed.
The &mut self borrow excludes concurrent access from other threads.
Pointers returned by this method are valid only until the next
traversal operation invalidates them, per the C API contract.
Sourcepub unsafe fn GetAttributeNo(&self, index: c_int) -> *mut xmlChar
pub unsafe fn GetAttributeNo(&self, index: c_int) -> *mut xmlChar
Get an attribute value by index.
Returns a newly allocated string, or NULL.
§SAFETY
self must be a valid XmlTextReader obtained from a reader
constructor (xmlReaderForDoc/xmlReaderForFile/xmlReaderForMemory/
xmlReaderForIO or xmlNewTextReader) and not yet closed or freed.
The &mut self borrow excludes concurrent access from other threads.
Pointers returned by this method are valid only until the next
traversal operation invalidates them, per the C API contract.
Sourcepub unsafe fn GetAttributeNs(
&self,
localName: *const xmlChar,
namespaceURI: *const xmlChar,
) -> *mut xmlChar
pub unsafe fn GetAttributeNs( &self, localName: *const xmlChar, namespaceURI: *const xmlChar, ) -> *mut xmlChar
Get an attribute value by local name and namespace URI.
Returns a newly allocated string, or NULL.
§SAFETY
self must be a valid XmlTextReader obtained from a reader
constructor (xmlReaderForDoc/xmlReaderForFile/xmlReaderForMemory/
xmlReaderForIO or xmlNewTextReader) and not yet closed or freed.
The &mut self borrow excludes concurrent access from other threads.
Pointers returned by this method are valid only until the next
traversal operation invalidates them, per the C API contract.
Sourcepub unsafe fn LookupNamespace(&self, prefix: *const xmlChar) -> *mut xmlChar
pub unsafe fn LookupNamespace(&self, prefix: *const xmlChar) -> *mut xmlChar
Look up a namespace by prefix.
Returns a newly allocated string with the namespace URI, or NULL.
§SAFETY
self must be a valid XmlTextReader obtained from a reader
constructor (xmlReaderForDoc/xmlReaderForFile/xmlReaderForMemory/
xmlReaderForIO or xmlNewTextReader) and not yet closed or freed.
The &mut self borrow excludes concurrent access from other threads.
Pointers returned by this method are valid only until the next
traversal operation invalidates them, per the C API contract.
Sourcepub const fn GetParserProp(&self, prop: c_int) -> c_int
pub const fn GetParserProp(&self, prop: c_int) -> c_int
Get a parser property.
Sourcepub const fn SetParserProp(&mut self, prop: c_int, value: c_int) -> c_int
pub const fn SetParserProp(&mut self, prop: c_int, value: c_int) -> c_int
Set a parser property.
Sourcepub const fn CurrentDoc(&self) -> *mut _xmlDoc
pub const fn CurrentDoc(&self) -> *mut _xmlDoc
Get the current document.