axl includes static functions that are used to bootstrap some objects (like axl.Doc) with initialized content.
Allows to parse a XML document described by document parameter and its corresponding size:
# parse document (doc, err) = axl.parse ("<document><child><next /></child></document>") if err: print ("Failed to parse document, error found: " + err.msg)
| Parameters: | document (String) – A xml document content to be parsed. |
|---|---|
| Return type: | Returns a tuple with (axl.Doc, axl.Error) having the document defined in the case of proper parsing, or having defined axl.Error in the case an error is found. |
Allows to parse a XML document found at the provided path:
# parse document (doc, err) = axl.file_parse ("/tmp/salida.txt") if err: print ("Failed to parse document, error found: " + err.msg)
| Parameters: | path (String) – Path to the document to be loaded. |
|---|---|
| Return type: | Returns a tuple with (axl.Doc, axl.Error) having the document defined in the case of proper parsing, or having defined axl.Error in the case an error is found. |
Allows to parse DTD definition found on the provided path:
# parse dtd content (dtd, err) = axl.parse ("<document><child><next /></child></document>") if err: print ("Failed to parse dtd, error found: " + err.msg)
| Parameters: | path (String) – Path to the DTD file definition. |
|---|---|
| Return type: | Returns a tuple with (axl.Dtd, axl.Error) having the DTD defined in the case of proper parsing, or having defined axl.Error in the case an error is found. |