|
Boolean | AtEnd () |
| Returns true if the reader has read until the end of the XML document, or if an Error() has occurred and reading has been aborted. Otherwise, it returns false. More...
|
|
Array | Attributes () |
| Returns the attributes of a StartElement. More...
|
|
String | DocumentEncoding () |
| If the TokenType() is StartDocument, this function returns the encoding string as specified in the XML declaration. Otherwise an empty string is returned. More...
|
|
String | DocumentVersion () |
| If the TokenType() is StartDocument, this function returns the version string as specified in the XML declaration. Otherwise an empty string is returned. More...
|
|
ErrorEnum | Error () |
| Returns the type of the current error, or NoError if no error occurred. More...
|
|
Boolean | HasError () |
| Returns true if an error has occurred, otherwise false. More...
|
|
Boolean | IsStandaloneDocument () |
| Returns true if this document has been declared standalone in the XML declaration; otherwise returns false. If no XML declaration has been parsed, this function returns false. More...
|
|
Boolean | IsWhitespace () |
| Returns true if the reader reports characters that only consist of white-space; otherwise returns false. racist function (I'm Charlie) More...
|
|
Number | LineNumber () |
| Returns the current line number, starting with 1. More...
|
|
String | Name () |
| Returns the local name of a StartElement, EndElement, or an EntityReference. More...
|
|
String | NamespaceUri () |
| Returns the namespaceUri of a StartElement or EndElement. More...
|
|
static SXmlReader | New () |
| Default constructor to instantiate a XmlReader. More...
|
|
TokenTypeEnum | ReadNext () |
| Reads the next token and returns its type. More...
|
|
| SetFile (SFile File) |
| Sets the current file to device. Setting the device resets reader. More...
|
|
| SkipCurrentElement () |
| Reads until the end of the current element, skipping any child nodes. This function is useful for skipping unknown elements. The current element is the element matching the most recently parsed start element of which a matching end element has not yet been reached. When the parser has reached the end element, the current element becomes the parent element. More...
|
|
String | Text () |
| Returns the text of Characters, Comment, DTD, or EntityReference. More...
|
|
String | TokenString () |
| Returns the reader's current token as string. More...
|
|
TokenTypeEnum | TokenType () |
| Returns the type of the current token. More...
|
|
String | toString () |
| Get the type of the variable. More...
|
|
static String | toString () |
| Get the type of the variable. More...
|
|
| Clear () |
| To deallocate memory of the object. More...
|
|
String | toString () |
| Get the type of the variable. More...
|
|
Class to read xml files Sample on how to use this class.
var fileName = new String(...);
throw new Error(
'Failed to read file.' );
xmlReader.SetFile(file);
while (!xmlReader.AtEnd()) {
var type = xmlReader.ReadNext();
continue;
{
var attributes = xmlReader.Attributes();
for (var idx = 0; idx < attributes.length; idx++)
print(attributes[idx].
Name +
", " + attributes[idx].Value);
continue;
}
}
if (xmlReader.HasError()) {
print("Error");
}
file.Close();
The Sfile class provides an interface for reading from and writing to files.
Definition: SFile.h:20
@ ReadOnly
Definition: SFile.h:31
static SFile New(String name)
Constructs a new file object to represent the file with the given name.
Class to read xml files Sample on how to use this class.
Definition: SXmlReader.h:54
String Name()
Returns the local name of a StartElement, EndElement, or an EntityReference.
static SXmlReader New()
Default constructor to instantiate a XmlReader.
@ StartElement
Definition: SXmlReader.h:79
@ StartDocument
Definition: SXmlReader.h:75
ErrorEnum Error()
Returns the type of the current error, or NoError if no error occurred.