This manual describes the SDOM Scheme library.
Copyright © 2011 Julian Graham.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled “GNU Free Documentation License”.
This reference manual documents SDOM, a Scheme module designed to be a complete implementation of the W3C's Document Object Model recommendation. It contains descriptions of the various aspects of the SDOM API and explains some of SDOM's inner workings and how it can be integrated with other Scheme modules.
This Info file contains a development edition of the reference manual, corresponding to the current development release of SDOM.
Appendices
Indices
SDOM aims to provide a complete Scheme implementation of the W3C's Document Object Model API recommendation. This document contains a description of the SDOM API, including explanatory notes for cases in which the SDOM API diverges significantly from the W3C recommendation. In general, an attempt has been made to replicate the recommendation's API method-for-method, but because of inherent differences between rules and conventions of the Scheme language and those of the languages for which the DOM recommendation seems to have been initially intended, we believe that some of the changes we made were requisite, if not actually more desirable than the original. Some of the major differences are discussed in the following sections.
The DOM recommendation assumes an object-oriented language similar in syntax to C++ or Java, and, as such, follows the naming conventions of those languages in the API it describes. Given the obvious differences between Scheme and, say, Java, the naming conventions favored by SDOM are bit different.
As a convenience to the reader, this manual includes, for each part of the SDOM API that maps to a particular bit of the DOM API, the name of the DOM API method or constant to which it corresponds.
There are two ways that SDOM can translate an existing XML document into a format in which it can be manipulated using SDOM's API: SDOM can add the necessary book-keeping information to a document that has already been parsed by SSAX; or it can read and parse the XML directly from a Scheme input port, using a customized version of the SSAX parser. This latter way is preferrable, since it preserves Document Type Declarations and information about entities.
Creates and returns a deep copy of the SXML tree sxml-doc, adding to it the required book-keeping information and node annotations.
Reads an XML document as a string from the input port port, parsing it into an SXML-compatible SDOM document. If namespace-decls is non-null, it should be a list of
PREFIX . NAMESPACE-URI...where PREFIX is a symbol to be used as XML namespace shorthand for the string NAMESPACE-URI, and will be used to resolve namespace prefixes encountered during parsing. If the available SSAX implementation exports the make-parser macro, a customized version the SSAX parser that preserves DTD and entity information will be used; otherwise the behavior will be identical to that of sdom:sxml->sdom.
The default behavior of the SXML ssax:xml->sxml parser with regard to XML namespaces is to resolve any prefixes it finds to their corresponding namespace URIs (provided these are specified by the document) and then replace all prefixes with either a symbolic form of the URI or a so-called "user namespace shortcut," depending on whether or not a list of shortcuts is specified at parse time. The original prefix is not made available as part of the namespace mapping in the resulting S-list.
Because this behavior is the default for SXML (it can be changed, but doing so is not straightforward) and because DOM does not explicitly discuss the use of such shortcuts, SDOM treats them as being interchangeable with coventional XML namespace prefixes. This behavior can be modified on a per-document basis with a call to sdom:set-dom-configuration-parameter!, setting the option "sdom:prefer-orig-prefix" to "true." If this option is set, SDOM functions that manipulate prefixes will look for the original prefix in the namespace declaration before looking at the user namespace shortcut.
For example, a typical namespace declaration in an SXML document looks like this:
(*NAMESPACES* (foo "http://www.foo.bar.com/"))
provided you've invoked ssax:xml->sxml something like this:
(ssax:xml->sxml (open-input-file "baz.xml") '((foo "http://www.foo.bar.com/"))))
where baz.xml contains:
<?xml version="1.0"?> <doc xmlns:baz="http://www.foo.bar.com/"> <baz:element/> </doc>
(If you don't provide the mapping of shortcuts to URIs, you won't, by default, get any namespace declarations, and all prefixes will be translated to symbolized URIs – baz:element will become http://www.foo.bar.com:element.) So, by default, if you evaluate sdom:lookup-prefix for "foo" on the appropriate node, you'll get "http://www.foo.bar.com/," even though foo may not actually have been a prefix. Likewise, a call to sdom:lookup-namespace-uri on "http://www.foo.bar.com/" will return foo.
Now let's say you've constructed your SXML parser so that it preserves prefixes and stores them in namespace declarations, which now look more like this:
(*NAMESPACES* (foo "http://www.foo.bar.com/" baz))
If you've set sdom:prefer-orig-prefix to true, then a call to sdom:lookup-prefix for both foo and baz will return "http://www.foo.bar.com/." A call to sdom:lookup-namespace-uri on "http://www.foo.bar.com/" will return baz. (If the original prefix is not available, sdom:lookup-namespace-uri will return foo instead.)
These are the constants that will be returned by a request to resolve the type of node. They can also be used in calls to sdom:create-node. Since the DOM recommendation appears to consider these mappings to be invariant (though not exhaustive) it is probably safe to use the numerical values in your code; the symbols are provided for your convenience.
(constant value = 7)
(constant value = 11)
(constant value = 2)
(constant value = 3)
(constant value = 4)
(constant value = 5)
(constant value = 6)
(constant value = 7)
(constant value = 9)
(constant value = 10)
(constant value = 11)
(constant value = 13)
(constant value = 15)
(constant value = 17)
The following functions are described in terms of their respective counterparts in the W3C DOM recommendation; you should refer to that document for more thorough discussion of the expected behavior.
On the other hand, this implementation does not adhere strictly to the organization of interfaces in the recommendation, so the following groupings are based on the purpose of the functions they contain, not on their position within the DOM hierarchy.
Returns a new document node with document type given by dtd and document element with QName rootname and namespace rootns. dtd may be null if no document type is required; if rootname is null, the resulting document will have no document element.
Creates and returns a new node of type node-type, whose owner-document is document. This function can be used to create all non-Document node types, according to the following table, which gives the significance and required types of the optional arguments according to node-type.
Node type Arg1 Arg2 sdom:node-type-element qname, as string [namespace, as string] sdom:node-type-attr qname, as string [namespace, as string] sdom:node-type-text content, as string sdom:node-type-cdata-section content, as string sdom:node-type-entity-reference entity name, as string sdom:node-type-entity sdom:node-type-processing-instruction target, as string data, as string sdom:node-type-comment value, as string sdom:node-type-document-type sdom:node-type-document-fragment sdom:node-type-notation For example, to create a new Element node, you could use either of the following expressions:
(sdom:create-node doc sdom:node-type-element "xhtml:p" "http://www.w3.org/1999/xhtml") (sdom:create-node doc sdom:node-type-element "p")
Inserts new-node as a new child node of parent. If ref-node is specified, this function will insert new-node such that it precedes ref-node as a child of parent in the document order; otherwise its behavior will be identical to that of sdom:append-child!.
Errors:
- Throws sdom:exception-code-wrong-document-err if new-node and parent do not belong to the same document
- Throws sdom:exception-code-hierarchy-request-err if nodes of new-node's type cannot be children of parent
- Throws sdom:exception-code-not-found-err if ref-node is not a child of parent
Events:
- sdom:event-dom-node-inserted will be dispatched if the insertion completes successfully
Inserts new-node as a new child node of parent. If ref-node is specified, this function will insert new-node such that it follows ref-node as a child of parent in the document order; otherwise its behavior will be identical to that of sdom:append-child!.
Errors:
- Throws sdom:exception-code-wrong-document-err if new-node and parent do not belong to the same document
- Throws sdom:exception-code-hierarchy-request-err if nodes of new-node's type cannot be children of parent
- Throws sdom:exception-code-not-found-err if ref-node is not a child of parent
Events:
- sdom:event-dom-node-inserted will be dispatched if the insertion completes successfully
Appends node as a new child of parent, returning node. If node has a non-null parent, it is first removed.
Errors:
- Throws sdom:exception-code-wrong-document-err if node and parent do not belong to the same document
- Throws sdom:exception-code-hierarchy-request-err if nodes of node's type cannot be children of parent
Throws sdom:exception-code-not-found-err if old-child is not a child of parent
Destructively adopts node into document. node is removed as a child of any parent it may have; the sdom:owner-document property for node is set to document.
Errors:
- Throws sdom:exception-code-not-supported-err if node cannot be adopted because it has type sdom:node-type-document or sdom:node-type-document-type
- Throws sdom:exception-code-no-modification-allowed-err if node is readonly
Returns #t if node1 and node2 are the same, according to the rules set forth in the W3C recommendation for node sameness, #f otherwise. In general in SDOM, two nodes are the same if they are equal under the eq? predicate or have internal representations that are the same under the eq? predicate.
Returns #t if node1 and node2 are equal, according to the rules set forth in the W3C recommendation for node equality, #f otherwise.
Returns #t if node has child nodes, #f otherwise.
DOM configuration parameters control the behavior of a DOM implementation for a particular document during document normalization. They can be retrieved and set for a particular document, but SDOM does not consider them to be DOM properties that are stored in the document tree itself; rather, they are considered to be “out-of-band” data and are maintained in a separate hash table that is keyed on document nodes. This means they will not be available across loads and saves of the document to which they are attached.
SDOM implements the following DOM configuration parameters, which can be modified for a particular document using the functions described below (see the DOM recommendation for information on their meaning during normalization):
Name | Supported values | Default
|
---|---|---|
“canonical-form” | #f | #f
|
“cdata-sections” | #t #f | #t
|
“check-character-normalization” | #f | #f
|
“comments” | #t #f | #t
|
“datatype-normalization” | #f | #f
|
“element-content-whitespace” | #t | #t
|
“entities” | #t #f | #t
|
“error-handler” | DEFAULT_HANDLER | HANDLER_PROCEDURE
|
“infoset” | #f #f | #t
|
“namespaces” | #t | #t
|
“namespace-declarations” | #f #t | #t
|
“normalize-characters” | #f | #f
|
“split-cdata-sections” | #t #f | #t
|
“strict-error-checking” | #t #f | #t
|
“validate” | #f | #f
|
“validate-if-schema” | #f | #f
|
“well-formed” | #t | #t
|
“sdom:prefer-orig-prefix” | #f #f | #t
|
“sdom:resolve-new-prefixes” | #t #f | #t
|
Return the value of the configuration parameter param for the document document.
Errors:
- Throws sdom:exception-code-type-mismatch-err if document is not a document node
Sets the value of the configuration parameter param for the document document to value.
Errors:
- Throws sdom:exception-code-type-mismatch-err if document is not a document node
- Throws sdom:exception-code-not-found-err if param is not a valid DOM configuration parameter
- Throws sdom:exception-code-not-support-err if value is not a valid value for the DOM configuration parameter param
Returns #f if a call to sdom:set-dom-config-parameter! for document document and arguments param and value would lead to an exception being thrown, #t otherwise.
Puts document into “normal” form, potentially destructively modifying the structure of document, depending on which DOM configuration parameters are in place for this document
Errors:
- Throws sdom:exception-code-type-mismatch-err if document is not of type sdom:node-type-document
- Selected DOM Errors will be raised, depending on the DOM configuration parameters attached to document
Returns the first element found in a document order traversal of the document document that has an attribute identified as an id attribute whose value is value.
Errors:
- Throws sdom:exception-code-type-mismatch-err if document is not of type sdom:node-type-document
Returns a list of element nodes in the document given by document for which the DOM property “sdom:tag-name” is equal to the string name. If namespace is given, the nodes must also belong to a namespace whose URI is equal to namespace.
Errors:
- Throws sdom:exception-code-type-mismatch-err if document is not of type sdom:node-type-document
Returns the attr node attached to element whose is name is name and whose namespace is namespace, if specified. If no such attr node exists, returns null.
Errors:
- Throws sdom:exception-code-type-mismatch-err if element is not of type sdom:node-type-element
Attaches the attr node attr as a new attribute of element element. Errors:
- Throws sdom:exception-code-type-mismatch-err if element is not of type sdom:node-type-element or attr is not of type sdom:node-type-attr Throws sdom:exception-code-wrong-document-err if element and attr do not belong to the same document Throws sdom:exception-code-inuse-attribute-err if the “sdom:owner-element” property for attr is not null
Removes the attr node attr from its owner element, element.
Errors:
- Throws sdom:exception-code-type-mismatch-err if element is not of type sdom:node-type-element or attr is not of type sdom:node-type-attr Throws sdom:exception-code-wrong-document-err if element and attr do not belong to the same document Throws sdom:exception-code-not-found-err if attr is not already attached to element
Returns the value of the attribute attached to element whose is name is name and whose namespace is namespace, if specified. If no such attribute exists, returns null.
Errors:
- Throws sdom:exception-code-type-mismatch-err if element is not of type sdom:node-type-element
Sets value as the value for the attribute attached to element element whose name is name and whose namespace is namespace, if specified.
Errors:
- Throws sdom:exception-code-type-mismatch-err if element is not of type sdom:node-type-element
Removes the attribute from element element whose name is name and whose namespace is namespace, if specified.
Errors:
- Throws sdom:exception-code-type-mismatch-err if element is not of type sdom:node-type-element
Attaches an annotation to the attribute attached to element element whose name is name and whose namespace is namespace, if specified, that indicates, based on the boolean value is-id, whether or not the attribute should be used as an id attribute.
Errors:
- Throws sdom:exception-code-type-mismatch-err if element is not of type sdom:node-type-element
Attaches an annotation to the attr node attr attached to element element that indicates, based on the boolean value is-id, whether or not the attribute should be used as an id attribute.
Errors:
- Throws sdom:exception-code-type-mismatch-err if element is not of type sdom:node-type-element or attr is not of type sdom:node-type-attr Throws sdom:exception-code-not-found-err if attr is not attached to element
Replaces the text content of node and all adjacent text nodes (according to document order) with the string text. If adjacent text nodes exist, they will be removed.
Errors:
- Throws sdom:exception-code-type-mismatch-err if node is not of type sdom:node-type-text
The SDOM user data API allows programmers to attach arbitrary data to particular nodes using a hashtable-like mechanism, and to register handler procedures that will be called when the node is affected by a particular node manipulation function.
Like DOM configuration parameters, SDOM does not consider user data to be a persistent part of an XML document; as such, user data and handlers are stored in a hashtable separate from the document itself and will not be available outside the current process space.
Retrieves the user data stored for node under the key string key, or null if none exists.
Stores the value value and a handler procedure handler under the key string key for node node. The handler should have the following signature:
(lambda (op key value src dst) ...)It will be called such that op is one of the user data event types defined in the enumeration here; key is the key string that was used in the original call that installed the handler; value is the value used in the call; src and dst are references to, respectively, the source and destination nodes involved in the event. For some events, dst may be null.
If no handler is desired, pass null in place of a procedure.
The following properties apply to all node types, since, under the DOM recommendation they all share the same root interface.
The name of node. This value depends on the type of node. If node has type sdom:node-type-element or sdom:node-type-attr this value will be a symbol; otherwise it will be a string or null. See http://www.w3c.org/TR/2004/REC-DOM-Level-3-Core-20040407/ for more information.
The value of node. This value depends on the type of node. If the DOM recommendation defines this value to be null, setting it will have no effect.
Errors on setting:
- Throws sdom:exception-code-no-modification-allowed-err if node is read-only and the DOM recommendation does not define it to be null
Property type: Node
The parent of node, if it is defined to have one and is a member of a document tree; #f otherwise
Property type: List of nodes
A list of the child nodes of node, if it has any; null if there are no children or if node is not defined to have any
Property type: Node
The first item in the list of children of node, if there are any children, #f otherwise. The value of this property is equivalent to the car of the value of sdom:child-nodes
Property type: Node
The last item in the list of children of node, if there are any children, #f otherwise. The value of this property is equivalent to the car of the last pair of the value of sdom:child-nodes
Property type: Node
The item that precedes node in the parent's list of child nodes, or #f if there is no parent node or node is the first child of the parent
Property type: Node
The item that follows node in the parent's list of child nodes, or #f if there is no parent node or node is the last child of the parent
Property type: List of nodes
A list of the attributes attached to node; null if node is not of type sdom:node-type-element or it has no attributes
Property type: Node
The document node representing the document to which node belongs, or #f if the document cannot be determined or if node is itself of type sdom:node-type-document
Property type: String
The namespace URI attached to node at the time of its creation or #f if none was specified.
The namespace prefix for node, or #f if it is unspecified. This property can only be set for element and attr nodes; setting it on any other type of node will have no effect.
Errors on setting:
- Throws sdom:exception-code-invalid-character-err if new value contains character that is illegal in the XML version specified by sdom:xml-version property of node's owner document
- Throws sdom:exception-code-no-modification-allowed-err if node is read-only
- Throws sdom:exception-code-namespace-err if new value is not a well-formed prefix, or new value is “xml” and sdom:namespace-uri property of node is not “http://www.w3.org/XML/1998/namespace”, or node has type sdom:node-type-attr and new value is “xmlns” and sdom:namespace-uri property of node is not “http://www.w3.org/2000/xmlns/”, or node has type sdom:node-type-attr and sdom:qualified-name property of node is “xmlns”
Property type: String
The local part of the qualified name for node, or #f if node is not an element or attr node.
Property type: String
The base URI of node, as determined by the algorithms described in the W3C Recommendation, or #f if a value could not be determined.
Errors on setting:
- Throws sdom:exception-code-no-modification-allowed-err if node is read-only
Property type: String
The content of node, represented as a string of UTF-16 characters
Errors on setting:
- Throws sdom:exception-code-no-modification-allowed-err if node is read-only
Property type: Number
The length of the value of the sdom:data property of node in UTF-16 characters
Property type: Boolean
#t if the content of node represents the whitespace between elements introduced by user formatting, as determined during normalization of the document to which node belongs1; #f otherwise
Property type: String
A concatenation of all nodes of type sdom:node-type-text or sdom:node-type-cdata-section, adjacent to node in a document order traversal that does not cross any nodes of type sdom:node-type-element, sdom:node-type-comment or sdom:node-type-processing-instruction
Property type: String
The public identifier for node or #f if none was specified
Property type: String
The system identifier for node or #f if none was specified
Property type: String
The public identifier for node or #f if none was specified
Property type: String
The system identifier for node or #f if none was specified
Property type: String
The name of the notation for node if node is an unparsed entity, #f otherwise
Property type: String
The name of the encoding for node at parse time, if node is an external parsed entity; #f otherwise
Property type: String
The name of the encoding for node, if node is an external parsed entity; #f otherwise
Property type: String
The version number for node, if node is an external parsed entity; #f otherwise
Property type: String
The content of node
Errors on setting:
- Throws sdom:exception-code-no-modification-allowed-err if node is read-only
Property type: String
The name of node. This will be a qualified name if sdom:local-name is not #f
Property type: Boolean
Whether or not node has been given a value. Under SDOM, this equates to whether or not node has any children that have type sdom:node-type-text
Property type: String
The value of node. Setting this value creates a new text node that is inserted as a child of node
Errors on setting:
- Throws sdom:exception-code-no-modification-allowed-err if node is read-only
Property type: Node
The element to which node is attached or #f if node is not in use
Property type: N/A
SDOM does not currently support XML Schema; this property will always have the value #f
Property type: Boolean
SDOM does not currently support XML Schema or DTD validation; this property will always have the value #f
Property type: String
The name of node. This will be a qualified name if sdom:local-name is not #f
Property type: N/A
SDOM does not currently support XML Schema; this property will always have the value #f
Property type: List of nodes
A list of nodes representing internal and external entities declared by node, not including duplicates or parameter entities
Property type: List of nodes
A list of nodes representing notations declared by node, not including duplicates
Property type: String
The internal subset represented by node or #f if there is none
Property type: Node
The node giving the Document Type Definition attached to node, or #f if none exists
Property type: N/A
SDOM does not currently support the DOMImplementation interface; this property will always have the value #f
Property type: Node
The first (and only) child of node that has type sdom:node-type-element, or #f if no such child exists
Property type: String
The encoding type used at the time of parsing, or #f if unknown; this property will always have the value #f under SDOM
Property type: String
The encoding type of the document to which node belongs, or #f if unknown; this property will always have the value #f under SDOM
Property type: Boolean
Whether the document to which node belongs is standalone, or #f if unknown; this property will always have the initial value #f under SDOM
Errors on setting:
- Throws sdom:exception-code-not-supported-err if document does not support feature “XML”
Property type: String
The version number of this document; this property will always have the initial value #f under SDOM
Errors on setting:
- Throws sdom:exception-code-not-supported-err if document does not support feature “XML” or if document does not support version specified by new value
Property type: Boolean
Whether or not to perform strict error checking during document normalization.
Property type: String
The location of node or #f if undefined
Property type: N/A
SDOM does not currently support the DOMConfiguration interface; use sdom:set-dom-config-parameter! and sdom:get-dom-config-parameter to interact with the DOM configuration
Copyright © 2000,2001,2002 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
The purpose of this License is to make a manual, textbook, or other functional and useful document free in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others.
This License is a kind of “copyleft”, which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software.
We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference.
This License applies to any manual or other work, in any medium, that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. Such a notice grants a world-wide, royalty-free license, unlimited in duration, to use that work under the conditions stated herein. The “Document”, below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as “you”. You accept the license if you copy, modify or distribute the work in a way requiring permission under copyright law.
A “Modified Version” of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language.
A “Secondary Section” is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document's overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (Thus, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them.
The “Invariant Sections” are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License. If a section does not fit the above definition of Secondary then it is not allowed to be designated as Invariant. The Document may contain zero Invariant Sections. If the Document does not identify any Invariant Sections then there are none.
The “Cover Texts” are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License. A Front-Cover Text may be at most 5 words, and a Back-Cover Text may be at most 25 words.
A “Transparent” copy of the Document means a machine-readable copy, represented in a format whose specification is available to the general public, that is suitable for revising the document straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy made in an otherwise Transparent file format whose markup, or absence of markup, has been arranged to thwart or discourage subsequent modification by readers is not Transparent. An image format is not Transparent if used for any substantial amount of text. A copy that is not “Transparent” is called “Opaque”.
Examples of suitable formats for Transparent copies include plain ascii without markup, Texinfo input format, LaTeX input format, SGML or XML using a publicly available DTD, and standard-conforming simple HTML, PostScript or PDF designed for human modification. Examples of transparent image formats include PNG, XCF and JPG. Opaque formats include proprietary formats that can be read and edited only by proprietary word processors, SGML or XML for which the DTD and/or processing tools are not generally available, and the machine-generated HTML, PostScript or PDF produced by some word processors for output purposes only.
The “Title Page” means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For works in formats which do not have any title page as such, “Title Page” means the text near the most prominent appearance of the work's title, preceding the beginning of the body of the text.
A section “Entitled XYZ” means a named subunit of the Document whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language. (Here XYZ stands for a specific section name mentioned below, such as “Acknowledgements”, “Dedications”, “Endorsements”, or “History”.) To “Preserve the Title” of such a section when you modify the Document means that it remains a section “Entitled XYZ” according to this definition.
The Document may include Warranty Disclaimers next to the notice which states that this License applies to the Document. These Warranty Disclaimers are considered to be included by reference in this License, but only as regards disclaiming warranties: any other implication that these Warranty Disclaimers may have is void and has no effect on the meaning of this License.
You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies, and that you add no other conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough number of copies you must also follow the conditions in section 3.
You may also lend copies, under the same conditions stated above, and you may publicly display copies.
If you publish printed copies (or copies in media that commonly have printed covers) of the Document, numbering more than 100, and the Document's license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects.
If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages.
If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a computer-network location from which the general network-using public has access to download using public-standard network protocols a complete Transparent copy of the Document, free of added material. If you use the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public.
It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document.
You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above, provided that you release the Modified Version under precisely this License, with the Modified Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version:
If the Modified Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their titles to the list of Invariant Sections in the Modified Version's license notice. These titles must be distinct from any other section titles.
You may add a section Entitled “Endorsements”, provided it contains nothing but endorsements of your Modified Version by various parties—for example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard.
You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be added by (or through arrangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by arrangement made by the same entity you are acting on behalf of, you may not add another; but you may replace the old one, on explicit permission from the previous publisher that added the old one.
The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modified Version.
You may combine the Document with other documents released under this License, under the terms defined in section 4 above for modified versions, provided that you include in the combination all of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in its license notice, and that you preserve all their Warranty Disclaimers.
The combined work need only contain one copy of this License, and multiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant Sections in the license notice of the combined work.
In the combination, you must combine any sections Entitled “History” in the various original documents, forming one section Entitled “History”; likewise combine any sections Entitled “Acknowledgements”, and any sections Entitled “Dedications”. You must delete all sections Entitled “Endorsements.”
You may make a collection consisting of the Document and other documents released under this License, and replace the individual copies of this License in the various documents with a single copy that is included in the collection, provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects.
You may extract a single document from such a collection, and distribute it individually under this License, provided you insert a copy of this License into the extracted document, and follow this License in all other respects regarding verbatim copying of that document.
A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, is called an “aggregate” if the copyright resulting from the compilation is not used to limit the legal rights of the compilation's users beyond what the individual works permit. When the Document is included in an aggregate, this License does not apply to the other works in the aggregate which are not themselves derivative works of the Document.
If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one half of the entire aggregate, the Document's Cover Texts may be placed on covers that bracket the Document within the aggregate, or the electronic equivalent of covers if the Document is in electronic form. Otherwise they must appear on printed covers that bracket the whole aggregate.
Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this License, and all the license notices in the Document, and any Warranty Disclaimers, provided that you also include the original English version of this License and the original versions of those notices and disclaimers. In case of a disagreement between the translation and the original version of this License or a notice or disclaimer, the original version will prevail.
If a section in the Document is Entitled “Acknowledgements”, “Dedications”, or “History”, the requirement (section 4) to Preserve its Title (section 1) will typically require changing the actual title.
You may not copy, modify, sublicense, or distribute the Document except as expressly provided for under this License. Any other attempt to copy, modify, sublicense or distribute the Document is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See http://www.gnu.org/copyleft/.
Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this License “or any later version” applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by the Free Software Foundation.
To use this License in a document you have written, include a copy of the License in the document and put the following copyright and license notices just after the title page:
Copyright (C) year your name. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled ``GNU Free Documentation License''.
If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, replace the “with...Texts.” line with this:
with the Invariant Sections being list their titles, with the Front-Cover Texts being list, and with the Back-Cover Texts being list.
If you have Invariant Sections without Cover Texts, or some other combination of the three, merge those two alternatives to suit the situation.
If your document contains nontrivial examples of program code, we recommend releasing these examples in parallel under your choice of free software license, such as the GNU General Public License, to permit their use in free software.
Document.adoptNode
: Node manipulationDocument.getElementById
: Functions on DocumentsDocument.getElementsByTagName
: Functions on DocumentsDocument.importNode
: Node manipulationDocument.normalizeDocument
: Functions on DocumentsDOMConfiguration.canSetParameter
: DOM Configuration ParametersDOMConfiguration.getParameter
: DOM Configuration ParametersDOMConfiguration.setParameter
: DOM Configuration ParametersDOMImplementation.createNode
: Node creationElement.getAttribute
: Functions on ElementsElement.getAttributeNode
: Functions on ElementsElement.removeAttribute
: Functions on ElementsElement.removeAttributeNode
: Functions on ElementsElement.setAttribute
: Functions on ElementsElement.setAttributeNode
: Functions on ElementsElement.setIdAttribute
: Functions on ElementsElement.setIdAttributeNode
: Functions on ElementsNode.appendChild
: Node manipulationNode.clone
: Node manipulationNode.compareDocumentPosition
: Node predicatesNode.equalNode
: Node predicatesNode.getUserData
: User dataNode.hasChildNodes
: Node predicatesNode.insertAfter
: Node manipulationNode.insertBefore
: Node manipulationNode.isSameNode
: Node predicatesNode.isSupported
: Node predicatesNode.removeChild
: Node manipulationNode.replaceChild
: Node manipulationNode.setUserData
: User datasdom:adopt-node!
: Node manipulationsdom:append-child!
: Node manipulationsdom:can-set-dom-config-parameter?
: DOM Configuration Parameterssdom:clone-node
: Node manipulationsdom:compare-document-position
: Node predicatessdom:create-document
: Node creationsdom:create-document-type
: Node creationsdom:create-node
: Node creationsdom:equal-node?
: Node predicatessdom:get-attribute
: Functions on Elementssdom:get-attribute-node
: Functions on Elementssdom:get-dom-config-parameter
: DOM Configuration Parameterssdom:get-element-by-id
: Functions on Documentssdom:get-elements-by-tag-name
: Functions on Documentssdom:get-user-data
: User datasdom:has-child-nodes?
: Node predicatessdom:import-node
: Node manipulationsdom:insert-after!
: Node manipulationsdom:insert-before!
: Node manipulationsdom:normalize-document!
: Functions on Documentssdom:remove-attribute!
: Functions on Elementssdom:remove-attribute-node!
: Functions on Elementssdom:remove-child!
: Node manipulationsdom:replace-child!
: Node manipulationsdom:replace-whole-text!
: Functions on Text nodessdom:same-node?
: Node predicatessdom:set-attribute!
: Functions on Elementssdom:set-attribute-node!
: Functions on Elementssdom:set-dom-config-parameter!
: DOM Configuration Parameterssdom:set-id-attribute!
: Functions on Elementssdom:set-id-attribute-node!
: Functions on Elementssdom:set-user-data!
: User datasdom:supported?
: Node predicatessdom:sxml->sdom
: Document parsingsdom:xml->sdom
: Document parsingText.replaceWholeText
: Functions on Text nodesabort
: Event typesATTRIBUTE_NODE
: Node typesCDATA_SECTION_NODE
: Node typeschange
: Event typesclick
: Event typesCOMMENT_NODE
: Node typesDOCUMENT_FRAGMENT_NODE
: Node typesDOCUMENT_NODE
: Node typesDOCUMENT_TYPE_NODE
: Node typesDOMActivate
: Event typesDOMAttrNameChanged
: Event typesDOMElementNameChanged
: Event typesDOMFocusIn
: Event typesDOMFocusOut
: Event typesDOMNodeInserted
: Event typesDOMNodeInsertedIntoDocument
: Event typesDOMNodeRemoved
: Event typesDOMNodeRemovedFromDocument
: Event typesDOMSTRING_SIZE_ERR
: Exception typesDOMSubtreeModified
: Event typesELEMENT_NODE
: Node typesENTITY_NODE
: Node typesENTITY_REFERENCE_NODE
: Node typeserror
: Event typesHIERARCHY_REQUEST_ERR
: Exception typesINDEX_SIZE_ERR
: Exception typesINUSE_ATTRIBUTE_ERR
: Exception typesINVALID_ACCESS_ERR
: Exception typesINVALID_CHARACTER_ERR
: Exception typesINVALID_MODIFICATION_ERR
: Exception typesINVALID_STATE_ERR
: Exception typeskeydown
: Event typeskeyup
: Event typesload
: Event typesmousedown
: Event typesmousemove
: Event typesmouseout
: Event typesmouseover
: Event typesmouseup
: Event typesNAMESPACE_ERR
: Exception typesNO_DATA_ALLOWED_ERR
: Exception typesNO_MODIFICATION_ALLOWED_ERR
: Exception typesNODE_ADOPTED
: User data event typesNODE_CLONED
: User data event typesNODE_DELETED
: User data event typesNODE_IMPORTED
: User data event typesNODE_RENAMED
: User data event typesNOT_FOUND_ERR
: Exception typesNOT_SUPPORTED_ERR
: Exception typesNOTATION_NODE
: Node typesPROCESSING_INSTRUCTION_NODE
: Node typesreset
: Event typesresize
: Event typesscroll
: Event typessdom:event-abort
: Event typessdom:event-change
: Event typessdom:event-click
: Event typessdom:event-dom-activate
: Event typessdom:event-dom-attribute-name-changed
: Event typessdom:event-dom-element-name-changed
: Event typessdom:event-dom-focus-in
: Event typessdom:event-dom-focus-out
: Event typessdom:event-dom-node-inserted
: Event typessdom:event-dom-node-inserted-into-document
: Event typessdom:event-dom-node-removed
: Event typessdom:event-dom-node-removed-from-document
: Event typessdom:event-dom-subtree-modified
: Event typessdom:event-error
: Event typessdom:event-keydown
: Event typessdom:event-keyup
: Event typessdom:event-load
: Event typessdom:event-mousedown
: Event typessdom:event-mousemove
: Event typessdom:event-mouseout
: Event typessdom:event-mouseover
: Event typessdom:event-mouseup
: Event typessdom:event-reset
: Event typessdom:event-resize
: Event typessdom:event-scroll
: Event typessdom:event-select
: Event typessdom:event-submit
: Event typessdom:event-text-input
: Event typessdom:event-unload
: Event typessdom:exception-code-domstring-size-err
: Exception typessdom:exception-code-hierarchy-request-err
: Exception typessdom:exception-code-index-size-err
: Exception typessdom:exception-code-inuse-attribute-err
: Exception typessdom:exception-code-invalid-access-err
: Exception typessdom:exception-code-invalid-character-err
: Exception typessdom:exception-code-invalid-modification-err
: Exception typessdom:exception-code-invalid-state-err
: Exception typessdom:exception-code-namespace-err
: Exception typessdom:exception-code-no-data-allowed-err
: Exception typessdom:exception-code-no-modification-allowed-err
: Exception typessdom:exception-code-not-found-err
: Exception typessdom:exception-code-not-supported-err
: Exception typessdom:exception-code-syntax-err
: Exception typessdom:exception-code-type-mismatch-err
: Exception typessdom:exception-code-validation-err
: Exception typessdom:exception-code-wrong-document-err
: Exception typessdom:node-type-attr
: Node typessdom:node-type-cdata-section
: Node typessdom:node-type-comment
: Node typessdom:node-type-document
: Node typessdom:node-type-document-fragment
: Node typessdom:node-type-document-type
: Node typessdom:node-type-element
: Node typessdom:node-type-entity
: Node typessdom:node-type-entity-reference
: Node typessdom:node-type-notation
: Node typessdom:node-type-processing-instruction
: Node typessdom:node-type-text
: Node typessdom:user-data-event-node-adopted
: User data event typessdom:user-data-event-node-cloned
: User data event typessdom:user-data-event-node-deleted
: User data event typessdom:user-data-event-node-imported
: User data event typessdom:user-data-event-node-renamed
: User data event typesselect
: Event typessubmit
: Event typesSYNTAX_ERR
: Exception typesTEXT_NODE
: Node typestextInput
: Event typesTYPE_MISMATCH_ERR
: Exception typesunload
: Event typesVALIDATION_ERR
: Exception typesWRONG_DOCUMENT_ERR
: Exception types[1] The DOM recommendation specifies that this determination can also be made at load time, but since SDOM relies on SSAX for parsing documents, this information is not reliably available.