| 176 |
<h2>The <code>DocumentXDoctype</code> Interface</h2> |
<h2>The <code>DocumentXDoctype</code> Interface</h2> |
| 177 |
|
|
| 178 |
<pre class=idl><code>interface <dfn id=DocumentXDoctype><code>DocumentXDoctype</code></dfn> { |
<pre class=idl><code>interface <dfn id=DocumentXDoctype><code>DocumentXDoctype</code></dfn> { |
| 179 |
|
DocumentType <a href="#createDocumentTypeDefinition">createDocumentTypeDefinition</a> |
| 180 |
|
(in DOMString <a href="#createDocumentTypeDefinition-name"><var>name</var></a>) |
| 181 |
|
raises (DOMException); |
| 182 |
|
ElementTypeDefinition <a href="#createElementTypeDefinition">createElementTypeDefinition</a> |
| 183 |
|
(in DOMString <a href="#createElementTypeDefinition-name"><var>name</var></a>) |
| 184 |
|
raises (DOMException); |
| 185 |
|
AttributeDefinition <a href="#createAttributeDefinition">createAttributeDefinition</a> |
| 186 |
|
(in DOMString <a href="#createAttributeDefinition-name"><var>name</var></a>) |
| 187 |
|
raises (DOMException); |
| 188 |
|
Entity <a href="#createGeneralEntity">createGeneralEntityDefinition</a> |
| 189 |
|
(in DOMString <a href="#createGeneralEntity-name"><var>name</var></a>) |
| 190 |
|
raises (DOMException); |
| 191 |
|
Notation <a href="#createNotation">createNotation</a> |
| 192 |
|
(in DOMString <a href="#createNotation-name"><var>name</var></a>) |
| 193 |
|
raises (DOMException); |
| 194 |
}</code></pre> |
}</code></pre> |
| 195 |
|
|
| 196 |
<pre class=ed> |
<div class=ed>@@ cast definition</div> |
| 197 |
* The [CODE(DOMi)@en[DocumentXDoctype]] Interface Specification |
|
| 198 |
|
<dl> |
| 199 |
|
<dt><dfn id=createDocumentTypeDefinition class=dom-method><code>createDocumentTypeDefinition</code></dfn>, |
| 200 |
|
method</dt> |
| 201 |
|
<dd> |
| 202 |
|
<p>This method creates a <code>DocumentType</code> node with the specified |
| 203 |
|
name, belonging to the document.</p> |
| 204 |
|
<p>The <dfn id=createDocumentTypeDefinition-name class=dom-param><var>name</var></dfn> |
| 205 |
|
parameter is the name of the document type.</p> |
| 206 |
|
|
| 207 |
|
<p>When invoked, the method <em class=rfc2119>MUST</em> create and |
| 208 |
|
return a <code>DocumentType</code> node with the following attributes:</p> |
| 209 |
|
<dl> |
| 210 |
|
<dt><code>attributes</code>, <code>parentNode</code></dt> |
| 211 |
|
<dd><code>null</code>.</dd> |
| 212 |
|
<dt><code>elementTypes</code>, <code>generalEntities</code>, and |
| 213 |
|
<code>notations</code></dt> |
| 214 |
|
<dd>Empty <code>NamedNodeMap</code> objects.</dd> |
| 215 |
|
<dt><code>entities</code></dt> |
| 216 |
|
<dd>The same value as the <code>generalEntities</code> attribute.</dd> |
| 217 |
|
<dt><code>childNodes</code></dt> |
| 218 |
|
<dd>An empty <code>NodeList</code> object.</dd> |
| 219 |
|
<dt><code>internalSubset</code>, <code>publicId</code>, and |
| 220 |
|
<code>systemId</code></dt> |
| 221 |
|
<dd>Empty strings.</dd> |
| 222 |
|
<dt><code>manakaiReadOnly</code> <span class=ed>[manakai]</span></dt> |
| 223 |
|
<dd><code>false</code>.</dd> |
| 224 |
|
<dt><code>nodeName</code></dt> |
| 225 |
|
<dd><a href="#createDocumentTypeDefinition-name"><var>name</var></a>.</dd> |
| 226 |
|
<dt><code>ownerDocument</code></dt> |
| 227 |
|
<dd>The <code>Document</code> over which the method is invoked.</dd> |
| 228 |
|
</dl> |
| 229 |
|
<p>In addition, the method <em class=rfc2119>MUST</em> be marked as |
| 230 |
|
containing five general entity declarations: <code>amp</code>, |
| 231 |
|
<code>lt</code>, <code>gt</code>, <code>quot</code>, and |
| 232 |
|
<code>apos</code>.</p> |
| 233 |
|
</dd> |
| 234 |
|
<dt><dfn id=createElementTypeDefinition class=dom-method><code>createElementTypeDefinition</code></dfn>, |
| 235 |
|
method</dt> |
| 236 |
|
<dd> |
| 237 |
|
<p>This method creates a <code>ElementTypeDefinition</code> node with the |
| 238 |
|
specified name, belonging to the document.</p> |
| 239 |
|
<p>The <dfn id=createElementTypeDefinition-name class=dom-param><var>name</var></dfn> |
| 240 |
|
parameter is the name of the element type defined by the element |
| 241 |
|
type definition.</p> |
| 242 |
|
</dd> |
| 243 |
|
<dt><dfn id=createAttributeDefinition class=dom-method><code>createAttributeDefinition</code></dfn>, |
| 244 |
|
method</dt> |
| 245 |
|
<dd> |
| 246 |
|
<p>This method creates a <code>AttributeDefinition</code> node with the |
| 247 |
|
specified name, belonging to the document.</p> |
| 248 |
|
<p>The <dfn id=createAttributeDefinition-name class=dom-param><var>name</var></dfn> |
| 249 |
|
parameter is the name of the attribute defined by the attribute |
| 250 |
|
definition.</p> |
| 251 |
|
</dd> |
| 252 |
|
<dt><dfn id=createGeneralEntity class=dom-method><code>createGeneralEntity</code></dfn>, |
| 253 |
|
method</dt> |
| 254 |
|
<dd> |
| 255 |
|
<p>This method creates a <code>Entity</code> node with the |
| 256 |
|
specified name, which represents a general entity, belonging to the |
| 257 |
|
document.</p> |
| 258 |
|
<p>The <dfn id=createGeneralEntity-name class=dom-param><var>name</var></dfn> |
| 259 |
|
parameter is the name of the general entity.</p> |
| 260 |
|
</dd> |
| 261 |
|
<dt><dfn id=createNotation class=dom-method><code>createNotation</code></dfn>, |
| 262 |
|
method</dt> |
| 263 |
|
<dd> |
| 264 |
|
<p>This method creates a <code>Notation</code> node with the |
| 265 |
|
specified name, belonging to the document.</p> |
| 266 |
|
<p>The <dfn id=createNotation-name class=dom-param><var>name</var></dfn> |
| 267 |
|
parameter is the name of the notation.</p> |
| 268 |
|
</dd> |
| 269 |
|
</dl> |
| 270 |
|
|
| 271 |
[1] [[manakai//DOM Extensions]] > New Interfaces > |
<pre class=ed> |
|
[[DOM XML Document Type Definition]] module > |
|
|
The [CODE(DOMi)@en[[[DocumentXDoctype]]]] Interface |
|
|
|
|
|
[2] |
|
|
@@ cast |
|
|
|
|
|
** Constructors |
|
|
|
|
|
[3] The |
|
|
[DFN@en[[CODE(DOMm)@en[[[createDocumentTypeDefinition]]]] method]] |
|
|
returns a [CODE(DOMi)@en[[[DocumentType]]]] node |
|
|
or raises a [CODE(DOMi)@en[[[DOMException]]]]. |
|
|
It creates a [CODE(DOMi)@en[[[DocumentType]]]] node |
|
|
of the given name, belonging to the document. |
|
|
|
|
|
[3] The |
|
|
[DFN@en[[CODE(DOMm)@en[[[createElementTypeDefinition]]]] method]] |
|
|
returns an [CODE(DOMi)@en[[[ElementTypeDefinition]]]] node |
|
|
or raises a [CODE(DOMi)@en[[[DOMException]]]]. |
|
|
It creates an [CODE(DOMi)@en[[[ElementTypeDefinition]]]] node |
|
|
of the given name, belonging to the document. |
|
|
|
|
|
[4] The |
|
|
[DFN@en[[CODE(DOMm)@en[[[createAttributeDefinition]]]] method]] |
|
|
returns an [CODE(DOMi)@en[[[AttributeDefinition]]]] node |
|
|
or raises a [CODE(DOMi)@en[[[DOMException]]]]. |
|
|
It creates an [CODE(DOMi)@en[[[AttributeDefinition]]]] node |
|
|
of the given name, belonging to the document. |
|
|
|
|
|
[10] The |
|
|
[DFN@en[[CODE(DOMm)@en[[[createGeneralEntity]]]] method]] |
|
|
returns an [CODE(DOMi)@en[[[Entity]]]] node |
|
|
or raises a [CODE(DOMi)@en[[[DOMException]]]]. |
|
|
It creates an [CODE(DOMi)@en[[[Entity]]]] node, |
|
|
which represents a general entity, |
|
|
of the given name, belonging to the document. |
|
|
|
|
|
[12] The |
|
|
[DFN@en[[CODE(DOMm)@en[[[createNotation]]]] method]] |
|
|
returns a [CODE(DOMi)@en[[[Notation]]]] node |
|
|
or raises a [CODE(DOMi)@en[[[DOMException]]]]. |
|
|
It creates a [CODE(DOMi)@en[[[Notation]]]] node |
|
|
of the given name, belonging to the document. |
|
|
|
|
|
[5] |
|
|
These method take a parameter [CODE(DOMp)@en[[[name]]]], |
|
|
of type [CODE(DOMi)@en[[[DOMString]]]]. It is |
|
|
the document type name, element type name, |
|
|
or attribute name of the node to be created. |
|
|
|
|
|
[6] |
|
|
The [CODE(DOMm)@en[[[createDocumentTypeDefinition]]]] |
|
|
method [['''MUST''']] create a [CODE(DOMi)@en[[[DocumentType]]]] |
|
|
object with the following attribute values: |
|
|
- [CODE(DOMa)@en[[[attributes]]]], |
|
|
[CODE(DOMa)@en[[[parentNode]]]]: [CODE(DOM)@en[[[null]]]]. |
|
|
- [CODE(DOMa)@en[[[elementTypes]]]], |
|
|
[CODE(DOMa)@en[[[generalEntities]]]], |
|
|
[CODE(DOMa)@en[[[notations]]]]: Empty |
|
|
[CODE(DOMi)@en[[[NamedNodeMap]]]]s. |
|
|
- [CODE(DOMa)@en[[[childNodes]]]]: An empty |
|
|
[CODE(DOMi)@en[[[NodeList]]]]. |
|
|
- [CODE(DOMa)@en[[[entities]]]]: The same |
|
|
[CODE(DOMi)@en[[[NamedNodeMap]]]] as |
|
|
[CODE(DOMa)@en[[[generalEntities]]]]. |
|
|
- [CODE(DOMa)@en[[[internalSubset]]]], |
|
|
[CODE(DOMa)@en[[[publicId]]]], [CODE(DOMa)@en[[[systemId]]]]: |
|
|
Empty strings. |
|
|
- [CODE(DOMa)@en[[[manakaiReadOnly]]]]: |
|
|
[CODE(IDL)@en[[[false]]]]. |
|
|
- [CODE(DOMa)@en[[[nodeName]]]]: [CODE(DOMp)@en[[[name]]]]. |
|
|
- [CODE(DOMa)@en[[[ownerDocument]]]]: The |
|
|
[CODE(DOMi)@en[[[Document]]]] node on which the method |
|
|
is invoked. |
|
|
|
|
|
In addition, it [['''MUST''']] be marked as containing |
|
|
five general entity declarations for XML predefined |
|
|
entities, i.e. [CODE(XML)@en[[[amp]]]], [CODE(XML)@en[[[lt]]]], |
|
|
[CODE(XML)@en[[[gt]]]], [CODE(XML)@en[[[quot]]]], and |
|
|
[CODE(XML)@en[[[apos]]]]. |
|
| 272 |
|
|
| 273 |
[8] |
[8] |
| 274 |
The [CODE(DOMm)@en[[[createElementTypeDefinition]]]] |
The [CODE(DOMm)@en[[[createElementTypeDefinition]]]] |