The output from the XML parser and the input to the
XML output procedure is a complex data structure composed of
a hierarchy of typed components. Each component is a record whose
fields correspond to parts of the XML structure that the
record represents. There are no special operations on these records;
each is a tuple with named subparts. The root record type is
xml-document, which represents a complete XML
Each record type type has the following associated bindings:
#tif the object is a record of this type, or
xml-documentrecord is the top-level record representing a complete XML document. Declaration is either an
#f. Dtd is either an
#f. Root is an
xml-elementobject. Misc-1, misc-2, and misc-3 are lists of miscellaneous items; a miscellaneous item is either an
xml-processing-instructionsobject, or a string of whitespace.
xml-elementrecord represents general XML elements; the bulk of a typical XML document consists of these elements. Name is the element name (an XML name). Attributes is a list of XML attribute objects. Contents is a list of the contents of the element. Each element of this list is either a string, an
xml-elementrecord or an
xml-processing-instructionsrecord represents processing instructions, which have the form `<?name ... ?>'. These instructions are intended to contain non-XML data that will be processed by another interpreter; for example they might contain PHP programs. The name field is the processor name (a symbol), and the text field is the body of the instructions (a string).
The remaining record types are valid only within a DTD.
xml-!elementrecord represents an element-type declaration. Name is the XML name of the type being declared (a symbol). Content-type describes the type and can have several different values, as follows:
- The XML names `EMPTY' and `ANY' correspond to the XML keywords of the same name.
- A list `(MIX type ...)' corresponds to the `(#PCDATA | type | ...)' syntax.
xml-!attlistrecord represents an attribute-list declaration. Name is the XML name of the type for which attributes are being declared (a symbol). Definitions is a list of attribute definitions, each of which is a list of three elements
(name type default
). Name is an XML name for the name of the attribute (a symbol). Type describes the attribute type, and can have one of the following values:
- The XML names `CDATA', `IDREFS', `IDREF', `ID', `ENTITY', `ENTITIES', `NMTOKENS', and `NMTOKEN' correspond to the XML keywords of the same names.
- A list `(NOTATION name1 name2 ...)' corresponds to the `NOTATION (name1 | name2 ...)' syntax.
- A list `(ENUMERATED name1 name2 ...)' corresponds to the `(name1 | name2 ...)' syntax.
Default describes the default value for the attribute, and can have one of the following values:
- The XML names `#REQUIRED' and `#IMPLIED' correspond to the XML keywords of the same names.
- A list `(#FIXED value)' corresponds to the `#FIXED "value"' syntax. Value is represented as a string.
- A list `(DEFAULT value)' corresponds to the `"value"' syntax. Value is represented as a string.
xml-external-idrecord is a reference to an external DTD. This reference consists of two parts: id is a public ID literal, corresponding to the `PUBLIC' keyword, while uri is a system literal, corresponding to the `SYSTEM' keyword. Either or both may be present, depending on the context. Id is represented as a string, while uri is represented as a URI record.