SUMMARY: MODULE | CLASS | TYPE | PROC | VAR | CONST | DETAIL: TYPE | PROC | VAR | CONST |
URI XML:DTD XML:Locator
Class List | |
Attribute | |
AttributeList | |
Builder | This abstract class defines the interface of the XML parser to the application. |
Class Summary: Attribute [Detail] | |
+--XML:Builder.Attribute | |
Field Summary | |
attrDecl-: AttrDecl | |
localName: String | |
namespaceDecl: NamespaceDeclaration | |
pos-: Position | |
specified-: BOOLEAN | |
value-: AttValue | |
Constructor Summary | |
InitAttribute(Attribute, NamespaceDeclaration, String, AttrDecl, AttValue, BOOLEAN, Locator) | |
NewAttribute(NamespaceDeclaration, String, AttrDecl, AttValue, BOOLEAN, Locator): Attribute Creates a new attribute instance. |
Class Summary: AttributeList [Detail] | |
+--XML:Builder.AttributeList | |
Field Summary | |
attr-: AttributeArray The attribute values stored in the list. | |
len-: LONGINT The length of the attribute list. | |
Constructor Summary | |
InitAttributeList(AttributeList) | |
NewAttributeList(): AttributeList Creates a new, empty attribute list. | |
Method Summary | |
Append(Attribute) Appends the attribute attr to the list. | |
Clear() Returns attrList to an empty list. |
Class Summary: Builder [Detail] | |
+--XML:Builder.Builder This abstract class defines the interface of the XML parser to the application. It is based on the W3C Working Draft `XML Information Set', dated March 2001. This specification can be obtained at http://www.w3.org/TR/2001/WD-xml-infoset-20010316/. All information items required by the XML Information Set are made available by the parser. The low-level interface to the parser is governed by two requirements: It must make all core properties (and, as far as possible, all peripheral properties) of the XML Infoset available to the application, and the parser must be able to serve it without any overhead. For this reason, the interface is not an instance of any of the established parser interfaces, like SAX, SAX2, or DOM. Specializations of Builder provide these interfaces. The parser itself is not namespace aware, even if this interface has the necessary hooks to provide namespace information. Namespaces are implemented by a special builder, XML:Builder:Namespaces.Builder, that translates between the parser and a namespace-aware application. The parser calls the type-bound procedures of the builder while traversing the document. The string arguments passed to the procedures should not be modified by any concrete builder. In case of a fatal error, the parser will stop invoking any builder procedures, with the exception of Builder.EndDocument. Important: The locator positions always refer to the top level of the processed file. They do not follow internal entity references. For example, if a start tag of an element is defined within an internal entity, then the locator position of Builder.StartElement is the position of the entity reference, instead of the position of the markup text. | |
Constructor Summary | |
Init(Builder) | |
New(): Builder Creates a new builder that does not do anything with the callbacks initiated by the parser. | |
Method Summary | |
Attribute(NamespaceDeclaration, String, AttrDecl, AttValue, BOOLEAN) Called for every attribute (specified or defaulted) of the current element. | |
AttributesDone() Called when the all attributes of a start tag, specified or defaulted, have been reported to the application. | |
Characters(VAR StringVar, CharPos, CharPos, ElementWhitespaceType) Called for non-markup characters that appear within the document element. | |
Comment(VAR StringVar, CharPos, CharPos) Called for comments. | |
EndCDATA() Called at the end of a CDATA section. | |
EndDTD(ExternalEntity, BOOLEAN) This method is called by the paser when is done parsing the document type declaration. | |
EndDocument() Called by the parser after it has processed the whole document. | |
EndElement(NamespaceDeclaration, String) Called when an end tag is parsed. | |
EndEntity(Entity) Called when parsing of the replacement text of entity is done. | |
EntityDecl(Entity) Called for declarations of general entities. | |
NamespaceDeclaration(NamespaceDeclaration) Called for namespace declarations in an attribute list. | |
Notation(Notation) Called for notation declarations. | |
ProcessingInstruction(String, VAR StringVar, CharPos, CharPos, URI) Called for processing instructions. | |
SetErrorListener(ErrorListener) Indicates the object el that the builder should use for error signalling. | |
SetLocator(Locator) Indicates which locator object the parser uses to communicate positional information. | |
SkippedEntity(String, Entity) This method is called for every entity skipped by a non-validating parser, if it configured to ignore references to external parsed entities. | |
StartCDATA() Called at the beginning of a CDATA section. | |
StartDTD(Builder) Called by the parser just before it begins parsing the document type declaration. | |
StartDocument(ExternalEntity) Marks the start of the document. | |
StartElement(NamespaceDeclaration, String) Called whenever a start tag is being parsed. | |
StartEntity(Entity) This method is called before the replacement text of a general entity is inspected in an element's content. |
Type Summary | |
[AttributeArray] = POINTER TO ARRAY OF Attribute |
Class Detail: Attribute |
Field Detail |
FIELD attrDecl-: AttrDecl
FIELD localName: String
FIELD namespaceDecl: NamespaceDeclaration
FIELD pos-: Position
FIELD specified-: BOOLEAN
FIELD value-: AttValue
Constructor Detail |
PROCEDURE InitAttribute(attr: Attribute; namespaceDecl: NamespaceDeclaration; localName: String; attrDecl: AttrDecl; value: AttValue; specified: BOOLEAN; locator: Locator)
PROCEDURE NewAttribute(namespaceDecl: NamespaceDeclaration; localName: String; attrDecl: AttrDecl; value: AttValue; specified: BOOLEAN; locator: Locator): Attribute
Creates a new attribute instance. The instance's field are taken directly from the passed arguments. The locator is discarded if specified is FALSE.
Class Detail: AttributeList |
Field Detail |
FIELD attr-: AttributeArray
The attribute values stored in the list. The pointers in the range `[0, len-1[' refer to Attribute instances.
The array pointer can change when the list is modified.
FIELD len-: LONGINT
The length of the attribute list.
Constructor Detail |
PROCEDURE InitAttributeList(attrList: AttributeList)
PROCEDURE NewAttributeList(): AttributeList
Creates a new, empty attribute list.
Method Detail |
PROCEDURE (attrList: AttributeList) Append(attr: Attribute)
Appends the attribute attr to the list.
PROCEDURE (attrList: AttributeList) Clear()
Returns attrList to an empty list.
Class Detail: Builder |
Constructor Detail |
PROCEDURE Init(b: Builder)
PROCEDURE New(): Builder
Creates a new builder that does not do anything with the callbacks initiated by the parser.
Method Detail |
PROCEDURE (b: Builder) Attribute(namespaceDecl: NamespaceDeclaration; localName: String; attrDecl: AttrDecl; value: AttValue; specified: BOOLEAN)
Called for every attribute (specified or defaulted) of the current element. For a namespace aware parser, namespaceDecl refers to the namespace URI of the element name. If the name has no namespace part, the argument is NIL. localName is the element minus the namespace prefix and the colon. The namespace prefix of the attribute name can be obtained from namespaceDecl.
If an attribute declaration for this attribute is known to the parser, it is passed in attrDecl. Without a declaration, the application should treat the attribute as if it were of type DTD.attrCDATA.
If the attribute is specified in the element's attribute list, instead of being defaulted from the attribute's declaration, specified is TRUE.
The attribute's value is passed into the parameter value. Call DTD.AttValue.Flatten or DTD.AttValue.FlattenValue to retrieve the normalized value of the attribute. You can also access the data structure value. The string values in the data structure are normalized for CDATA values. When reading value for non-CDATA attributes, you must collapse sequences of whitespace into a single space, and remove any whitespace from the beginning and the end of the attribute value.
The locator is at the beginning of the attribute's name, if specified is TRUE. For defaulted attributes, the locator is undefined.
PROCEDURE (b: Builder) AttributesDone()
Called when the all attributes of a start tag, specified or defaulted, have been reported to the application. The locator is positioned after the closing `>' of the start or empty element tag.
PROCEDURE (b: Builder) Characters(VAR chars: StringVar; charsStart: CharPos; charsEnd: CharPos; elementWhitespace: ElementWhitespaceType)
Called for non-markup characters that appear within the document element. The array slice `chars[charsStart, charsEnd[' holds the character data. elementWhitespace indicates whether the characters are whitespace appearing within element content.
The locator refers to the first character.
Note: It is up to the parser how it partitions character data before reporting it to the application. For example, the character data of an element may be reported in one call to Builder.Characters, or in multiple chunks, depending on embedded character references, general entity references, CDATA sections, and the size of the character content. It is only guaranteed that this procedure is called with an integral number of ISO 10646 characters (e.g., surrogate pairs are reported in one call).
PROCEDURE (b: Builder) Comment(VAR chars: StringVar; charsStart: CharPos; charsEnd: CharPos)
Called for comments. The array slice `chars[charsStart, charsEnd[' holds the comment's content.
The locator is positioned at the `<!--'.
PROCEDURE (b: Builder) EndCDATA()
Called at the end of a CDATA section. The locator refers to the position after the `]]>'.
PROCEDURE (b: Builder) EndDTD(externalDTD: ExternalEntity; allDeclarationsProcessed: BOOLEAN)
This method is called by the paser when is done parsing the document type declaration. If the DTD had an external subset, the reference to the entity is passed in externalDTD. The public and system identifier of the external subset are available through the entity item.
If allDeclarationsProcessed is TRUE, then the parser has read the complete DTD.
The locator is positioned after the closing `>' of the DTD, and the external DTD subset has been processed.
PROCEDURE (b: Builder) EndDocument()
Called by the parser after it has processed the whole document. Afterwards, none of the other builder methods will be called. Note that unlike all the other event reporting methods, this method is even called if the document had a fatal error. The locator is positioned at the very end of the file.
PROCEDURE (b: Builder) EndElement(namespaceDecl: NamespaceDeclaration; localName: String)
Called when an end tag is parsed. See Builder.StartElement for a description of the arguments. The locator is positioned at the beginning of the end tag's name, if an explicit end tag exists. Otherwise, it is placed after the closing `/>' of the empty element tag.
PROCEDURE (b: Builder) EndEntity(entity: Entity)
Called when parsing of the replacement text of entity is done. The locator points to the first character after the entity reference.
PROCEDURE (b: Builder) EntityDecl(entity: Entity)
Called for declarations of general entities. The locator points to the first character of the declared name.
Note: The document entity is passed to Builder.StartDocument, and the entity for the external DTD subset to Builder.EndDTD, of it exists.
PROCEDURE (b: Builder) NamespaceDeclaration(namespaceDecl: NamespaceDeclaration)
Called for namespace declarations in an attribute list. Note: The parser implementation XML:Parser.Parser does not know about namespaces and never calls this method. Use the adapter builder XML:Builder:Namespaces.Builder to introduce namespace information into the event stream. The locator position is undefined.
PROCEDURE (b: Builder) Notation(notation: Notation)
Called for notation declarations. The locator points to the first character of the declared name.
PROCEDURE (b: Builder) ProcessingInstruction(target: String; VAR content: StringVar; contentStart: CharPos; contentEnd: CharPos; baseURI: URI)
Called for processing instructions. target holds the PI's target part. The array slice `content[contentStart, contentEnd[' holds the content data. baseURI is the absolute URI of the entity in which the PI appears.
The locator is positioned at the `<?'.
PROCEDURE (b: Builder) SetErrorListener(el: ErrorListener)
Indicates the object el that the builder should use for error signalling. Any errors will subsequently be reported through el.Error. This method is called by the parser before it begins processing of the document.
PROCEDURE (b: Builder) SetLocator(locator: Locator)
Indicates which locator object the parser uses to communicate positional information. If this method is not called before Builder.StartDocument, the builder should assume that no locator is available during processing. This method may be called several times during processing of a document.
Pre-condition: `locator' is not NIL.
PROCEDURE (b: Builder) SkippedEntity(name: String; entity: Entity)
This method is called for every entity skipped by a non-validating parser, if it configured to ignore references to external parsed entities. name is the name of the skipped entity and entity its entity declaration, if this information is available. The locator refers to the beginning of the name of the entity reference.
PROCEDURE (b: Builder) StartCDATA()
Called at the beginning of a CDATA section. The next calls to Builder.Characters before Builder.EndCDATA represent the CDATA's character content.
The locator is positioned at `<![CDATA['.
PROCEDURE (b: Builder) StartDTD(dtdBuilder: Builder)
Called by the parser just before it begins parsing the document type declaration. dtdBuilder is the object that is used by the parser to build the DTD data structure. All comments and processing instruction events that are reported between Builder.StartDTD and Builder.EndDTD are part of the DTD. Events from the internal DTD are reported before events of the external DTD. The locator is positioned at the beginning of `<!DOCTYPE'.
PROCEDURE (b: Builder) StartDocument(documentEntity: ExternalEntity)
Marks the start of the document. This method is called just before parsing begins. The base URI of the document can be obtained from documentEntity, if it has been passed to XML:Parser.NewChannel. The locator is positioned at the very beginning of the file.
PROCEDURE (b: Builder) StartElement(namespaceDecl: NamespaceDeclaration; localName: String)
Called whenever a start tag is being parsed. For a namespace aware parser, namespaceDecl refers to the namespace URI of the element name. If the name has no namespace part, the argument is NIL. localName is the element minus the namespace prefix and the colon. The namespace prefix of the attribute name can be obtained from namespaceDecl.
b The locator is positioned at the beginning of the start tag's name.
Note: Namespaces are only partially supported in the parser itself. For full namespace support, the special builder class XML:Builder:Namespaces.Builder must be put between the parser and the application.
PROCEDURE (b: Builder) StartEntity(entity: Entity)
This method is called before the replacement text of a general entity is inspected in an element's content. entity refers to the entity that is being expanded. The locator points to the `&' in front of the name of the entity reference.
Type Detail |
TYPE [AttributeArray] = POINTER TO ARRAY OF Attribute