XML_Readers
Light-weight XML input file readers.
 |  | type XML_Reader |  |
 | Light-weight XML input file reader. |  |
 |  | type XML_Reader_Access |  |
 | Type for instance variables. |  |
Internal initialization and finalization
 |  | procedure Initialize_XML_Reader |  |
 | Initialize a newly created reader instance. |  |
Param | Type | Description |
access This | XML_Reader'Class |
|
|
 |  | procedure Initialize_XML_Reader |  |
 | Initialize a newly created reader instance with a file to read. |  |
Param | Type | Description |
access This | XML_Reader'Class |
|
|
|
 |  | procedure Finalize_XML_Reader |  |
 | Close the input file. |  |
Param | Type | Description |
access This | XML_Reader'Class |
|
|
Creating readers
 |  | function Current_Input |  |
 | Create an XML reader for current input (stdin). |  |
|
 |  | function Open |  |
 | Create an XML reader for file input. |  |
|
 |  | procedure Close |  |
 | Close an XML reader's input file. |  |
Param | Type | Description |
in out This | XML_Reader_Access |
|
|
End testing
 |  | function End_Of_Tag |  |
 | Check if the end of the tag has been reached. |  |
Param | Type | Description |
access This | XML_Reader'Class |
|
|
|
Error handling
 |  | procedure XML_Expect_Error |  |
 | Print an error message, then raise Syntax_Error. |  |
Param | Type | Description |
access This | XML_Reader'Class |
|
|
|
|
Contexts
 |  | function Get_Context |  |
 | Get the innermost context. |  |
Param | Type | Description |
access This | XML_Reader'Class |
|
|
|
 |  | function Context_Is |  |
 | Check the innermost context. |  |
Param | Type | Description |
access This | XML_Reader'Class |
|
|
|
|
Reading tags
 |  | function Descend |  |
 | Expect '<' first. Then read one word.
If it starts with '/', pop context and return false.
Otherwise push context and return true. |  |
Param | Type | Description |
access This | XML_Reader'Class |
|
|
|
 |  | procedure Assert_Tag_Name |  |
 | Read the next tag name. Check if it is what we expect.
Call Error if not, and that raises Syntax_Error. |  |
Param | Type | Description |
access This | XML_Reader'Class |
|
|
|
 |  | procedure Exit_Tag |  |
 | Skip over closing '>' (and possibly '/' or '?'). |  |
Param | Type | Description |
access This | XML_Reader'Class |
|
|
 |  | procedure Assert_Tag |  |
 | Assert the next tag name, then exit tag and return. |  |
Param | Type | Description |
access This | XML_Reader'Class |
|
|
|
 |  | procedure Exit_Element |  |
 | Leave the innermost element: skip over closing tag that matches
the element name stored in This.Context. |  |
Param | Type | Description |
access This | XML_Reader'Class |
|
|
Reading attributes
 |  | procedure Read_Attribute_Name |  |
 | Read one token. |  |
Param | Type | Description |
access This | XML_Reader'Class |
|
|
 |  | procedure Assert_Attribute_Name |  |
 | Read the next attribute name. Check if it is what we expect.
Call Error if not, and that raises Syntax_Error. |  |
Param | Type | Description |
access This | XML_Reader'Class |
|
|
|
 |  | procedure Read_Attribute_Value |  |
 | Expect '=' first, then read one token. |  |
Param | Type | Description |
access This | XML_Reader'Class |
|
|
 |  | procedure Assert_Attribute_Value |  |
 | Read the next attribute value. Check if it is what we expect.
Call Error if not, and that raises Syntax_Error. |  |
Param | Type | Description |
access This | XML_Reader'Class |
|
|
|
Reading data
 |  | function Read_Data |  |
 | Read characters from input until '<' is found. |  |
Param | Type | Description |
access This | XML_Reader'Class |
|
|
|
 |  | function Read_Element_Data |  |
 | Read characters enclosed with an element. |  |
Param | Type | Description |
access This | XML_Reader'Class |
|
|
|
|
|