Abstract
This document describes XML extensions supported by Unicorn ECMAScript Interpreter (UESI).
Status of this document
This document forms part of the Unicorn ECMAScript Interpreter (UESI) Reference Manual.
Comments on this document may be sent to [email protected]
Table of contents
- 1 Introduction
- 2 Overview
- 3 Conventions
- 4 XML Objects
-
- 4.1 The XML Object
- 4.2 Attributes Objects
- 4.3 ContentHandler Objects
- 4.4 DTDHandler Objects
- 4.5 EntityResolver Objects
- 4.6 ErrorHandler Objects
- 4.7 InputSource Objects
- 4.8 Locator Objects
- 4.9 NamespaceSupport Objects
-
- 4.9.1 The NamespaceSupport Constructor Called as a Function
-
- 4.9.2 The NamespaceSupport Constructor
-
- 4.9.3 Properties of the NamespaceSupport Constructor
-
- 4.9.4 XML.NamespaceSupport.XMLNS
- 4.9.5 Properties of the NamespaceSupport Prototype Object
-
- 4.9.6 Properties of the NamespaceSupport Instances
-
- 4.9.7 Properties of the Enumeration Objects
-
- 4.10 Exception Objects
- 4.11 NotSupportedException Objects
- 4.12 NotRecognizedException Objects
- 4.13 ParseException Objects
- 4.14 Stream Objects
- 4.15 Processor Objects
- 4.16 Reader Objects
- 4.17 Filter Objects
- 4.18 Writer Objects
Appendices
1 Introduction
This document describes XML extensions supported by Unicorn ECMAScript Interpreter (UESI).
2 Overview
XML extensions provide built-in ECMAScript objects that support basic XML processing interfaces.
Many object categories provide functionality specified by SAX2: Simple API for XML, effectively implementing ECMAScript bindings for SAX2. Few other objects, that have no counterparts in SAX2, were introduced to support integration of various XML-enabling ECMAScript extensions available in UESI (e.g., DOM and XSLT), and to provide sophisticated XML output facility (XML Writer) designed to represent XML documents in XML, HTML and text formats.
Attributes objects represent lists of XML attributes. They implement functionality similar to that of the Attributes interface and AttributesImpl class specified by SAX2.
ContentHandler objects are used to receive notifications of the logical content of documents. They implement functionality similar to that of the ContentHandler interface specified by SAX2.
DTDHandler objects are used to receive notifications of basic DTD-related events. They implement functionality similar to that of the DTDHandler interface specified by SAX2.
EntityResolver objects provide basic interface for resolving entities. They implement functionality similar to that of the EntityResolver interface specified by SAX2.
ErrorHandler objects provide basic interface for XML Reader error handlers. They implement functionality similar to that of the ErrorHandler interface specified by SAX2.
InputSource objects represent input sources for XML entities. They implement functionality similar to that of the InputSource class specified by SAX2.
Locator objects represent interface for associating XML Stream events with document locations. They implement functionality similar to that of the Locator interface and LocatorImpl class specified by SAX2.
NamespacesSupport objects encapsulate namespace logic. They implement functionality similar to that of the NamespaceSupport class specified by SAX2.
Exception objects are used to encapsulate general XML errors and warnings. They implement functionality similar to that of the SAXException class specified by SAX2.
NotSupportedException objects are used for unsupported operations. They implement functionality similar to that of the SAXNotSupportedException class specified by SAX2.
NotRecognizedException objects are used for unrecognized identifiers. They implement functionality similar to that of the SAXNotRecognizedException class specified by SAX2.
ParseException objects are used to encapsulate XML parse errors and warnings. They implement functionality similar to that of the SAXParseException class specified by SAX2.
Stream objects represent interfaces for reading content of XML documents. Every stream object generates a sequence of events. Each event represents a piece of XML content. Stream objects are normally associated with ContentHandler objects. The latter implement the ContentHandler interface and are used to process events generated by Streams. There is no direct counterpart for Stream objects in SAX2. In UESI, Stream represents more primitive object type than the interface XMLReader recommended by SAX2, since it does not provide DTD handling, entity resolving and handling for parse errors.
Processor objects combine functionality provided by Stream and ContentHandler objects. The Processor instance is like a Stream, except that it obtains its events from another Stream rather than a primary source. Processors can modify a stream of events as they pass on to their associated content handlers. Processor objects can be used to implement pipelines of XML processing components. Processor objects have no direct counterparts in SAX2. In UESI, Stream and Processor objects have relation similar to that of interfaces XMLReader and XMLFilter specified by SAX2.
Reader objects implement interface for reading XML documents using callbacks. They implement functionality similar to that of the XMLReader interface specified by SAX2.
Filter objects implement interface for XML filters. They implement functionality similar to that of the XMLFilterImpl class specified by SAX2. Filter objects combine functionality provided by Reader, DTDHandler, ContentHandler, EntityResolver and ErrorHandler objects. The Filter instance is like Reader, except that it obtains its events from another Reader rather than a primary source. Filters can modify a stream of events as they pass on to the final destination.
Writer objects implement interface for writing XML documents using XML, HTML and text output methods. Writer objects have no counterparts in core SAX2. The functionality of Writer objects is modelled after the output facility of XSL Transformations (XSLT), version 1.0.
Stream and ContentHandler objects play an important role for integration of various XML-enabling ECMAScript extensions implemented by UESI. Stream objects generate sequences of events representing content of XML documents, while ContentHandler objects act as consumers (processors) of these events. Some objects may act as both streams and content handlers. By linking streams and content handlers together, various UESI XML-enabling components can be integrated to provide the desired XML processing functonality.
Many objects supported by other ECMAScript extension packages available in UESI (e.g., DOM and XSLT) implement interfaces of Stream or ContentHandler, and therefore can be integrated using the common basic concept.
3 Conventions
Concepts and notation of the ECMA-262 Standard (ECMAScript Language Specification) are used in this document.
This document contains no detailed description for the semantics of SAX2-based objects, their properties and functions. Refer to the original SAX2 specification for details.
4 XML Objects
There are certain built-in XML extension objects available whenever UESI begins execution of a program. One, the XML object, is accessible as an initial property of the global object. Others are accessible as initial properties of the XML object.
All XML extension objects implement the semantics of native ECMAScript objects as specified in ECMA-262.
In every case, the length property of a built-in Function object described in this section has the attributes { DontEnum, DontDelete, ReadOnly } (and no others). Every other property described in this section has the attributes { DontEnum, DontDelete } (and no others) unless otherwise specified.
4.1 The XML Object
The XML object does not have a [[Construct]] property; it is not possible to use the XML object as a constructor with the new expression.
The XML object does not have a [[Call]] property; it is not possible to invoke the XML object as a function.
The value of the internal [[Prototype]] property of the XML object is the Object prototype. The value of the internal [[Class]] property of the XML object is "XML".
4.1.1 Constructor Properties of the XML Object
4.1.1.1 Attributes(...)
See "The Attributes Constructor Called As Function" and "The Attributes Constructor" .
4.1.1.2 ContentHandler(...)
See "The ContentHandler Constructor Called As Function" and "The ContentHandler Constructor" .
4.1.1.3 DTDHandler(...)
See "The DTDHandler Constructor Called As Function" and "The DTDHandler Constructor" .
4.1.1.4 EntityResolver(...)
See "The EntityResolver Constructor Called As Function" and "The EntityResolver Constructor" .
4.1.1.5 ErrorHandler(...)
See "The ErrorHandler Constructor Called As Function" and "The ErrorHandler Constructor" .
4.1.1.6 InputSource(...)
See "The InputSource Constructor Called As Function" and "The InputSource Constructor" .
4.1.1.7 Locator(...)
See "The Locator Constructor Called As Function" and "The Locator Constructor" .
4.1.1.8 NamespaceSupport(...)
See "The NamespaceSupport Constructor Called As Function" and "The NamespaceSupport Constructor" .
4.1.1.9 Exception(...)
See "The Exception Constructor Called As Function" and "The Exception Constructor" .
4.1.1.10 NotSupportedException(...)
See "The NotSupportedException Constructor Called As Function" and "The NotSupportedException Constructor" .
4.1.1.11 NotRecognizedException(...)
See "The NotRecognizedException Constructor Called As Function" and "The NotRecognizedException Constructor" .
4.1.1.12 ParseException(...)
See "The ParseException Constructor Called As Function" and "The ParseException Constructor" .
4.1.1.13 Stream(...)
See "The Stream Constructor Called As Function" and "The Stream Constructor" .
4.1.1.14 Processor(...)
See "The Processor Constructor Called As Function" and "The Processor Constructor" .
4.1.1.15 Reader(...)
See "The Reader Constructor Called As Function" and "The Reader Constructor" .
4.1.1.16 Filter(...)
See "The Filter Constructor Called As Function" and "The Filter Constructor" .
4.1.1.17 Writer(...)
See "The Writer Constructor Called As Function" and "The Writer Constructor" .
4.2 Attributes Objects
4.2.1 The Attributes Constructor Called as a Function
Not supported in the current release of UESI. Reserved for the future.
4.2.1.1 XML.Attributes(...)
Not supported in the current release of UESI. Reserved for the future.
4.2.2 The Attributes Constructor
When XML.Attributes is called as part of a new expression, it is a constructor: it initializes the newly created Attributes instance.
4.2.2.1 new XML.Attributes([atts])
If undefined, an empty Attributes instance is constructed.
isOtherwise
must be an Attributes object. A copy of object is constructed.4.2.3 Properties of the Attributes Constructor
The value of the internal [[Prototype]] property of the Attributes constructor is the Function prototype object.
Besides the internal properties and the length property (whose value is 1), the Attributes constructor has the following properties.
4.2.3.1 XML.Attributes.prototype
The initial value of the XML.Attributes.prototype is the Attributes prototype object.
This property has the attributes { DontEnum, DontDelete, ReadOnly }.
4.2.4 Properties of the Attributes Prototype Object
The Attributes prototype object is itself an Attributes object (its [[Class]] is "XML.Attributes").
The value of the internal [[Prototype]] property of the Attribute prototype object is the Object prototype.
Initially the Attributes prototype object is empty (contains no attributes).
4.2.4.1 XML.Attributes.prototype.constructor
The initial value of XML.Attributes.prototype.constructor is the built-in Attributes constructor.
4.2.4.2 XML.Attributes.prototype.getURI(index)
Looks up the attribute's namespace URI by index.
Let ToInt32( ). The function returns the string value containing the namespace URI of the attribute with index (zero-based), or the empty string if none is available. If the index is out of range, the runtime error is generated.
be a number value computed by4.2.4.3 XML.Attributes.prototype.getLocalName(index)
Looks up the attribute's local name by index.
Let ToInt32( ). The function returns the string value containing the local name of the attribute with index (zero-based), or the empty string if none is available. If the index is out of range, the runtime error is generated.
be a number value computed by4.2.4.4 XML.Attributes.prototype.getQName(index)
Looks up the attribute's qualified name by index.
Let ToInt32( ). The function returns the string value containing the qualified name of the attribute with index (zero-based). If the index is out of range, the runtime error is generated.
be a number value computed by4.2.4.5 XML.Attributes.prototype.getIndex(arg1 [, arg2])
If undefined, let be a string value computed by ToString( ). The function returns the number value equal to the index of an attribute having qualified name , or -1 if it does not appear in the list.
isIf undefined, let be a string value computed by ToString( ) and be a string value computed by ToString( ). The function returns the number value equal to the index of an attribute having namespace URI and local name , or -1 if it does not appear in the list.
is not4.2.4.6 XML.Attributes.prototype.getType(arg1 [, arg2])
If undefined, let be a string value computed by ToString( ). The function returns the string value equal to the type of an attribute having qualified name , or null if it does not appear in the list.
isIf undefined, let be a string value computed by ToString( ) and be a string value computed by ToString( ). The function returns the string value equal to the type of an attribute having namespace URI and local name , or null if it does not appear in the list.
is not4.2.4.7 XML.Attributes.prototype.getValue(arg1 [, arg2])
If undefined, let be a string value computed by ToString( ). The function returns the string value equal to the value of an attribute having qualified name , or null if it does not appear in the list.
isIf undefined, let be a string value computed by ToString( ) and be a string value computed by ToString( ). The function returns the string value equal to the value of an attribute having namespace URI and local name , or null if it does not appear in the list.
is not4.2.4.8 XML.Attributes.prototype.clear()
Clears the attribute list for reuse. Returns undefined value.
The runtime error is generated if this Attributes instance was not created by new expression.
4.2.4.9 XML.Attributes.prototype.setAttributes(atts)
Copies an entire Attributes instance. Returns undefined value. The argument must be an Attributes object.
The runtime error is generated if this Attributes instance was not created by new expression.
4.2.4.10 XML.Attributes.prototype.addAttribute(uri, localName, qName, type, value)
Adds an attribute to the end of the attribute list.
Let ToString( ), be a string value computed by ToString( ), be a string value computed by ToString( ), be a string value computed by ToString( ) and be a string value computed by ToString( ). The function creates an attribute with the namespace URI , local name , qualified name , type and value and adds this attribute to the end of the list. Returns undefined value.
be a string value computed byThe runtime error is generated if this Attributes instance was not created by new expression.
4.2.4.11 XML.Attributes.prototype.setAttribute(index, uri, localName, qName, type, value)
Sets an attribute in the list.
Let ToInt32( ), be a string value computed by ToString( ), be a string value computed by ToString( ), be a string value computed by ToString( ), be a string value computed by ToString( ) and be a string value computed by ToString( ). The function sets namespace URI , local name , qualified name , type and value to the attribute in the list having the index (zero-based). Returns undefined value. The runtime error is generated if the index is out of range.
be a number value computed byThe runtime error is generated if this Attributes instance was not created by new expression.
4.2.4.12 XML.Attributes.prototype.removeAttribute(index)
Removes an attribute from the list.
Let ToInt32( ), The function removes from the attribute list the attribute having the index (zero-based). Returns undefined value. The runtime error is generated if the index is out of range.
be a number value computed byThe runtime error is generated if this Attributes instance was not created by new expression.
4.2.4.13 XML.Attributes.prototype.setURI(index, uri)
Sets a namespace URI of a specific attribute.
Let ToInt32( )and be a string value computed by ToString( ). The function sets namespace URI to the attribute in the list having the index (zero-based). Returns undefined value. The runtime error is generated if the index is out of range.
be a number value computed byThe runtime error is generated if this Attributes instance was not created by new expression.
4.2.4.14 XML.Attributes.prototype.setLocalName(index, localName)
Sets local name of a specific attribute.
Let ToInt32( )and be a string value computed by ToString( ). The function sets local name to the attribute in the list having the index (zero-based). Returns undefined value. The runtime error is generated if the index is out of range.
be a number value computed byThe runtime error is generated if this Attributes instance was not created by new expression.
4.2.4.15 XML.Attributes.prototype.setQName(index, qName)
Sets qualified name of a specific attribute.
Let ToInt32( )and be a string value computed by ToString( ). The function sets qualified name to the attribute in the list having the index (zero-based). Returns undefined value. The runtime error is generated if the index is out of range.
be a number value computed byThe runtime error is generated if this Attributes instance was not created by new expression.
4.2.4.16 XML.Attributes.prototype.setType(index, type)
Sets qualified name of a specific attribute.
Let ToInt32( )and be a string value computed by ToString( ). The function sets type to the attribute in the list having the index (zero-based). Returns undefined value. The runtime error is generated if the index is out of range.
be a number value computed byThe runtime error is generated if this Attributes instance was not created by new expression.
4.2.4.17 XML.Attributes.prototype.setValue(index, value)
Sets value of a specific attribute.
Let ToInt32( )and be a string value computed by ToString( ). The function sets value to the attribute in the list having the index (zero-based). Returns undefined value. The runtime error is generated if the index is out of range.
be a number value computed byThe runtime error is generated if this Attributes instance was not created by new expression.
4.2.5 Properties of the Attributes Instances
The value of the internal [[Prototype]] property of the Attributes instance is the Attributes prototype object.
The value of the internal [[Class]] property of the Attributes instance is "XML.Attributes".
Attributes instances inherit properties from their [[Prototype]] object, and also have the following properties.
4.2.5.1 length
Number of attributes in the list.
This property has the attributes { DontDelete, DontEnum, ReadOnly }.
4.3 ContentHandler Objects
ContentHandler objects are used to receive notifications of the logical content of documents. They implement functionality similar to that of the ContentHandler interface specified by SAX2.
ContentHandler instances are normally used to process events generated by XML Streams. Specific event processing operations are implemented as functions of ContentHandler prototype object. For every particular ContentHandler instance, these functions can be redefined in ECMAScript code, thus implementing the desired processing.
UESI provides few other categories of built-in objects that implement the same interfaces as ContentHandler objects and have the ContentHandler prototype in their prototype chain. Objects of these catrgories are logically treated as content handlers and can be used in every context where ContentHandler objects are required.
4.3.1 The ContentHandler Constructor Called as a Function
Not supported in the current release of UESI. Reserved for the future.
4.3.1.1 XML.ContentHandler(...)
Not supported in the current release of UESI. Reserved for the future.
4.3.2 The ContentHandler Constructor
When XML.ContentHandler is called as part of a new expression, it is a constructor: it initializes the newly created ContentHandler instance.
4.3.2.1 new XML.ContentHandler()
No specific properties are assigned to the newly created ContentHandler instance.
4.3.3 Properties of the ContentHandler Constructor
The value of the internal [[Prototype]] property of the ContentHandler constructor is the Function prototype object.
Besides the internal properties and the length property (whose value is 0), the ContentHandler constructor has the following properties.
4.3.3.1 XML.ContentHandler.prototype
The initial value of the XML.ContentHandler.prototype is the ContentHandler prototype object.
This property has the attributes { DontEnum, DontDelete, ReadOnly }.
4.3.4 Properties of the ContentHandler Prototype Object
The ContentHandler prototype object is itself a ContentHandler object (its [[Class]] is "XML.ContentHandler").
The value of the internal [[Prototype]] property of the ContentHandler prototype object is the Object prototype.
4.3.4.1 XML.ContentHandler.prototype.constructor
The initial value of XML.ContentHandler.prototype.constructor is the built-in ContentHandler constructor.
4.3.4.2 XML.ContentHandler.prototype.setDocumentLocator(locator)
Receives the object for locating the origin of XML document events. The argument undefined value.
must be the Locator object instance, otherwise the runtime error is generated. The function returnsThe function of the ContentHandler prototype does nothing. The ECMAScript program may override this function for each particular ContentHandler instance.
4.3.4.3 XML.ContentHandler.prototype.startDocument()
Receives notification of the beginning of a document. Returns undefined value.
The function of the ContentHandler prototype does nothing. The ECMAScript program may override this function for each particular ContentHandler instance.
4.3.4.4 XML.ContentHandler.prototype.endDocument()
Receives notification of the end of a document. Returns undefined value.
The function of the ContentHandler prototype does nothing. The ECMAScript program may override this function for each particular ContentHandler instance.
4.3.4.5 XML.ContentHandler.prototype.startPrefixMapping(prefix, uri)
Begins the scope of a prefix to URI namespace mapping. The argument undefined value.
is a string value equal to the namespace prefix. The argument is a string value equal to the corresponding namespace URI. The function returnsThis function is called only if the related XML Stream implements namespace processing.
The function of the ContentHandler prototype does nothing. The ECMAScript program may override this function for each particular ContentHandler instance.
4.3.4.6 XML.ContentHandler.prototype.endPrefixMapping(prefix)
Ends the scope of a prefix to URI namespace mapping. The argument undefined value.
is a string value equal to the namespace prefix. The function returnsThis function is called only if the related XML Stream implements namespace processing.
The function of the ContentHandler prototype does nothing. The ECMAScript program may override this function for each particular ContentHandler instance.
4.3.4.7 XML.ContentHandler.prototype.startElement(namespaceUri, localName, qName, atts)
Receives notification of the beginning of an element. The argument undefined value.
is a string value equal to the namespace URI. It is the empty string if the element has no namespace or if namespace processing is not performed by the related XML Stream. The argument is a string value equal to the local name. It is the empty string if namespace processing is not performed by the related XML Stream. The argument is a string value equal to the qualified name. It is always non-empty. The argument is an Attributes instance used to specify attributes attached to the element. The function returnsThe function of the ContentHandler prototype does nothing. The ECMAScript program may override this function for each particular ContentHandler instance.
4.3.4.8 XML.ContentHandler.prototype.endElement(namespaceUri, localName, qName)
Receives notification of the end of an element. The argument undefined value.
is a string value equal to the namespace URI. It is the empty string if the element has no namespace or if namespace processing is not performed by the related XML Stream. The argument is a string value equal to the local name. It is the empty string if namespace processing is not performed by the related XML Stream. The argument is a string value equal to the qualified name. It is always non-empty. The function returnsThe function of the ContentHandler prototype does nothing. The ECMAScript program may override this function for each particular ContentHandler instance.
4.3.4.9 XML.ContentHandler.prototype.characters(ch)
Receives notification of character data. The argument undefined value.
is a string value containing characters from the XML document. The function returnsThe function of the ContentHandler prototype does nothing. The ECMAScript program may override this function for each particular ContentHandler instance.
4.3.4.10 XML.ContentHandler.prototype.ignorableWhitespace(ch)
Receives notification of ignorable whitespace in element content. The argument undefined value.
is a string value containing characters from the XML document. The function returnsThe function of the ContentHandler prototype does nothing. The ECMAScript program may override this function for each particular ContentHandler instance.
4.3.4.11 XML.ContentHandler.prototype.processingInstruction(target, data)
Receives notification of a processing instruction. The argument undefined value.
is a string value equal to the processing instruction target. The argument is a string value equal to the processing instruction data. The function returnsThe function of the ContentHandler prototype does nothing. The ECMAScript program may override this function for each particular ContentHandler instance.
4.3.4.12 XML.ContentHandler.prototype.skippedEntity(name)
Receives notification of a skipped entity. The argument undefined value.
is a string value equal to the name of the skipped entity. The function returnsThe function of the ContentHandler prototype does nothing. The ECMAScript program may override this function for each particular ContentHandler instance.
4.3.5 Properties of the ContentHandler Instances
The value of the internal [[Prototype]] property of the ContentHandler instance is the ContentHandler prototype object.
The value of the internal [[Class]] property of the ContentHandler instance is "XML.ContentHandler".
ContentHandler instances inherit properties from their [[Prototype]] object.
4.4 DTDHandler Objects
DTDHandler objects are used to receive notifications of basic DTD-related events. They implement functionality similar to that of the DTDHandler interface specified by SAX2.
DTDHandler instances are normally used to process events generated by XML Readers. Specific event processing operations are implemented as functions of DTDHandler prototype object. For every particular DTDHandler instance, these functions can be redefined in ECMAScript code, thus implementing the desired processing.
4.4.1 The DTDHandler Constructor Called as a Function
Not supported in the current release of UESI. Reserved for the future.
4.4.1.1 XML.DTDHandler(...)
Not supported in the current release of UESI. Reserved for the future.
4.4.2 The DTDHandler Constructor
When XML.DTDHandler is called as part of a new expression, it is a constructor: it initializes the newly created DTDHandler instance.
4.4.2.1 new XML.DTDHandler()
No specific properties are assigned to the newly created DTDHandler instance.
4.4.3 Properties of the DTDHandler Constructor
The value of the internal [[Prototype]] property of the DTDHandler constructor is the Function prototype object.
Besides the internal properties and the length property (whose value is 0), the DTDHandler constructor has the following properties.
4.4.3.1 XML.DTDHandler.prototype
The initial value of the XML.DTDHandler.prototype is the DTDHandler prototype object.
This property has the attributes { DontEnum, DontDelete, ReadOnly }.
4.4.4 Properties of the DTDHandler Prototype Object
The DTDHandler prototype object is itself a DTDHandler object (its [[Class]] is "XML.DTDHandler").
The value of the internal [[Prototype]] property of the DTDHandler prototype object is the Object prototype.
4.4.4.1 XML.DTDHandler.prototype.constructor
The initial value of XML.DTDHandler.prototype.constructor is the built-in DTDHandler constructor.
4.4.4.2 XML.DTDHandler.prototype.notationDecl(name, publicId, systemId)
Receives notification of a notation declaration event. The argument undefined value.
is a string value equal to the notation name. The argument is a string value equal to the notation's public identifier. The argument is a string value equal to the notation's system identifier. The function returnsThe function of the DTDHandler prototype does nothing. The ECMAScript program may override this function for each particular DTDHandler instance.
4.4.4.3 XML.DTDHandler.prototype.unparsedEntityDecl(name, publicId, systemId, notationName)
Receives notification of an unparsed entity declaration event. The argument undefined value.
is a string value equal to the entity's name. The argument is a string value equal to the entity's public identifier. The argument is a string value equal to the entity's system identifier. The argument is a string value equal to the name of the associated notation. The function returnsThe function of the DTDHandler prototype does nothing. The ECMAScript program may override this function for each particular DTDHandler instance.
4.4.5 Properties of the DTDHandler Instances
The value of the internal [[Prototype]] property of the DTDHandler instance is the DTDHandler prototype object.
The value of the internal [[Class]] property of the DTDHandler instance is "XML.DTDHandler".
DTDHandler instances inherit properties from their [[Prototype]] object.
EntityResolver objects provide basic interface for resolving entities. They implement functionality similar to that of the EntityResolver interface specified by SAX2.
EntityResolver instances are normally used together with XML Readers in order to intercept external entities. Specific entity resolving operations are implemented as functions of EntityResolver prototype object. For every particular EntityResolver instance, these functions can be redefined in ECMAScript code, thus implementing the desired processing.
4.5 EntityResolver Objects
4.5.1 The EntityResolver Constructor Called as a Function
Not supported in the current release of UESI. Reserved for the future.
4.5.1.1 XML.EntityResolver(...)
Not supported in the current release of UESI. Reserved for the future.
4.5.2 The EntityResolver Constructor
When XML.EntityResolver is called as part of a new expression, it is a constructor: it initializes the newly created EntityResolver instance.
4.5.2.1 new XML.EntityResolver()
No specific properties are assigned to the newly created EntityResolver instance.
4.5.3 Properties of the EntityResolver Constructor
The value of the internal [[Prototype]] property of the EntityResolver constructor is the Function prototype object.
Besides the internal properties and the length property (whose value is 0), the EntityResolver constructor has the following properties.
4.5.3.1 XML.EntityResolver.prototype
The initial value of the XML.EntityResolver.prototype is the EntityResolver prototype object.
This property has the attributes { DontEnum, DontDelete, ReadOnly }.
4.5.4 Properties of the EntityResolver Prototype Object
The EntityResolver prototype object is itself a EntityResolver object (its [[Class]] is "XML.EntityResolver").
The value of the internal [[Prototype]] property of the EntityResolver prototype object is the Object prototype.
4.5.4.1 XML.EntityResolver.prototype.constructor
The initial value of XML.EntityResolver.prototype.constructor is the built-in EntityResolver constructor.
4.5.4.2 XML.EntityResolver.prototype.resolveEntity(publicId, systemId)
Allows the application to resolve external entities. The argument null to request that the XML Reader open a regular URI connection to the system identifier.
is a string value equal to the public identifier of the external entity being referenced. The argument is a string value equal to the system identifier of the external entity being referenced. The function returns an InputSource object instance describing the new input source, orThe function of the EntityResolver prototype does nothing. The ECMAScript program may override this function for each particular EntityResolver instance.
4.5.5 Properties of the EntityResolver Instances
The value of the internal [[Prototype]] property of the EntityResolver instance is the EntityResolver prototype object.
The value of the internal [[Class]] property of the EntityResolver instance is "XML.EntityResolver".
EntityResolver instances inherit properties from their [[Prototype]] object.
4.6 ErrorHandler Objects
ErrorHandler objects provide basic interface for XML Reader error handlers. They implement functionality similar to that of the ErrorHandler interface specified by SAX2.
ErrorHandler instances are normally used to implement customized error handling for XML Readers. Specific error handling operations are implemented as functions of ErrorHandler prototype object. For every particular ErrorHandler instance, these functions can be redefined in ECMAScript code, thus implementing the desired processing.
4.6.1 The ErrorHandler Constructor Called as a Function
Not supported in the current release of UESI. Reserved for the future.
4.6.1.1 XML.ErrorHandler(...)
Not supported in the current release of UESI. Reserved for the future.
4.6.2 The ErrorHandler Constructor
When XML.ErrorHandler is called as part of a new expression, it is a constructor: it initializes the newly created ErrorHandler instance.
4.6.2.1 new XML.ErrorHandler()
No specific properties are assigned to the newly created ErrorHandler instance.
4.6.3 Properties of the ErrorHandler Constructor
The value of the internal [[Prototype]] property of the ErrorHandler constructor is the Function prototype object.
Besides the internal properties and the length property (whose value is 0), the ErrorHandler constructor has the following properties.
4.6.3.1 XML.ErrorHandler.prototype
The initial value of the XML.ErrorHandler.prototype is the ErrorHandler prototype object.
This property has the attributes { DontEnum, DontDelete, ReadOnly }.
4.6.4 Properties of the ErrorHandler Prototype Object
The ErrorHandler prototype object is itself a ErrorHandler object (its [[Class]] is "XML.ErrorHandler").
The value of the internal [[Prototype]] property of the ErrorHandler prototype object is the Object prototype.
4.6.4.1 XML.ErrorHandler.prototype.constructor
The initial value of XML.ErrorHandler.prototype.constructor is the built-in ErrorHandler constructor.
4.6.4.2 XML.ErrorHandler.prototype.warning(exception)
Receives notification of a warning. The argument undefined value.
must be a ParseException instance, otherwise the runtime error is generated. The function returnsThe function of the ErrorHandler prototype does nothing. The ECMAScript program may override this function for each particular ErrorHandler instance.
4.6.4.3 XML.ErrorHandler.prototype.error(exception)
Receives notification of a recoverable error. The argument undefined value.
must be a ParseException instance, otherwise the runtime error is generated. The function returnsThe function of the ErrorHandler prototype does nothing. The ECMAScript program may override this function for each particular ErrorHandler instance.
4.6.4.4 XML.ErrorHandler.prototype.fatalError(exception)
Receives notification of a non-recoverable error. The argument undefined value.
must be a ParseException instance, otherwise the runtime error is generated. The function returnsThe function of the ErrorHandler prototype does nothing. The ECMAScript program may override this function for each particular ErrorHandler instance.
4.6.5 Properties of the ErrorHandler Instances
The value of the internal [[Prototype]] property of the ErrorHandler instance is the ErrorHandler prototype object.
The value of the internal [[Class]] property of the ErrorHandler instance is "XML.ErrorHandler".
ErrorHandler instances inherit properties from their [[Prototype]] object.
4.7 InputSource Objects
InputSource objects represent input sources for XML entities. They implement functionality similar to that of the InputSource class specified by SAX2.
4.7.1 The InputSource Constructor Called as a Function
Not supported in the current release of UESI. Reserved for the future.
4.7.1.1 XML.InputSource(...)
Not supported in the current release of UESI. Reserved for the future.
4.7.2 The InputSource Constructor
When XML.InputSource is called as part of a new expression, it is a constructor: it initializes the newly created InputSource instance.
4.7.2.1 new XML.InputSource([source])
If publicId, systemId, byteStream, encoding and characterStream of the newly created instance to null.
is undefined, set propertiesOtherwise let ToString( ). Set property systemId of the newly created instance to . Set properties publicId, byteStream, encoding and characterStream of the newly created instance to null.
be a string value computed by4.7.3 Properties of the InputSource Constructor
The value of the internal [[Prototype]] property of the InputSource constructor is the Function prototype object.
Besides the internal properties and the length property (whose value is 1), the InputSource constructor has the following properties.
4.7.3.1 XML.InputSource.prototype
The initial value of the XML.InputSource.prototype is the InputSource prototype object.
This property has the attributes { DontEnum, DontDelete, ReadOnly }.
4.7.4 Properties of the InputSource Prototype Object
The InputSource prototype object is itself a InputSource object (its [[Class]] is "XML.InputSource"). Initial values of publicId, systemId, byteStream, encoding and characterStream properties are set to to null.
The value of the internal [[Prototype]] property of the InputSource prototype object is the Object prototype.
4.7.4.1 XML.InputSource.prototype.constructor
The initial value of XML.InputSource.prototype.constructor is the built-in InputSource constructor.
4.7.5 Properties of the InputSource Instances
The value of the internal [[Prototype]] property of the InputSource instance is the InputSource prototype object.
The value of the internal [[Class]] property of the InputSource instance is "XML.InputSource".
InputSource instances inherit properties from their [[Prototype]] object, and also have the following properties.
4.7.5.1 publicId
The public identifier for this input source. String value or null if not specified.
4.7.5.2 systemId
The system identifier for this input source. String value or null if not specified.
4.7.5.3 byteStream
The byte stream object for this input source. Not supported in the current release of UESI (always null). Reserved for the future.
4.7.5.4 encoding
The system character encoding for a byte stream or URI. String value or null if not specified.
4.7.5.5 characterStream
The character stream object for this input source. Not supported in the current release of UESI (always null). Reserved for the future.
Locator objects represent interface for associating XML Stream events with document locations. They implement functionality similar to that of the Locator interface and LocatorImpl class specified by SAX2.
Locator instance may be either created using the new operator or passed to the program from XML Stream. In the latter case modification of Locator instance is not allowed.
4.8 Locator Objects
4.8.1 The Locator Constructor Called as a Function
Not supported in the current release of UESI. Reserved for the future.
4.8.1.1 XML.Locator(...)
Not supported in the current release of UESI. Reserved for the future.
4.8.2 The Locator Constructor
When XML.Locator is called as part of a new expression, it is a constructor: it initializes the newly created Locator instance.
4.8.2.1 new XML.Locator([locator])
If publicId and systemId to null and properties lineNumber and columnNumber to -1.
is undefined, set propertiesOtherwise
must be a Locator instance; if not, the runtime error is generated. The copy of properties will be assigned to the newly created instance.4.8.3 Properties of the Locator Constructor
The value of the internal [[Prototype]] property of the Locator constructor is the Function prototype object.
Besides the internal properties and the length property (whose value is 1), the Locator constructor has the following properties.
4.8.3.1 XML.Locator.prototype
The initial value of the XML.Locator.prototype is the Locator prototype object.
This property has the attributes { DontEnum, DontDelete, ReadOnly }.
4.8.4 Properties of the Locator Prototype Object
The Locator prototype object is itself a Locator object (its [[Class]] is "XML.Locator"). The initial values of publicId and systemId properties are set to null. The initial values of lineNumber and columnNumber properties are set to -1.
The value of the internal [[Prototype]] property of the Locator prototype object is the Object prototype.
4.8.4.1 XML.Locator.prototype.constructor
The initial value of XML.Locator.prototype.constructor is the built-in Locator constructor.
4.8.5 Properties of the Locator Instances
The value of the internal [[Prototype]] property of the Locator instance is the Locator prototype object.
The value of the internal [[Class]] property of the Locator instance is "XML.Locator".
Locator instances inherit properties from their [[Prototype]] object, and also have the following properties.
4.8.5.1 publicId
The public identifier for the current document event. String value of null if unspecified. If the Locator instance was not explicitly created using new expression, this property is read-only.
4.8.5.2 systemId
The system identifier for the current document event. String value of null if unspecified. If the Locator instance was not explicitly created using new expression, this property is read-only.
4.8.5.3 lineNumber
The line number where the current document event ends. Number value or -1 if unspecified. If the Locator instance was not explicitly created using new expression, this property is read-only.
4.8.5.4 columnNumber
The column number where the current document event ends. Number value or -1 if unspecified. If the Locator instance was not explicitly created using new expression, this property is read-only.
4.9 NamespaceSupport Objects
NamespacesSupport objects encapsulate namespace logic. They implement functionality similar to that of the NamespaceSupport class specified by SAX2.
4.9.1 The NamespaceSupport Constructor Called as a Function
Not supported in the current release of UESI. Reserved for the future.
4.9.1.1 XML.NamespaceSupport(...)
Not supported in the current release of UESI. Reserved for the future.
4.9.2 The NamespaceSupport Constructor
When XML.NamespaceSupport is called as part of a new expression, it is a constructor: it initializes the newly created NamespaceSupport instance.
4.9.2.1 new XML.NamespaceSupport()
The newly created NamespaceSupport instance initially contains the only declaration for "xml" prefix.
4.9.3 Properties of the NamespaceSupport Constructor
The value of the internal [[Prototype]] property of the NamespaceSupport constructor is the Function prototype object.
Besides the internal properties and the length property (whose value is 0), the NamespaceSupport constructor has the following properties.
4.9.3.1 XML.NamespaceSupport.prototype
The initial value of the XML.NamespaceSupport.prototype is the NamespaceSupport prototype object.
This property has the attributes { DontEnum, DontDelete, ReadOnly }.
4.9.4 XML.NamespaceSupport.XMLNS
This is a string value equal to the namespace URI that is automatically mapped to the "xml" prefix.
This property has the attributes { DontEnum, DontDelete, ReadOnly }.
4.9.5 Properties of the NamespaceSupport Prototype Object
The NamespaceSupport prototype object is itself a NamespaceSupport object (its [[Class]] is "XML.NamespaceSupport"). Initially it contains the only declaration for "xml" prefix.
The value of the internal [[Prototype]] property of the NamespaceSupport prototype object is the Object prototype.
4.9.5.1 XML.NamespaceSupport.prototype.constructor
The initial value of XML.NamespaceSupport.prototype.constructor is the built-in NamespaceSupport constructor.
4.9.5.2 XML.NamespaceSupport.prototype.reset()
Resets this NamespaceSupport object for reuse. Returns the undefined value.
4.9.5.3 XML.NamespaceSupport.prototype.pushContext()
Starts the new namespace context. Returns the undefined value.
4.9.5.4 XML.NamespaceSupport.prototype.popContext()
Returns to the previous namespace context. Returns the undefined value.
4.9.5.5 XML.NamespaceSupport.prototype.declarePrefix(prefix, uri)
Declares a namespace prefix. Let ToString( ). Let be a string value computed by ToString( ). The function associates a prefix with an URI in the current namespace context. Returns the undefined value.
be a string value computed byTo declare a default namespace,
must be an empty string.4.9.5.6 XML.NamespaceSupport.prototype.processName(qName, parts, isAttribute)
Processes a raw XML 1.0 name. Let ToString( ). The argument must be normally an Array object. Let be a boolean value computed by ToBoolean( ). The function processes a raw XML 1.0 name in the current context by removing the prefix and looking it up among the prefixes currently declared. The array supplied by the caller will be filled as follows.
be a string value computed byThe namespace URI, or null if none is in use is assigned as property 0 to the object.
The local name (without prefix) is assigned as property 1 to the object.
The original raw name is assigned as property 2 to the object.
If true, the name is processed as an attribute name; otherwise it is processed as an element name. Attribute names are processed diffferently than element names: an unprefixed element name will received the default namespace (if any), while an unprefixed attribute name will not.
isThe function returns the null if there is an undeclared prefix.
or4.9.5.7 XML.NamespaceSupport.prototype.getURI(prefix)
Looks up a prefix and gets the currently mapped namespace URI. Let ToString( ). The function looks up the prefix in the current context. Returns the string value equal to the associated namespace URI, or null if the prefix is undeclared in this context.
be a string value computed byFor the default namespace
must be the empty string.4.9.5.8 XML.NamespaceSupport.prototype.getPrefix(uri)
Returns one of the prefixes mapped to a namespace URI. Let ToString( ). The function looks up the prefix currently mapped to the URI . Returns the string value equal to the prefix found or null if none is mapped or if the URI is assigned to the default namespace.
be a string value computed byThe function will never return the empty (default) prefix.
4.9.5.9 XML.NamespaceSupport.prototype.getPrefixes(uri)
Returns an eumeration of all prefixes currently declared for URI. Let ToString( ). The function creates and returns the Enumeration instance (the object with [[Class]] equal to "XML.Enumeration"). The returned enumeration contains all prefixes mapped to the namespace URI .
be a string value computed byThe empty (default) prefix is never included in the returned enumeration.
4.9.6 Properties of the NamespaceSupport Instances
The value of the internal [[Prototype]] property of the NamespaceSupport instance is the NamespaceSupport prototype object.
The value of the internal [[Class]] property of the NamespaceSupport instance is "XML.NamespaceSupport".
NamespaceSupport instances inherit properties from their [[Prototype]] object, and also have the following properties.
4.9.6.1 prefixes
This property is assigned the Enumeration object (the object with [[Class]] equal to "XML.Enumeration") that contains all prefixes currently declared. If there is a default prefix, it is not included in this enumeration.
This property has the attributes { DontDelete, DontEnum, ReadOnly }.
4.9.6.2 declaredPrefixes
This property is assigned the Enumeration object (the object with [[Class]] equal to "XML.Enumeration") that contains all prefixes declared in this context. If there is a default prefix, it is included in this enumeration.
This property has the attributes { DontDelete, DontEnum, ReadOnly }.
4.9.7 Properties of the Enumeration Objects
Enumeration objects represent collections of string values.
The value of the internal [[Prototype]] property of the Enumeration object is the Object prototype.
The value of the internal [[Class]] property of the Enumeration object is "XML.Enumeration".
Enumeration objects inherit properties from their [[Prototype]] object, and also have the following properties.
4.9.7.1 length
Number of elements in the enumeration.
This property has the attributes { DontDelete, DontEnum, ReadOnly }.
4.9.7.2 item(index)
Function that returns element of enumeration with the given index. Let ToInt32( ). The function returns a string value equal to the element of enumeration having the index . If the index is out of range, the runtime error is generated.
be a number value computed byThis property has the attributes { DontDelete, DontEnum, ReadOnly }.
4.10 Exception Objects
Exception objects are used to encapsulate general XML errors and warnings. They implement functionality similar to that of the SAXException class specified by SAX2.
Note that current release of UESI implements the Edition 2 of ECMA-262 specification, which does not support exception handling. Therefore, Exception objects may be of limited use in the current release. It is planned to upgrade UESI to support the Edition 3 of ECMA-262. When this will happen, Exception objects will participate in the ECMAScript exception handling.
4.10.1 The Exception Constructor Called as a Function
Not supported in the current release of UESI. Reserved for the future.
4.10.1.1 XML.Exception(...)
Not supported in the current release of UESI. Reserved for the future.
4.10.2 The Exception Constructor
When XML.Exception is called as part of a new expression, it is a constructor: it initializes the newly created Exception instance.
4.10.2.1 new XML.Exception(arg1 [, arg2])
Let ToString( ). The message property of the newly created Exception instance is set to . The exception property of the newly created Exception instance is set to null.
be a string value computed byThe second argument
is reserved for the future use. If it is present, it will be ignored in the current release of UESI.4.10.3 Properties of the Exception Constructor
The value of the internal [[Prototype]] property of the Exception constructor is the Function prototype object.
Besides the internal properties and the length property (whose value is 2), the Exception constructor has the following properties.
4.10.3.1 XML.Exception.prototype
The initial value of the XML.Exception.prototype is the Exception prototype object.
This property has the attributes { DontEnum, DontDelete, ReadOnly }.
4.10.4 Properties of the Exception Prototype Object
The Exception prototype object is itself a Exception object (its [[Class]] is "XML.Exception"). Its message property is null. and exception property is null.
The value of the internal [[Prototype]] property of the Exception prototype object is the Object prototype.
4.10.4.1 XML.Exception.prototype.constructor
The initial value of XML.Exception.prototype.constructor is the built-in Exception constructor.
4.10.5 Properties of the Exception Instances
The value of the internal [[Prototype]] property of the Exception instance is the Exception prototype object.
The value of the internal [[Class]] property of the Exception instance is "XML.Exception".
Exception instances inherit properties from their [[Prototype]] object, and also have the following properties.
4.10.5.1 message
The string value containing the detail message for this exception or null if the message is not available.
This property has the attributes { DontDelete, DontEnum, ReadOnly }.
4.10.5.2 exception
The embedded exception, if any. Not supported in the current release of UESI (always null). Reserved for the future.
This property has the attributes { DontDelete, DontEnum, ReadOnly }.
4.11 NotSupportedException Objects
NotSupportedException objects are used for unsupported operations. They implement functionality similar to that of the SAXNotSupportedException class specified by SAX2.
Note that current release of UESI implements the Edition 2 of ECMA-262 specification, which does not support exception handling. Therefore, NotSupportedException objects may be of limited use in the current release. It is planned to upgrade UESI to support the Edition 3 of ECMA-262. When this will happen, NotSupportedException objects will participate in the ECMAScript exception handling.
4.11.1 The NotSupportedException Constructor Called as a Function
Not supported in the current release of UESI. Reserved for the future.
4.11.1.1 XML.NotSupportedException(...)
Not supported in the current release of UESI. Reserved for the future.
4.11.2 The NotSupportedException Constructor
When XML.NotSupportedException is called as part of a new expression, it is a constructor: it initializes the newly created NotSupportedException instance.
4.11.2.1 new XML.NotSupportedException(message)
Let ToString( ). The message property of the newly created NotSupportedException instance is set to .
be a string value computed by4.11.3 Properties of the NotSupportedException Constructor
The value of the internal [[Prototype]] property of the NotSupportedException constructor is the Function prototype object.
Besides the internal properties and the length property (whose value is 1), the NotSupportedException constructor has the following properties.
4.11.3.1 XML.NotSupportedException.prototype
The initial value of the XML.NotSupportedException.prototype is the NotSupportedException prototype object.
This property has the attributes { DontEnum, DontDelete, ReadOnly }.
4.11.4 Properties of the NotSupportedException Prototype Object
The NotSupportedException prototype object is itself a NotSupportedException object (its [[Class]] is "XML.NotSupportedException"). Its message property is an empty string.
The value of the internal [[Prototype]] property of the NotSupportedException prototype object is the XML Exception prototype object (the initial value of XML.Exception.prototype).
4.11.4.1 XML.NotSupportedException.prototype.constructor
The initial value of XML.NotSupportedException.prototype.constructor is the built-in NotSupportedException constructor.
4.11.5 Properties of the NotSupportedException Instances
The value of the internal [[Prototype]] property of the NotSupportedException instance is the NotSupportedException prototype object.
The value of the internal [[Class]] property of the NotSupportedException instance is "XML.NotSupportedException".
NotSupportedException instances inherit properties from their [[Prototype]] object, and also all properties of XML Exception instances.
4.12 NotRecognizedException Objects
NotRecognizedException objects are used for unrecognized identifiers. They implement functionality similar to that of the SAXNotRecognizedException class specified by SAX2.
Note that current release of UESI implements the Edition 2 of ECMA-262 specification, which does not support exception handling. Therefore, NotRecognizedException objects may be of limited use in the current release. It is planned to upgrade UESI to support the Edition 3 of ECMA-262. When this will happen, NotRecognizedException objects will participate in the ECMAScript exception handling.
4.12.1 The NotRecognizedException Constructor Called as a Function
Not supported in the current release of UESI. Reserved for the future.
4.12.1.1 XML.NotRecognizedException(...)
Not supported in the current release of UESI. Reserved for the future.
4.12.2 The NotRecognizedException Constructor
When XML.NotRecognizedException is called as part of a new expression, it is a constructor: it initializes the newly created NotRecognizedException instance.
4.12.2.1 new XML.NotRecognizedException(message)
Let ToString( ). The message property of the newly created NotRecognizedException instance is set to .
be a string value computed by4.12.3 Properties of the NotRecognizedException Constructor
The value of the internal [[Prototype]] property of the NotRecognizedException constructor is the Function prototype object.
Besides the internal properties and the length property (whose value is 1), the NotRecognizedException constructor has the following properties.
4.12.3.1 XML.NotRecognizedException.prototype
The initial value of the XML.NotRecognizedException.prototype is the NotRecognizedException prototype object.
This property has the attributes { DontEnum, DontDelete, ReadOnly }.
4.12.4 Properties of the NotRecognizedException Prototype Object
The NotRecognizedException prototype object is itself a NotRecognizedException object (its [[Class]] is "XML.NotRecognizedException"). Its message property is an empty string.
The value of the internal [[Prototype]] property of the NotRecognizedException prototype object is the XML Exception prototype object (the initial value of XML.Exception.prototype).
4.12.4.1 XML.NotRecognizedException.prototype.constructor
The initial value of XML.NotRecognizedException.prototype.constructor is the built-in NotRecognizedException constructor.
4.12.5 Properties of the NotRecognizedException Instances
The value of the internal [[Prototype]] property of the NotRecognizedException instance is the NotRecognizedException prototype object.
The value of the internal [[Class]] property of the NotRecognizedException instance is "XML.NotRecognizedException".
NotRecognizedException instances inherit properties from their [[Prototype]] object, and also all properties of XML Exception instances.
4.13 ParseException Objects
ParseException objects are used to encapsulate XML parse errors and warnings. They implement functionality similar to that of the SAXParseException class specified by SAX2.
Note that current release of UESI implements the Edition 2 of ECMA-262 specification, which does not support exception handling. Therefore, ParseException objects may be of limited use in the current release. It is planned to upgrade UESI to support the Edition 3 of ECMA-262. When this will happen, ParseException objects will participate in the ECMAScript exception handling.
4.13.1 The ParseException Constructor Called as a Function
Not supported in the current release of UESI. Reserved for the future.
4.13.1.1 XML.ParseException(...)
Not supported in the current release of UESI. Reserved for the future.
4.13.2 The ParseException Constructor
When XML.ParseException is called as part of a new expression, it is a constructor: it initializes the newly created ParseException instance.
4.13.2.1 new XML.ParseException(message, locator [, exception])
Let ToString( ). The argument must be the Locator instance. The message property of the newly created ParseException instance is set to . The publicId property of the newly created ParseException instance is set to .publicId. The systemId property of the newly created ParseException instance is set to .systemId. The lineNumber property of the newly created ParseException instance is set to .lineNumber. The columnNumber property of the newly created ParseException instance is set to .columnNumber.
be a string value computed byThe argument
is reserved for the future use. If it is present, it will be ignored in the current release of UESI.4.13.2.2 new XML.ParseException(message, publicId, systemId, lineNumber, columnNumber [, exception])
Let ToString( ). Let be a string value computed by ToString( ). Let be a string value computed by ToString( ). Let be a number value computed by ToInt32( ). Let be a number value computed by ToInt32( ). The message property of the newly created ParseException instance is set to . The publicId property of the newly created ParseException instance is set to . The systemId property of the newly created ParseException instance is set to . The lineNumber property of the newly created ParseException instance is set to . The columnNumber property of the newly created ParseException instance is set to .
be a string value computed byThe argument
is reserved for the future use. If it is present, it will be ignored in the current release of UESI.4.13.3 Properties of the ParseException Constructor
The value of the internal [[Prototype]] property of the ParseException constructor is the Function prototype object.
Besides the internal properties and the length property (whose value is 6), the ParseException constructor has the following properties.
4.13.3.1 XML.ParseException.prototype
The initial value of the XML.ParseException.prototype is the ParseException prototype object.
This property has the attributes { DontEnum, DontDelete, ReadOnly }.
4.13.4 Properties of the ParseException Prototype Object
The ParseException prototype object is itself a ParseException object (its [[Class]] is "XML.ParseException"). Its message, publicId and systemId properties are set to null. Its lineNumber and columnNumber properties are set to -1.
The value of the internal [[Prototype]] property of the ParseException prototype object is the XML Exception prototype object (the initial value of XML.Exception.prototype).
4.13.4.1 XML.ParseException.prototype.constructor
The initial value of XML.ParseException.prototype.constructor is the built-in ParseException constructor.
4.13.5 Properties of the ParseException Instances
The value of the internal [[Prototype]] property of the ParseException instance is the ParseException prototype object.
The value of the internal [[Class]] property of the ParseException instance is "XML.ParseException".
ParseException instances inherit properties from their [[Prototype]] object, all properties of XML Exception instances, and also have the following properties.
4.13.5.1 publicId
The public identifier of the entity where the exception occured. String value of null if unavailable.
This property has the attributes { DontDelete, DontEnum, ReadOnly }.
4.13.5.2 systemId
The system identifier of the entity where the exception occured. String value of null if unavailable.
This property has the attributes { DontDelete, DontEnum, ReadOnly }.
4.13.5.3 lineNumber
The line number of the end of the text where the exception occured. Number value of -1 if unavailable.
This property has the attributes { DontDelete, DontEnum, ReadOnly }.
4.13.5.4 columnNumber
The column number of the end of the text where the exception occured. Number value of -1 if unavailable.
This property has the attributes { DontDelete, DontEnum, ReadOnly }.
4.14 Stream Objects
Stream objects represent interfaces for reading content of XML documents. Every stream object generates a sequence of events. Each event represents a piece of XML content.
Stream objects are normally associated with ContentHandler objects. The latter implement the ContentHandler interface and are used to process events generated by Streams.
There is no direct counterpart for Stream objects in SAX2. In UESI, Stream represents more primitive object type than the interface XMLReader recommended by SAX2, since it does not provide DTD handling, entity resolving and handling for parse errors.
UESI provides few other categories of built-in objects that implement the same interfaces as Stream objects and have the Stream prototype in their prototype chain. Objects of these categories are logically treated as streams and can be used in every context where Stream objects are required.
4.14.1 The Stream Constructor Called as a Function
Not supported in the current release of UESI. Reserved for the future.
4.14.1.1 XML.Stream(...)
Not supported in the current release of UESI. Reserved for the future.
4.14.2 The Stream Constructor
When XML.Stream is called as part of a new expression, it is a constructor: it initializes the newly created Stream instance.
4.14.2.1 new XML.Stream()
The namespace property of the newly created Stream instance is set to true. The contentHandler property of the newly created instance is set to null.
4.14.3 Properties of the Stream Constructor
The value of the internal [[Prototype]] property of the Stream constructor is the Function prototype object.
Besides the internal properties and the length property (whose value is 0), the Stream constructor has the following properties.
4.14.3.1 XML.Stream.prototype
The initial value of the XML.Stream.prototype is the Stream prototype object.
This property has the attributes { DontEnum, DontDelete, ReadOnly }.
4.14.4 Properties of the Stream Prototype Object
The Stream prototype object is itself a Stream object (its [[Class]] is "XML.Stream"). The initial value of namespace property of the Stream prototype is set to true. The initial value of contentHandler property is set to null.
The value of the internal [[Prototype]] property of the Stream prototype object is the Object prototype.
4.14.4.1 XML.Stream.prototype.constructor
The initial value of XML.Stream.prototype.constructor is the built-in Stream constructor.
4.14.4.2 XML.Stream.prototype.start()
This function is used to start a stream. When the stream is started, it generates a sequence of events. It is assumed that before starting a stream, the appropriate ContentHandler object is assigned to the contentHandler property of the Stream instance. Functions of this ContentHandler object are used to process individual events generated by Stream. Processing is assumed to be synchronous: the start must not return until the entire stream is generated and passed to ContentHandler functions.
The XML.Stream.prototype.start function is intentionally generic. It can be applied to every object that implements the Stream interface and has the Stream prototype in its prototype chain. The exact functionality may vary for each object category. For each object category that is derived from Stream (i.e., objects of this category contain the Stream prototype in their prototype chain) the exact behavior of the XML.Stream.prototype.start function must be specified.
When applied to Stream instances, XML.Stream.prototype.start function does nothing. It is assumed that the ECMAScript program will override the start function for each Stream instance in order to create custom XML event streams.
4.14.5 Properties of the Stream Instances
The value of the internal [[Prototype]] property of the Stream instance is the Stream prototype object.
The value of the internal [[Class]] property of the Stream instance is "XML.Stream".
Stream instances inherit properties from their [[Prototype]] object, and also have the following properties.
4.14.5.1 namespaces
This boolean property is used to specify whether the Stream instance supports namespace processing.
If the namespace processing is supported, (i.e., namespaces is true) the ContentHandler receives notifications about all encountered namespace declarations in the form of StartPrefixMapping and EndPrefixMapping function calls. Attribute lists passed to the StartElement function need not (but are still allowed) to contain delcarations for attributes having the "xmlns" prefix.
Otherwise (namespaces is false), prefix mapping events are not generated and attribute lists passed to StartElement must contain declarations for all encountered attributes having the "xmlns" prefix.
4.14.5.2 contentHandler
This property references the ContentHandler object associated with the stream or null if such object is unspecified. Any object that implements the ContentHandler interface and contains ContentHandler prototype in its prototype chain may be assigned to the contentHandler property.
4.15 Processor Objects
Processor objects combine functionality provided by Stream and ContentHandler objects.
On one hand, each Processor object implements the interface of Stream and contains the Stream prototype in its prototype chain. Each Processor instance, therefore, is treated as XML stream and can be used in every context where Stream is required.
On another hand, each Processor object implements all event processing functions of ContentHandler. (Note, however, that ContentHandler prototype is not contained in the Processor prototype chain and therefore, formally speaking, Processor cannot be treated as the ContentHandler).
The Processor instance is like a Stream, except that it obtains its events from another Stream rather than a primary source. Processors can modify a stream of events as they pass on to their associated content handlers.
Processor objects can be used to implement pipelines of XML processing components.
The Processor objects have no direct counterparts in SAX2. In UESI, the Stream and Processor objects have relation similar to that of interfaces XMLReader and XMLFilter specified by SAX2.
4.15.1 The Processor Constructor Called as a Function
Not supported in the current release of UESI. Reserved for the future.
4.15.1.1 XML.Processor(...)
Not supported in the current release of UESI. Reserved for the future.
4.15.2 The Processor Constructor
When XML.Processor is called as part of a new expression, it is a constructor: it initializes the newly created Processor instance.
4.15.2.1 new XML.Processor()
The inputStream property of the newly created Processor instance is set to null.
4.15.3 Properties of the Processor Constructor
The value of the internal [[Prototype]] property of the Processor constructor is the Function prototype object.
Besides the internal properties and the length property (whose value is 0), the Processor constructor has the following properties.
4.15.3.1 XML.Processor.prototype
The initial value of the XML.Processor.prototype is the Processor prototype object.
This property has the attributes { DontEnum, DontDelete, ReadOnly }.
4.15.4 Properties of the Processor Prototype Object
The Processor prototype object is itself a Processor object (its [[Class]] is "XML.Processor"). Its inputStream property is initially set to null.
The value of the internal [[Prototype]] property of the Processor prototype object is the XML Stream prototype object (the initial value of XML.Stream.prototype).
4.15.4.1 XML.Processor.prototype.constructor
The initial value of XML.Processor.prototype.constructor is the built-in Processor constructor.
4.15.4.2 XML.Processor.prototype.setDocumentLocator(locator)
Receives the object for locating the origin of XML document events. The argument undefined value.
must be the Locator object instance, otherwise the runtime error is generated. The function returnsThis function is invoked by the Stream object referenced via the inputStream property of this Processor instance.
The setDocumentLocator function of the Processor prototype simply invokes, with the same arguments, the setDocumentLocator of the ContentHandler object referenced by the contentHandler property of this Processor instance.
The ECMAScript program may override this function for each particular Processor instance in order to implement custom event processing.
4.15.4.3 XML.Processor.prototype.startDocument()
Receives notification of the beginning of a document. Returns undefined value.
This function is invoked by the Stream object referenced via the inputStream property of this Processor instance.
The startDocument function of the Processor prototype simply invokes the startDocument of the ContentHandler object referenced by the contentHandler property of this Processor instance.
The ECMAScript program may override this function for each particular Processor instance in order to implement custom event processing.
4.15.4.4 XML.Processor.prototype.endDocument()
Receives notification of the end of a document. Returns undefined value.
This function is invoked by the Stream object referenced via the inputStream property of this Processor instance.
The endDocument function of the Processor prototype simply invokes the endDocument of the ContentHandler object referenced by the contentHandler property of this Processor instance.
The ECMAScript program may override this function for each particular Processor instance in order to implement custom event processing.
4.15.4.5 XML.Processor.prototype.startPrefixMapping(prefix, uri)
Begins the scope of a prefix to URI namespace mapping. The argument undefined value.
is a string value equal to the namespace prefix. The argument is a string value equal to the corresponding namespace URI. The function returnsThis function is invoked by the Stream object referenced via the inputStream property of this Processor instance (but only only if the XML Stream referenced by imputStream implements namespace processing).
The startPrefixMapping function of the Processor prototype simply invokes, with the same arguments, the startPrefixMapping of the ContentHandler object referenced by the contentHandler property of this Processor instance.
The ECMAScript program may override this function for each particular Processor instance in order to implement custom event processing.
4.15.4.6 XML.Processor.prototype.endPrefixMapping(prefix)
Ends the scope of a prefix to URI namespace mapping. The argument undefined value.
is a string value equal to the namespace prefix. The function returnsThis function is invoked by the Stream object referenced via the inputStream property of this Processor instance (but only only if the XML Stream referenced by imputStream implements namespace processing).
The endPrefixMapping function of the Processor prototype simply invokes, with the same arguments, the endPrefixMapping of the ContentHandler object referenced by the contentHandler property of this Processor instance.
The ECMAScript program may override this function for each particular Processor instance in order to implement custom event processing.
4.15.4.7 XML.Processor.prototype.startElement(namespaceUri, localName, qName, atts)
Receives notification of the beginning of an element. The argument inputStream instance. The argument is a string value equal to the local name. It is the empty string if namespace processing is not performed by the related inputStream instance. The argument is a string value equal to the qualified name. It is always non-empty. The argument is an Attributes instance used to specify attributes attached to the element. The function returns undefined value.
is a string value equal to the namespace URI. It is the empty string if the element has no namespace or if namespace processing is not performed by the relatedThis function is invoked by the Stream object referenced via the inputStream property of this Processor instance.
The startElement function of the Processor prototype simply invokes, with the same arguments, the startElement of the ContentHandler object referenced by the contentHandler property of this Processor instance.
The ECMAScript program may override this function for each particular Processor instance in order to implement custom event processing.
4.15.4.8 XML.Processor.prototype.endElement(namespaceUri, localName, qName)
Receives notification of the end of an element. The argument inputStream instance. The argument is a string value equal to the local name. It is the empty string if namespace processing is not performed by the related inputStream instance. The argument is a string value equal to the qualified name. It is always non-empty. The function returns undefined value.
is a string value equal to the namespace URI. It is the empty string if the element has no namespace or if namespace processing is not performed by the relatedThis function is invoked by the Stream object referenced via the inputStream property of this Processor instance.
The endElement function of the Processor prototype simply invokes, with the same arguments, the endElement of the ContentHandler object referenced by the contentHandler property of this Processor instance.
The ECMAScript program may override this function for each particular Processor instance in order to implement custom event processing.
4.15.4.9 XML.Processor.prototype.characters(ch)
Receives notification of character data. The argument undefined value.
is a string value containing characters from the XML document. The function returnsThis function is invoked by the Stream object referenced via the inputStream property of this Processor instance.
The characters function of the Processor prototype simply invokes, with the same arguments, the characters of the ContentHandler object referenced by the contentHandler property of this Processor instance.
The ECMAScript program may override this function for each particular Processor instance in order to implement custom event processing.
4.15.4.10 XML.Processor.prototype.ignorableWhitespace(ch)
Receives notification of ignorable whitespace in element content. The argument undefined value.
is a string value containing characters from the XML document. The function returnsThis function is invoked by the Stream object referenced via the inputStream property of this Processor instance.
The ignorableWhitespace function of the Processor prototype simply invokes, with the same arguments, the ignorableWhitespace of the ContentHandler object referenced by the contentHandler property of this Processor instance.
The ECMAScript program may override this function for each particular Processor instance in order to implement custom event processing.
4.15.4.11 XML.Processor.prototype.processingInstruction(target, data)
Receives notification of a processing instruction. The argument undefined value.
is a string value equal to the processing instruction target. The argument is a string value equal to the processing instruction data. The function returnsThis function is invoked by the Stream object referenced via the inputStream property of this Processor instance.
The processingInstruction function of the Processor prototype simply invokes, with the same arguments, the processingInstruction of the ContentHandler object referenced by the contentHandler property of this Processor instance.
The ECMAScript program may override this function for each particular Processor instance in order to implement custom event processing.
4.15.4.12 XML.Processor.prototype.skippedEntity(name)
Receives notification of a skipped entity. The argument undefined value.
is a string value equal to the name of the skipped entity. The function returnsThis function is invoked by the Stream object referenced via the inputStream property of this Processor instance.
The skippedEntity function of the Processor prototype simply invokes, with the same arguments, the skippedEntity of the ContentHandler object referenced by the contentHandler property of this Processor instance.
The ECMAScript program may override this function for each particular Processor instance in order to implement custom event processing.
4.15.5 Properties of the Processor Instances
The value of the internal [[Prototype]] property of the Processor instance is the Processor prototype object.
The value of the internal [[Class]] property of the Processor instance is "XML.Processor".
Processor instances inherit properties from their [[Prototype]] object, have all properties of XML Stream instances and also have the following properties.
4.15.5.1 inputStream
The inputStream property references the Stream object that is used as the source of XML events for this Processor. If the input stream is unspecified, the inputStream property is null. Any object that implements the Source interface and contains the Source prototype in its prototype chain may be assigned as the inputStream property value.
4.15.5.2 XML.Stream.prototype.start Applied to Processor Instances
When the Stream prototype function XML.Stream.prototype.start is applied to the Processor instance, it invokes the start function of the Stream object referenced by the inputStream property of this Processor instance.
4.16 Reader Objects
Reader objects implement interface for reading XML documents using callbacks. They implement functionality similar to that of the XMLReader interface specified by SAX2.
In UESI, every Reader instance implements Stream interface and contains the Stream prototype in its prototype chain. Therefore, the Reader instance may be used in every context where Stream object is required.
4.16.1 The Reader Constructor Called as a Function
Not supported in the current release of UESI. Reserved for the future.
4.16.1.1 XML.Reader(...)
Not supported in the current release of UESI. Reserved for the future.
4.16.2 The Reader Constructor
When XML.Reader is called as part of a new expression, it is a constructor: it initializes the newly created Reader instance.
4.16.2.1 new XML.Reader()
The namespaces, namespacePrefixes, validation, externalGeneralEntities and externalParameterEntities properties of the newly created Reader instance are set to their default values as implemented by the underlying XML parser. The entityResolver, dtdHandler, contentHandler, errorHandler and inputSource properties of the newly created instance are set to null.
4.16.3 Properties of the Reader Constructor
The value of the internal [[Prototype]] property of the Reader constructor is the Function prototype object.
Besides the internal properties and the length property (whose value is 0), the Reader constructor has the following properties.
4.16.3.1 XML.Reader.prototype
The initial value of the XML.Reader.prototype is the Reader prototype object.
This property has the attributes { DontEnum, DontDelete, ReadOnly }.
4.16.4 Properties of the Reader Prototype Object
The Reader prototype object is itself a Reader object (its [[Class]] is "XML.Reader"). The namespaces, namespacePrefixes, validation, externalGeneralEntities and externalParameterEntities properties of the Reader prototype are initially set to their default values as implemented by the underlying XML parser. The entityResolver, dtdHandler, contentHandler, errorHandler and inputSource properties of the Reader prototype are initally set to null.
The value of the internal [[Prototype]] property of the Reader prototype object is the Object prototype.
4.16.4.1 XML.Reader.prototype.constructor
The initial value of XML.Reader.prototype.constructor is the built-in Reader constructor.
4.16.4.2 XML.Reader.prototype.parse(source)
Parses an XML document. Returns the undefined value.
If [[Class]] property is "XML.InputSource"), this object is assigned to the inputSource property of this Reader object before parsing is started.
is the InputSource object (its internalOtherwise let ToString( ). Let be an InputSource instance created by new CInputSource( ). The value is assigned to to the inputSource property of this Reader object before parsing is started. (In the other words, is interpreted as the system identifier of the source XML document.)
be a string value computed by4.16.5 Properties of the Reader Instances
The value of the internal [[Prototype]] property of the Reader instance is the Reader prototype object.
The value of the internal [[Class]] property of the Reader instance is "XML.Reader".
Reader instances inherit properties from their [[Prototype]] object, have all properties of XML Stream instances and also have the following properties.
4.16.5.1 namespaces
This is a boolean property which is true if the XML parser performs namespace processing.
This property is similar to the "http://xml.org/sax/features/namespaces" feature defined by SAX2.
4.16.5.2 namespacePrefixes
This is a boolean property which is true if the XML parser reports the original prefixed names and attributes used for namespace declarations.
This property is similar to the "http://xml.org/sax/features/namespace-prefixes" feature defined by SAX2.
4.16.5.3 validation
This is a boolean property which is true if the XML parser reports all validation errors.
This property is similar to the "http://xml.org/sax/features/validation" feature defined by SAX2.
If the parser does not support the corresponding feature, an attempt to access this property may cause the runtime error.
4.16.5.4 externalGeneralEntities
This is a boolean property which is true if the XML parser includes all external general (text) entities.
This property is similar to the "http://xml.org/sax/features/external-general-entities" feature defined by SAX2.
If the parser does not support the corresponding feature, an attempt to access this property may cause the runtime error.
4.16.5.5 externalParameterEntities
This is a boolean property which is true if the XML parser includes all external parameter entities, including the external DTD subset.
This property is similar to the "http://xml.org/sax/features/external-parameter-entities" feature defined by SAX2.
If the parser does not support the corresponding feature, an attempt to access this property may cause the runtime error.
4.16.5.6 entityResolver
This property references the EntityResolver object used for entity resolution. The property value is null if the EntityResolver is unspecified.
4.16.5.7 dtdHandler
This property references the DTDHandler object used to report DTD events. The property value is null if the DTDHandler is unspecified.
4.16.5.8 errorHandler
This property references the ErrorHandler object used to report error events. The property value is null if the ErrorHandler is unspecified.
4.16.5.9 inputSource
This property references the InputSource object which specifies the source XML document. The property value is null if the InputSource is unspecified.
4.16.5.10 XML.Stream.prototype.start Applied to Reader Instances
When the Stream prototype function XML.Stream.prototype.start is applied to the Reader instance, it starts the XML parser using the input source specified by inputSource property of this Reader instance.
4.17 Filter Objects
Filter objects implement interface for XML filters. They implement functionality similar to that of the XMLFilterImpl class specified by SAX2.
Filter objects combine functionality provided by Reader, DTDHandler, ContentHandler, EntityResolver and ErrorHandler objects.
On one hand, the Filter is like Reader, except that it obtains its events from another Reader rather than a primary source. Filters can modify a stream of events as they pass on to the final destination. In UESI, every Filter instance implements Stream and Reader interfaces and contains both Stream and Reader prototypes in its prototype chain. Therefore, the Filter instance may be used in every context where Stream or Reader object is required.
On another hand, each Filter object implements all event processing functions of DTDHandler, ContentHandler, EntityResolver and ErrorHandler. (Note, however, that DTDHandler, ContentHandler, EntityResolver and ErrorHandler prototypes are not contained in the Filter prototype chain and therefore, formally speaking, Filter cannot be treated as DTDHandler, ContentHandler, EntityResolver or ErrorHandler).
4.17.1 The Filter Constructor Called as a Function
Not supported in the current release of UESI. Reserved for the future.
4.17.1.1 XML.Filter(...)
Not supported in the current release of UESI. Reserved for the future.
4.17.2 The Filter Constructor
When XML.Filter is called as part of a new expression, it is a constructor: it initializes the newly created Filter instance.
4.17.2.1 new XML.Filter([parent])
The parent property of the newly created Filter instance is set to null.
4.17.3 Properties of the Filter Constructor
The value of the internal [[Prototype]] property of the Filter constructor is the Function prototype object.
Besides the internal properties and the length property (whose value is 1), the Filter constructor has the following properties.
4.17.3.1 XML.Filter.prototype
The initial value of the XML.Filter.prototype is the Filter prototype object.
This property has the attributes { DontEnum, DontDelete, ReadOnly }.
4.17.4 Properties of the Filter Prototype Object
The Filter prototype object is itself a Filter object (its [[Class]] is "XML.Filter"). The parent property of the Filter prototype is initially set to null.
The value of the internal [[Prototype]] property of the Filter prototype object is the XML Parser prototype object (the initial value of XML.Parser.prototype).
4.17.4.1 XML.Filter.prototype.constructor
The initial value of XML.Filter.prototype.constructor is the built-in Filter constructor.
4.17.4.2 XML.Filter.prototype.resolveEntity(publicId, systemId)
Allows the application to resolve external entities. The argument null to request that the XML Reader open a regular URI connection to the system identifier.
is a string value equal to the public identifier of the external entity being referenced. The argument is a string value equal to the system identifier of the external entity being referenced. The function returns an InputSource object instance describing the new input source, orThis function is invoked by the Reader object referenced via the parent property of this Filter instance.
The resolveEntity function of the Filter prototype simply invokes, with the same arguments, the resolveEntity of the EntityResolver object referenced by the entityResolver property of this Filter instance.
The ECMAScript program may override this function for each particular Filter instance in order to implement custom entity resolution.
4.17.4.3 XML.Filter.prototype.notationDecl(name, publicId, systemId)
Receives notification of a notation declaration event. The argument undefined value.
is a string value equal to the notation name. The argument is a string value equal to the notation's public identifier. The argument is a string value equal to the notation's system identifier. The function returnsThis function is invoked by the Reader object referenced via the parent property of this Filter instance.
The notationDecl function of the Filter prototype simply invokes, with the same arguments, the notationDecl of the DTDHandler object referenced by the dtdHandler property of this Filter instance.
The ECMAScript program may override this function for each particular Filter instance in order to implement custom DTD event processing.
4.17.4.4 XML.Filter.prototype.unparsedEntityDecl(name, publicId, systemId, notationName)
Receives notification of an unparsed entity declaration event. The argument undefined value.
is a string value equal to the entity's name. The argument is a string value equal to the entity's public identifier. The argument is a string value equal to the entity's system identifier. The argument is a string value equal to the name of the associated notation. The function returnsThis function is invoked by the Reader object referenced via the parent property of this Filter instance.
The unparsedEntityDecl function of the Filter prototype simply invokes, with the same arguments, the unparsedEntityDecl of the DTDHandler object referenced by the dtdHandler property of this Filter instance.
The ECMAScript program may override this function for each particular Filter instance in order to implement custom DTD event processing.
4.17.4.5 XML.Filter.prototype.setDocumentLocator(locator)
Receives the object for locating the origin of XML document events. The argument undefined value.
must be the Locator object instance, otherwise the runtime error is generated. The function returnsThis function is invoked by the Reader object referenced via the parent property of this Filter instance.
The setDocumentLocator function of the Filter prototype simply invokes, with the same arguments, the setDocumentLocator of the ContentHandler object referenced by the contentHandler property of this Filter instance.
The ECMAScript program may override this function for each particular Filter instance in order to implement custom event processing.
4.17.4.6 XML.Filter.prototype.startDocument()
Receives notification of the beginning of a document. Returns undefined value.
This function is invoked by the Reader object referenced via the parent property of this Filter instance.
The startDocument function of the Filter prototype simply invokes the startDocument of the ContentHandler object referenced by the contentHandler property of this Filter instance.
The ECMAScript program may override this function for each particular Filter instance in order to implement custom event processing.
4.17.4.7 XML.Filter.prototype.endDocument()
Receives notification of the end of a document. Returns undefined value.
This function is invoked by the Reader object referenced via the parent property of this Filter instance.
The endDocument function of the Filter prototype simply invokes the endDocument of the ContentHandler object referenced by the contentHandler property of this Filter instance.
The ECMAScript program may override this function for each particular Filter instance in order to implement custom event processing.
4.17.4.8 XML.Filter.prototype.startPrefixMapping(prefix, uri)
Begins the scope of a prefix to URI namespace mapping. The argument undefined value.
is a string value equal to the namespace prefix. The argument is a string value equal to the corresponding namespace URI. The function returnsThis function is invoked by the Reader object referenced via the parent property of this Filter instance (but only only if the XML Reader referenced by imputReader implements namespace processing).
The startPrefixMapping function of the Filter prototype simply invokes, with the same arguments, the startPrefixMapping of the ContentHandler object referenced by the contentHandler property of this Filter instance.
The ECMAScript program may override this function for each particular Filter instance in order to implement custom event processing.
4.17.4.9 XML.Filter.prototype.endPrefixMapping(prefix)
Ends the scope of a prefix to URI namespace mapping. The argument undefined value.
is a string value equal to the namespace prefix. The function returnsThis function is invoked by the Reader object referenced via the parent property of this Filter instance (but only only if the XML Reader referenced by imputReader implements namespace processing).
The endPrefixMapping function of the Filter prototype simply invokes, with the same arguments, the endPrefixMapping of the ContentHandler object referenced by the contentHandler property of this Filter instance.
The ECMAScript program may override this function for each particular Filter instance in order to implement custom event processing.
4.17.4.10 XML.Filter.prototype.startElement(namespaceUri, localName, qName, atts)
Receives notification of the beginning of an element. The argument parent instance. The argument is a string value equal to the local name. It is the empty string if namespace processing is not performed by the related parent instance. The argument is a string value equal to the qualified name. It is always non-empty. The argument is an Attributes instance used to specify attributes attached to the element. The function returns undefined value.
is a string value equal to the namespace URI. It is the empty string if the element has no namespace or if namespace processing is not performed by the relatedThis function is invoked by the Reader object referenced via the parent property of this Filter instance.
The startElement function of the Filter prototype simply invokes, with the same arguments, the startElement of the ContentHandler object referenced by the contentHandler property of this Filter instance.
The ECMAScript program may override this function for each particular Filter instance in order to implement custom event processing.
4.17.4.11 XML.Filter.prototype.endElement(namespaceUri, localName, qName)
Receives notification of the end of an element. The argument parent instance. The argument is a string value equal to the local name. It is the empty string if namespace processing is not performed by the related parent instance. The argument is a string value equal to the qualified name. It is always non-empty. The function returns undefined value.
is a string value equal to the namespace URI. It is the empty string if the element has no namespace or if namespace processing is not performed by the relatedThis function is invoked by the Reader object referenced via the parent property of this Filter instance.
The endElement function of the Filter prototype simply invokes, with the same arguments, the endElement of the ContentHandler object referenced by the contentHandler property of this Filter instance.
The ECMAScript program may override this function for each particular Filter instance in order to implement custom event processing.
4.17.4.12 XML.Filter.prototype.characters(ch)
Receives notification of character data. The argument undefined value.
is a string value containing characters from the XML document. The function returnsThis function is invoked by the Reader object referenced via the parent property of this Filter instance.
The characters function of the Filter prototype simply invokes, with the same arguments, the characters of the ContentHandler object referenced by the contentHandler property of this Filter instance.
The ECMAScript program may override this function for each particular Filter instance in order to implement custom event processing.
4.17.4.13 XML.Filter.prototype.ignorableWhitespace(ch)
Receives notification of ignorable whitespace in element content. The argument undefined value.
is a string value containing characters from the XML document. The function returnsThis function is invoked by the Reader object referenced via the parent property of this Filter instance.
The ignorableWhitespace function of the Filter prototype simply invokes, with the same arguments, the ignorableWhitespace of the ContentHandler object referenced by the contentHandler property of this Filter instance.
The ECMAScript program may override this function for each particular Filter instance in order to implement custom event processing.
4.17.4.14 XML.Filter.prototype.processingInstruction(target, data)
Receives notification of a processing instruction. The argument undefined value.
is a string value equal to the processing instruction target. The argument is a string value equal to the processing instruction data. The function returnsThis function is invoked by the Reader object referenced via the parent property of this Filter instance.
The processingInstruction function of the Filter prototype simply invokes, with the same arguments, the processingInstruction of the ContentHandler object referenced by the contentHandler property of this Filter instance.
The ECMAScript program may override this function for each particular Filter instance in order to implement custom event processing.
4.17.4.15 XML.Filter.prototype.skippedEntity(name)
Receives notification of a skipped entity. The argument undefined value.
is a string value equal to the name of the skipped entity. The function returnsThis function is invoked by the Reader object referenced via the parent property of this Filter instance.
The skippedEntity function of the Filter prototype simply invokes, with the same arguments, the skippedEntity of the ContentHandler object referenced by the contentHandler property of this Filter instance.
The ECMAScript program may override this function for each particular Filter instance in order to implement custom event processing.
4.17.4.16 XML.Filter.prototype.warning(exception)
Receives notification of a warning. The argument undefined value.
must be a ParseException instance, otherwise the runtime error is generated. The function returnsThis function is invoked by the Reader object referenced via the parent property of this Filter instance.
The warning function of the Filter prototype simply invokes, with the same arguments, the warning of the ErrorHandler object referenced by the errorHandler property of this Filter instance.
The ECMAScript program may override this function for each particular Filter instance in order to implement custom error handling.
4.17.4.17 XML.Filter.prototype.error(exception)
Receives notification of a recoverable error. The argument undefined value.
must be a ParseException instance, otherwise the runtime error is generated. The function returnsThis function is invoked by the Reader object referenced via the parent property of this Filter instance.
The error function of the Filter prototype simply invokes, with the same arguments, the error of the ErrorHandler object referenced by the errorHandler property of this Filter instance.
The ECMAScript program may override this function for each particular Filter instance in order to implement custom error handling.
4.17.4.18 XML.Filter.prototype.fatalError(exception)
Receives notification of a non-recoverable error. The argument undefined value.
must be a ParseException instance, otherwise the runtime error is generated. The function returnsThis function is invoked by the Reader object referenced via the parent property of this Filter instance.
The fatalError function of the Filter prototype simply invokes, with the same arguments, the fatalError of the ErrorHandler object referenced by the errorHandler property of this Filter instance.
The ECMAScript program may override this function for each particular Filter instance in order to implement custom error handling.
4.17.5 Properties of the Filter Instances
The value of the internal [[Prototype]] property of the Filter instance is the Filter prototype object.
The value of the internal [[Class]] property of the Filter instance is "XML.Filter".
Filter instances inherit properties from their [[Prototype]] object, have all properties of XML Reader instances and also have the following properties.
4.17.5.1 parent
The parent property references the Reader object that is used as the source of XML events for this Filter. If the input stream is unspecified, the parent property is null. Any object that implements the Reader interface and contains the Reader prototype in its prototype chain may be assigned as the parent property value.
4.17.5.2 XML.Stream.prototype.start Applied to Filter Instances
When the Stream prototype function XML.Stream.prototype.start is applied to the Filter instance, it invokes the start function of the Reader object referenced by the parent property of this Filter instance. The current value of the inputSource property of this Filter instance is assigned to the inputSource property of the parent Reader prior to the invocation of start.
4.17.5.3 XML.Reader.prototype.parse Applied to Filter Instances
When the Reader prototype function XML.Reader.prototype.parse is applied to the Filter instance, it invokes, with the same arguments, the parse function of the Reader object referenced by the parent property of this Filter instance.
4.18 Writer Objects
Writer objects implement interface for writing XML documents using XML, HTML and text output methods. Writer objects have no counterparts in core SAX2.
In UESI, every Writer instance implements ContentHandler interface and contains the ContentHandler prototype in its prototype chain. Therefore, the Writer instance may be used in every context where ContentHandler object is required.
The functionality of Writer objects is modelled after the output facility of XSL Transformations (XSLT), version 1.0. The Writer instances may have various value properties that specify parameters of the output method. They correspond to various attributes on the xsl:output element defined in XSLT 1.0. See XSLT 1.0 recommendation for the detailed description of the semantics of the output parameters.
4.18.1 The Writer Constructor Called as a Function
Not supported in the current release of UESI. Reserved for the future.
4.18.1.1 XML.Writer(...)
Not supported in the current release of UESI. Reserved for the future.
4.18.2 The Writer Constructor
When XML.Writer is called as part of a new expression, it is a constructor: it initializes the newly created Writer instance.
4.18.2.1 new XML.Writer()
The newly created Writer instance initially does not have any (non-internal) properties specific for Writer instances.
4.18.3 Properties of the Writer Constructor
The value of the internal [[Prototype]] property of the Writer constructor is the Function prototype object.
Besides the internal properties and the length property (whose value is 0), the Writer constructor has the following properties.
4.18.3.1 XML.Writer.prototype
The initial value of the XML.Writer.prototype is the Writer prototype object.
This property has the attributes { DontEnum, DontDelete, ReadOnly }.
4.18.4 Properties of the Writer Prototype Object
The Writer prototype object is itself a Writer object (its [[Class]] is "XML.Writer"). The Writer prototype initially does not have any (non-internal) properties specific for Writer instances.
The value of the internal [[Prototype]] property of the Writer prototype object is the XML ContentHandler prototype object (the initial value of XML.ContentHandler.prototype).
4.18.4.1 XML.Writer.prototype.constructor
The initial value of XML.Writer.prototype.constructor is the built-in Writer constructor.
4.18.5 Properties of the Writer Instances
The value of the internal [[Prototype]] property of the Writer instance is the Writer prototype object.
The value of the internal [[Class]] property of the Writer instance is "XML.Writer".
Writer instances inherit properties from their [[Prototype]] object, have all properties of XML ContentHandler instances and also have the following properties.
4.18.5.1 URI
This string property is used to specify URI for the output document,
4.18.5.2 namespaces
The boolean property which specifies whether the writer is expected to support namespace information in the source stream of events. The ECMAScript program must assign this property the same value which is set for the namespaces property of the related Stream object.
4.18.5.3 method
This is a string property that specifies the output method. Currently, three values are supported: "xml", "html" and "text".
This property corresponds to the method attribute on the xsl:output element.
4.18.5.4 version
This is a string property that specifies the version of the output format. The interpretation of this parameter depends on the output method.
This property corresponds to the version attribute on the xsl:output element.
4.18.5.5 encoding
This is a string property that specifies the encoding name to be used for the output document. UESI currently supports the following encoding names: ISO-8859-1, UTF-8, UTF-16. The encoding names are treated case-insensitive.
This property corresponds to the encoding attribute on the xsl:output element.
4.18.5.6 omitXMLDeclaration
This is a boolean property that specifies whether the XML declaration should be generated when the XML output method is in used.
This property corresponds to the omit-xml-declaration attribute on the xsl:output element.
4.18.5.7 standalone
This is a boolean property that specifies whether the standalone declaration should be generated when the XML output method is used.
This property corresponds to the standalone attribute on the xsl:output element.
4.18.5.8 doctypePublic
This is a string property that specifies the public ID of the DTD declaration that should be generated when XML or HTML output method is used.
This property corresponds to the doctype-public attribute on the xsl:output element.
4.18.5.9 doctypeSystem
This is a string property that specifies the system ID of the DTD declaration that should be generated when XML or HTML output method is used.
This property corresponds to the doctype-system attribute on the xsl:output element.
4.18.5.10 indent
This is a boolean property that specifies whether the indentation algorithm should be applied to the output data.
This property corresponds to the indent attribute on the xsl:output element.
4.18.5.11 mediaType
This is a string property that specifies the media type of the generated document.
This property corresponds to the media-type attribute on the xsl:output element.
A References
B Examples
Example 1.
This sample script creates a custom XML stream, connects it to XML writer and generates the simple XML document.
var baseURI = "file://localhost/d/uxsl/bin/uxp/samples/"; var uriA = "https://www.unicorn-enterprises.com/dummy/A"; var s = new XML.Stream(); s.start = myStart; var w = new XML.Writer(); w.URI = baseURI + "uxpxml01.out"; w.indent = true; s.contentHandler = w; s.start(); function myStart() { var a = new XML.Attributes(); var c = this.contentHandler; c.startDocument(); c.startPrefixMapping("a", uriA); a.addAttribute("", "x", "x", "CDATA", "unprefixed"); a.addAttribute(uriA, "y", "a:y", "CDATA", "prefixed"); c.startElement(uriA, "root", "a:root", a); c.characters("Hello, World!"); c.endElement(uriA, "root", "a:root"); c.endPrefixMapping("a"); c.endDocument(); }
Example 2.
This sample script creates an XML reader and a custom content handler that dumps all events received from its source stream. The reader is started twice: once with namespace support on and once with namespace support off.
var baseURI = "file://localhost/d/uxsl/bin/uxp/samples/"; testReader(true, baseURI+"uxpxml02a.out"); testReader(false, baseURI+"uxpxml02b.out"); function testReader(namespaces, fileName) { var r = new XML.Reader(); r.namespaces = namespaces; c = myContentHandler(fileName); r.contentHandler = c; r.parse(baseURI+"uxpxml02.xml"); } function myContentHandler(fileName) { var c = new XML.ContentHandler(); c.startDocument = myStartDocument; c.endDocument = myEndDocument; c.startPrefixMapping = myStartPrefixMapping; c.endPrefixMapping = myEndPrefixMapping; c.startElement = myStartElement; c.endElement = myEndElement; c.characters = myCharacters; c.file = new File() c.file.open(fileName, "w"); return c; } function myStartDocument() { this.file.write("startDocument\n"); } function myEndDocument() { this.file.write("endDocument\n"); } function myStartPrefixMapping(prefix, uri) { this.file.write("startPrefixMapping: prefix ["+prefix+"], URI ["+uri+"]\n"); } function myEndPrefixMapping(prefix) { this.file.write("endPrefixMapping: prefix ["+prefix+"]\n"); } function myStartElement(uri, localName, qName, atts) { this.file.write( "startElement: URI ["+uri+ "], localName ["+localName+ "], qName ["+qName+"]\n"); for (var i = 0; i < atts.length; i++) this.file.write(" atts["+i+ "]: URI ["+atts.getURI(i)+ "], localName ["+atts.getLocalName(i)+ "], qName ["+atts.getQName(i)+ "], type ["+atts.getType(i)+ "], value ["+atts.getValue(i)+"]\n"); } function myEndElement(uri, localName, qName) { this.file.write( "endElement: URI ["+uri+ "], localName ["+localName+ "], qName ["+qName+"]\n"); } function myCharacters(ch) { this.file.write("characters\n"); this.file.write("["); this.file.write(ch); this.file.write("]\n"); }
Example 3.
This sample script implements simple XML processor and simple XML filter.
var baseURI = "file://localhost/d/uxsl/bin/uxp/samples/"; var uriA = "https://www.unicorn-enterprises.com/dummy/A"; var uriB = "https://www.unicorn-enterprises.com/dummy/B"; var fileName = "uxpxml03.xml"; testProcessor(); testFilter(); function testProcessor() { var r = new XML.Reader(); var p = new XML.Processor(); var w = new XML.Writer(); r.inputSource = new XML.InputSource(baseURI+fileName); w.URI = baseURI + "uxpxml03a.out"; w.indent = true; p.inputStream = r; p.contentHandler = w; p.startPrefixMapping = myStartPrefixMapping; p.startElement = myStartElement; p.endElement = myEndElement; p.start(); } function testFilter() { var r = new XML.Reader(); var f = new XML.Filter(); var w = new XML.Writer(); w.URI = baseURI + "uxpxml03b.out"; w.indent = true; f.parent = r; f.contentHandler = w; f.startPrefixMapping = myStartPrefixMapping; f.startElement = myStartElement; f.endElement = myEndElement; f.parse(baseURI+fileName); } // // The following functions are generic: // they can be used with both Processor and Filter // function myStartPrefixMapping(prefix, uri) { if (uri == uriA) uri = uriB; this.contentHandler.startPrefixMapping(prefix, uri); } function myStartElement(uri, localName, qName, atts) { if (uri == uriA) uri = uriB; this.contentHandler.startElement(uri, localName, qName, atts); } function myEndElement(uri, localName, qName) { if (uri == uriA) uri = uriB; this.contentHandler.endElement(uri, localName, qName); }