| 3 |
<head> |
<head> |
| 4 |
<title>DOM Document Type Definition Module</title> |
<title>DOM Document Type Definition Module</title> |
| 5 |
<link rel="stylesheet" href="http://suika.fam.cx/www/style/html/spec"> |
<link rel="stylesheet" href="http://suika.fam.cx/www/style/html/spec"> |
| 6 |
|
<link rel="stylesheet" href="http://suika.fam.cx/www/style/def/dom"> |
| 7 |
<link rel="license" href="http://suika.fam.cx/c/gnu/fdl"> |
<link rel="license" href="http://suika.fam.cx/c/gnu/fdl"> |
| 8 |
</head> |
</head> |
| 9 |
<body class="has-abstract"> |
<body class="has-abstract"> |
| 172 |
aforementioned cases.</p> |
aforementioned cases.</p> |
| 173 |
</div> |
</div> |
| 174 |
|
|
| 175 |
|
<div class=section id=section-documentxdoctype> |
| 176 |
|
<h2>The <code>DocumentXDoctype</code> Interface</h2> |
| 177 |
|
|
| 178 |
|
<pre class=idl><code>interface <dfn id=DocumentXDoctype><code>DocumentXDoctype</code></dfn> { |
| 179 |
|
|
| 180 |
|
}</code></pre> |
| 181 |
|
|
| 182 |
|
<pre class=ed> |
| 183 |
|
* The [CODE(DOMi)@en[DocumentXDoctype]] Interface Specification |
| 184 |
|
|
| 185 |
|
[1] [[manakai//DOM Extensions]] > New Interfaces > |
| 186 |
|
[[DOM XML Document Type Definition]] module > |
| 187 |
|
The [CODE(DOMi)@en[[[DocumentXDoctype]]]] Interface |
| 188 |
|
|
| 189 |
|
[2] |
| 190 |
|
@@ cast |
| 191 |
|
|
| 192 |
|
** Constructors |
| 193 |
|
|
| 194 |
|
[3] The |
| 195 |
|
[DFN@en[[CODE(DOMm)@en[[[createDocumentTypeDefinition]]]] method]] |
| 196 |
|
returns a [CODE(DOMi)@en[[[DocumentType]]]] node |
| 197 |
|
or raises a [CODE(DOMi)@en[[[DOMException]]]]. |
| 198 |
|
It creates a [CODE(DOMi)@en[[[DocumentType]]]] node |
| 199 |
|
of the given name, belonging to the document. |
| 200 |
|
|
| 201 |
|
[3] The |
| 202 |
|
[DFN@en[[CODE(DOMm)@en[[[createElementTypeDefinition]]]] method]] |
| 203 |
|
returns an [CODE(DOMi)@en[[[ElementTypeDefinition]]]] node |
| 204 |
|
or raises a [CODE(DOMi)@en[[[DOMException]]]]. |
| 205 |
|
It creates an [CODE(DOMi)@en[[[ElementTypeDefinition]]]] node |
| 206 |
|
of the given name, belonging to the document. |
| 207 |
|
|
| 208 |
|
[4] The |
| 209 |
|
[DFN@en[[CODE(DOMm)@en[[[createAttributeDefinition]]]] method]] |
| 210 |
|
returns an [CODE(DOMi)@en[[[AttributeDefinition]]]] node |
| 211 |
|
or raises a [CODE(DOMi)@en[[[DOMException]]]]. |
| 212 |
|
It creates an [CODE(DOMi)@en[[[AttributeDefinition]]]] node |
| 213 |
|
of the given name, belonging to the document. |
| 214 |
|
|
| 215 |
|
[10] The |
| 216 |
|
[DFN@en[[CODE(DOMm)@en[[[createGeneralEntity]]]] method]] |
| 217 |
|
returns an [CODE(DOMi)@en[[[Entity]]]] node |
| 218 |
|
or raises a [CODE(DOMi)@en[[[DOMException]]]]. |
| 219 |
|
It creates an [CODE(DOMi)@en[[[Entity]]]] node, |
| 220 |
|
which represents a general entity, |
| 221 |
|
of the given name, belonging to the document. |
| 222 |
|
|
| 223 |
|
[12] The |
| 224 |
|
[DFN@en[[CODE(DOMm)@en[[[createNotation]]]] method]] |
| 225 |
|
returns a [CODE(DOMi)@en[[[Notation]]]] node |
| 226 |
|
or raises a [CODE(DOMi)@en[[[DOMException]]]]. |
| 227 |
|
It creates a [CODE(DOMi)@en[[[Notation]]]] node |
| 228 |
|
of the given name, belonging to the document. |
| 229 |
|
|
| 230 |
|
[5] |
| 231 |
|
These method take a parameter [CODE(DOMp)@en[[[name]]]], |
| 232 |
|
of type [CODE(DOMi)@en[[[DOMString]]]]. It is |
| 233 |
|
the document type name, element type name, |
| 234 |
|
or attribute name of the node to be created. |
| 235 |
|
|
| 236 |
|
[6] |
| 237 |
|
The [CODE(DOMm)@en[[[createDocumentTypeDefinition]]]] |
| 238 |
|
method [['''MUST''']] create a [CODE(DOMi)@en[[[DocumentType]]]] |
| 239 |
|
object with the following attribute values: |
| 240 |
|
- [CODE(DOMa)@en[[[attributes]]]], |
| 241 |
|
[CODE(DOMa)@en[[[parentNode]]]]: [CODE(DOM)@en[[[null]]]]. |
| 242 |
|
- [CODE(DOMa)@en[[[elementTypes]]]], |
| 243 |
|
[CODE(DOMa)@en[[[generalEntities]]]], |
| 244 |
|
[CODE(DOMa)@en[[[notations]]]]: Empty |
| 245 |
|
[CODE(DOMi)@en[[[NamedNodeMap]]]]s. |
| 246 |
|
- [CODE(DOMa)@en[[[childNodes]]]]: An empty |
| 247 |
|
[CODE(DOMi)@en[[[NodeList]]]]. |
| 248 |
|
- [CODE(DOMa)@en[[[entities]]]]: The same |
| 249 |
|
[CODE(DOMi)@en[[[NamedNodeMap]]]] as |
| 250 |
|
[CODE(DOMa)@en[[[generalEntities]]]]. |
| 251 |
|
- [CODE(DOMa)@en[[[internalSubset]]]], |
| 252 |
|
[CODE(DOMa)@en[[[publicId]]]], [CODE(DOMa)@en[[[systemId]]]]: |
| 253 |
|
Empty strings. |
| 254 |
|
- [CODE(DOMa)@en[[[manakaiReadOnly]]]]: |
| 255 |
|
[CODE(IDL)@en[[[false]]]]. |
| 256 |
|
- [CODE(DOMa)@en[[[nodeName]]]]: [CODE(DOMp)@en[[[name]]]]. |
| 257 |
|
- [CODE(DOMa)@en[[[ownerDocument]]]]: The |
| 258 |
|
[CODE(DOMi)@en[[[Document]]]] node on which the method |
| 259 |
|
is invoked. |
| 260 |
|
|
| 261 |
|
In addition, it [['''MUST''']] be marked as containing |
| 262 |
|
five general entity declarations for XML predefined |
| 263 |
|
entities, i.e. [CODE(XML)@en[[[amp]]]], [CODE(XML)@en[[[lt]]]], |
| 264 |
|
[CODE(XML)@en[[[gt]]]], [CODE(XML)@en[[[quot]]]], and |
| 265 |
|
[CODE(XML)@en[[[apos]]]]. |
| 266 |
|
|
| 267 |
|
[8] |
| 268 |
|
The [CODE(DOMm)@en[[[createElementTypeDefinition]]]] |
| 269 |
|
method [['''MUST''']] create an |
| 270 |
|
[CODE(DOMi)@en[[[ElementTypeDefinition]]]] |
| 271 |
|
object with the following attribute values: |
| 272 |
|
- [CODE(DOMa)@en[[[attributeDefinitions]]]]: |
| 273 |
|
An empty [CODE(DOMi)@en[[[NamedNodeMap]]]]. |
| 274 |
|
- [CODE(DOMa)@en[[[attributes]]]], |
| 275 |
|
[CODE(DOMa)@en[[[parentNode]]]]: [CODE(DOM)@en[[[null]]]]. |
| 276 |
|
- [CODE(DOMa)@en[[[childNodes]]]]: An empty |
| 277 |
|
[CODE(DOMi)@en[[[NodeList]]]]. |
| 278 |
|
- [CODE(DOMa)@en[[[manakaiReadOnly]]]]: |
| 279 |
|
[CODE(IDL)@en[[[false]]]]. |
| 280 |
|
- [CODE(DOMa)@en[[[nodeName]]]]: [CODE(DOMp)@en[[[name]]]]. |
| 281 |
|
- [CODE(DOMa)@en[[[ownerDocument]]]]: The |
| 282 |
|
[CODE(DOMi)@en[[[Document]]]] node on which the method |
| 283 |
|
is invoked. |
| 284 |
|
- [CODE(DOMa)@en[[[ownerDocumentTypeDefinition]]]]: |
| 285 |
|
[CODE(IDL)@en[[[null]]]]. |
| 286 |
|
|
| 287 |
|
@@ Ensure all attributes are defined |
| 288 |
|
|
| 289 |
|
[9] The [CODE(DOMm)@en[[[createAttributeDefinition]]]] |
| 290 |
|
method [['''MUST''']] create an |
| 291 |
|
[CODE(DOMi)@en[[[AttributeDefinition]]]] |
| 292 |
|
object with the following attribute values: |
| 293 |
|
- [CODE(DOMa)@en[[[allowedTokens]]]]: |
| 294 |
|
An empty [CODE(DOMi)@en[[[DOMStringList]]]]. |
| 295 |
|
- [CODE(DOMa)@en[[[attributes]]]], |
| 296 |
|
[CODE(DOMa)@en[[[parentNode]]]]: [CODE(DOM)@en[[[null]]]]. |
| 297 |
|
- [CODE(DOMa)@en[[[childNodes]]]]: An empty |
| 298 |
|
[CODE(DOMi)@en[[[NodeList]]]]. |
| 299 |
|
- [CODE(DOMa)@en[[[declaredType]]]]: |
| 300 |
|
[CODE(DOMc)@en[[[NO_TYPE_ATTR]]]]. |
| 301 |
|
- [CODE(DOMa)@en[[[defaultType]]]]: |
| 302 |
|
[CODE(DOMc)@en[[[UNKNOWN_DEFAULT]]]]. |
| 303 |
|
- [CODE(DOMa)@en[[[manakaiReadOnly]]]]: |
| 304 |
|
[CODE(IDL)@en[[[false]]]]. |
| 305 |
|
- [CODE(DOMa)@en[[[nodeName]]]]: [CODE(DOMp)@en[[[name]]]]. |
| 306 |
|
- [CODE(DOMa)@en[[[ownerDocument]]]]: The |
| 307 |
|
[CODE(DOMi)@en[[[Document]]]] node on which the method |
| 308 |
|
is invoked. |
| 309 |
|
- [CODE(DOMa)@en[[[ownerElementTypeDefinition]]]]: |
| 310 |
|
[CODE(IDL)@en[[[null]]]]. |
| 311 |
|
|
| 312 |
|
@@ Ensure all attributes are defined |
| 313 |
|
|
| 314 |
|
@@ Should we keep these statements?: |
| 315 |
|
However, if the <cfg::cfg|xml-id> configuration |
| 316 |
|
parameter is set to <DOM::true> and the <P::name> |
| 317 |
|
is <XA::xml:id>, then the [CODE(DOMa)@en[[[declaredType]]]] |
| 318 |
|
attribute is set to |
| 319 |
|
<C::AttributeDefinition.ID_ATTR>. |
| 320 |
|
[CODE(DOMa)@en[[[defaultType]]]]? |
| 321 |
|
|
| 322 |
|
[11] The [CODE(DOMm)@en[[[createGeneralEntity]]]] |
| 323 |
|
method [['''MUST''']] create an [CODE(DOMi)@en[[[Entity]]]] |
| 324 |
|
node with the following attribute values: |
| 325 |
|
- [CODE(DOMa)@en[[[attributes]]]], |
| 326 |
|
[CODE(DOMa)@en[[[parentNode]]]]: [CODE(DOM)@en[[[null]]]]. |
| 327 |
|
- [CODE(DOMa)@en[[[childNodes]]]]: An empty |
| 328 |
|
[CODE(DOMi)@en[[[NodeList]]]]. |
| 329 |
|
- [CODE(DOMa)@en[[[manakaiDeclarationBaseURI]]]]: |
| 330 |
|
No explicit value is set. |
| 331 |
|
- [CODE(DOMa)@en[[[manakaiEntityBaseURI]]]]: |
| 332 |
|
No explicit value is set. |
| 333 |
|
- [CODE(DOMa)@en[[[manakaiEntityURI]]]]: |
| 334 |
|
No explicit value is set. |
| 335 |
|
- [CODE(DOMa)@en[[[manakaiHasReplacementTree]]]]: |
| 336 |
|
[CODE(IDL)@en[[[false]]]]. |
| 337 |
|
- [CODE(DOMa)@en[[[manakaiReadOnly]]]]: |
| 338 |
|
[CODE(IDL)@en[[[false]]]]. |
| 339 |
|
- [CODE(DOMa)@en[[[nodeName]]]]: [CODE(DOMp)@en[[[name]]]]. |
| 340 |
|
- [CODE(DOMa)@en[[[notationName]]]]: [CODE(DOM)@en[[[null]]]]. |
| 341 |
|
- [CODE(DOMa)@en[[[ownerDocument]]]]: The |
| 342 |
|
[CODE(DOMi)@en[[[Document]]]] node on which the method |
| 343 |
|
is invoked. |
| 344 |
|
- [CODE(DOMa)@en[[[ownerDocumentTypeDefinition]]]]: |
| 345 |
|
[CODE(IDL)@en[[[null]]]]. |
| 346 |
|
- [CODE(DOMa)@en[[[publicId]]]]: [CODE(DOM)@en[[[null]]]]. |
| 347 |
|
- [CODE(DOMa)@en[[[systemId]]]]: [CODE(DOM)@en[[[null]]]]. |
| 348 |
|
|
| 349 |
|
@@ Ensure all attributes are defined |
| 350 |
|
|
| 351 |
|
@@ publicId and systemId should be empty string? |
| 352 |
|
|
| 353 |
|
[13] The [CODE(DOMm)@en[[[createNotation]]]] |
| 354 |
|
method [['''MUST''']] create a [CODE(DOMi)@en[[[Notation]]]] |
| 355 |
|
node with the following attribute values: |
| 356 |
|
- [CODE(DOMa)@en[[[attributes]]]], |
| 357 |
|
[CODE(DOMa)@en[[[parentNode]]]]: [CODE(DOM)@en[[[null]]]]. |
| 358 |
|
- [CODE(DOMa)@en[[[childNodes]]]]: An empty |
| 359 |
|
[CODE(DOMi)@en[[[NodeList]]]]. |
| 360 |
|
- [CODE(DOMa)@en[[[manakaiDeclarationBaseURI]]]]: |
| 361 |
|
No explicit value is set. |
| 362 |
|
- [CODE(DOMa)@en[[[manakaiReadOnly]]]]: |
| 363 |
|
[CODE(IDL)@en[[[false]]]]. |
| 364 |
|
- [CODE(DOMa)@en[[[nodeName]]]]: [CODE(DOMp)@en[[[name]]]]. |
| 365 |
|
- [CODE(DOMa)@en[[[ownerDocument]]]]: The |
| 366 |
|
[CODE(DOMi)@en[[[Document]]]] node on which the method |
| 367 |
|
is invoked. |
| 368 |
|
- [CODE(DOMa)@en[[[ownerDocumentTypeDefinition]]]]: |
| 369 |
|
[CODE(IDL)@en[[[null]]]]. |
| 370 |
|
- [CODE(DOMa)@en[[[publicId]]]]: [CODE(DOM)@en[[[null]]]]. |
| 371 |
|
- [CODE(DOMa)@en[[[systemId]]]]: [CODE(DOM)@en[[[null]]]]. |
| 372 |
|
|
| 373 |
|
@@ Ensure all attributes are defined |
| 374 |
|
|
| 375 |
|
[7] |
| 376 |
|
These method [['''MUST''']] raise an |
| 377 |
|
[CODE(DOMi)@en[[[INVALID_CHARACTER_ERR]]]] |
| 378 |
|
[CODE(DOMi)@en[[[DOMException]]]] |
| 379 |
|
if the [CODE(DOMp)@en[[[name]]]] is not a legal |
| 380 |
|
name according to the XML version in use as |
| 381 |
|
specified in the [CODE(DOMa)@en[[[xmlVersion]]]] |
| 382 |
|
attribute of the [CODE(DOMi)@en[[[Document]]]] node. |
| 383 |
|
|
| 384 |
|
;; Non-XML case is intentionally left unspecified for now |
| 385 |
|
since DOM3 does not define it. |
| 386 |
|
|
| 387 |
|
;; [CODE(DOMp)@en[[[name]]]] does not have to |
| 388 |
|
be a namespace qualified name. |
| 389 |
|
|
| 390 |
|
;; Note also that it is not an error for the |
| 391 |
|
[CODE(DOMp)@en[[[name]]]] parameter value |
| 392 |
|
to match to the name of one of predefined general |
| 393 |
|
parsed entities in XML or HTML. |
| 394 |
|
|
| 395 |
|
;; If the [CODE(DOMa)@en[[[strictErrorChecking]]]] attribute |
| 396 |
|
is set to [CODE(IDL)@en[[[false]]]], then the implementation |
| 397 |
|
is not required to raise this exception. |
| 398 |
|
|
| 399 |
|
Otherwise, these method [['''MUST''']] return |
| 400 |
|
the newly created node. |
| 401 |
|
</pre> |
| 402 |
|
|
| 403 |
|
</div> |
| 404 |
|
|
| 405 |
|
<div class=section id=section-documenttypedefinition> |
| 406 |
|
<h2>The <code>DocumentTypeDefinition</code> Interface</h2> |
| 407 |
|
|
| 408 |
|
<pre class=idl><code>interface <dfn id=DocumentTypeDefinition><code>DocumentTypeDefinition</code></dfn> { |
| 409 |
|
|
| 410 |
|
}</code></pre> |
| 411 |
|
|
| 412 |
|
<pre class=ed> |
| 413 |
|
[1] In an implementation that supports the |
| 414 |
|
[CODE(URI)@en[[[http://suika.fam.cx/www/2006/feature/XDoctype]]]] |
| 415 |
|
feature, a [CODE(DOMi)@en[[[DocumentType]]]] node |
| 416 |
|
must implement the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] |
| 417 |
|
interface. See [[DOM XML Document Type Definition]>>3] for |
| 418 |
|
details. |
| 419 |
|
|
| 420 |
|
|
| 421 |
|
** Children |
| 422 |
|
|
| 423 |
|
[2] The [DFN@en[[CODE(DOMa)@en[[[elementTypes]]]] attribute]] |
| 424 |
|
of the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] interface |
| 425 |
|
is a live [CODE(DOMi)@en[[[NamedNodeMap]]]] object that |
| 426 |
|
contains all element types belongs to the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] |
| 427 |
|
node. The type of the attribute is [CODE(DOMi)@en[[[NamedNodeMap]]]]. |
| 428 |
|
The attribute is read-only. |
| 429 |
|
|
| 430 |
|
What are contained in this collection depends on how |
| 431 |
|
the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] node was created. If the |
| 432 |
|
node was created as the result of parsing of an XML document, |
| 433 |
|
it [['''MUST''']] contain all element types whose element type and / or |
| 434 |
|
attribute definition list declaration are encountered by and provided for the DOM |
| 435 |
|
implementation from the XML processor. Note that the XML processor might not |
| 436 |
|
provide a part of or entire such information depending on the configuration. |
| 437 |
|
If more than one declarations for an element type or an attribute is available |
| 438 |
|
at the time of the definition node construction, then declarations other than |
| 439 |
|
the first ones [['''MUST''']] be discarded. |
| 440 |
|
|
| 441 |
|
The attribute [['''MUST''']] return the [CODE(DOMi)@en[[[NamedNodeMap]]]] |
| 442 |
|
object that contains all the [CODE(DOMi)@en[[[ElementTypeDefinition]]]] nodes |
| 443 |
|
belong to the node. The returned [CODE(DOMi)@en[[[NamedNodeMap]]]] object |
| 444 |
|
[['''MUST''']] be read-only if and only if the node is read-only. |
| 445 |
|
Note that the [CODE(DOMi)@en[[[NamedNodeMap]]]] object is live |
| 446 |
|
and therefore any change of read-only flag on the node is immediately |
| 447 |
|
reflected by that of the object. |
| 448 |
|
|
| 449 |
|
[3] The [DFN@en[[CODE(DOMa)@en[[[generalEntities]]]] attribute]] |
| 450 |
|
of the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] interface |
| 451 |
|
is a live [CODE(DOMi)@en[[[NamedNodeMap]]]] object that contains all the |
| 452 |
|
general entities belong to the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] node. |
| 453 |
|
The type of the attribute is [CODE(DOMi)@en[[[NamedNodeMap]]]]. |
| 454 |
|
The attribute is read-only. |
| 455 |
|
|
| 456 |
|
All entities declared in the document type definition |
| 457 |
|
contained in or referenced from the document entity |
| 458 |
|
might not be exposed through this collection, depending |
| 459 |
|
on the information provided by the XML processor for |
| 460 |
|
the DOM implementation. In particular, it might not |
| 461 |
|
contain any entity if entity references are expanded |
| 462 |
|
at the parse time. An implementation [['''MUST NOT''']] |
| 463 |
|
expose an [CODE(DOMi)@en[[[Entity]]]] node whose [CODE(DOMa)@en[[[nodeName]]]] |
| 464 |
|
is equal to the name of one of five predefined general entities in |
| 465 |
|
XML through the collection as the result of parsing of an XML |
| 466 |
|
document that has no error. Duplicate entity declarations are also discarded. |
| 467 |
|
|
| 468 |
|
The attribute [['''MUST''']] return the [CODE(DOMi)@en[[[NamedNodeMap]]]] |
| 469 |
|
object that contains all the [CODE(DOMi)@en[[[Entity]]]] nodes |
| 470 |
|
representing general entities belong to the node. The returned |
| 471 |
|
[CODE(DOMi)@en[[[NamedNodeMap]]]] object [['''MUST''']] be read-only if and only if |
| 472 |
|
the node is read-only. Note that the [CODE(DOMi)@en[[[NamedNodeMap]]]] object is live |
| 473 |
|
and therefore any change of read-only flag on the node is immediately |
| 474 |
|
reflected by that of the object. |
| 475 |
|
|
| 476 |
|
The attribute [['''MUST''']] return the same value as the |
| 477 |
|
[CODE(DOMa)@en[[[entites]]]] attribute of the |
| 478 |
|
[CODE(DOMi)@en[[[DocumentType]]]] interface on the same node. |
| 479 |
|
|
| 480 |
|
[4] The [DFN@en[[CODE(DOMa)@en[[[notations]]]] attribute]] |
| 481 |
|
of the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] interface |
| 482 |
|
is a live [CODE(DOMi)@en[[[NamedNodeMap]]]] object that contains |
| 483 |
|
all the notations belong to the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] |
| 484 |
|
node. The type of the attribute is [CODE(DOMi)@en[[[NamedNodeMap]]]]. |
| 485 |
|
The attribute is read-only. |
| 486 |
|
|
| 487 |
|
If the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] node is |
| 488 |
|
created from an XML document, duplicate notation declarations, if any, in DTD |
| 489 |
|
[['''MUST NOT''']] result in a node in the [CODE(DOMi)@en[[[NamedNodeMap]]]] |
| 490 |
|
object and only the first declaration [['''MUST''']] be |
| 491 |
|
made available as a [CODE(DOMi)@en[[[Notation]]]] node. |
| 492 |
|
|
| 493 |
|
;; This definition is based on one for the |
| 494 |
|
[CODE(DOMa)@en[[[notations]]]] attribute of the |
| 495 |
|
[CODE(DOMi)@en[[[DocumentType]]]] interface in DOM XML module. |
| 496 |
|
Since duplication is violation to the Validity Constraint, |
| 497 |
|
XML parsers might vary on how notations are notified to |
| 498 |
|
the application. In particular, [CODE(InfoProp)@en[[[notations]]]] |
| 499 |
|
property of the document information item in XML Information Set |
| 500 |
|
is so defined that in case ''any'' notation is declared for |
| 501 |
|
multiple times then the property has no value. |
| 502 |
|
|
| 503 |
|
The attribute [['''MUST''']] return the [CODE(DOMi)@en[[[NamedNodeMap]]]] |
| 504 |
|
object that contains all the [CODE(DOMi)@en[[[Notation]]]] nodes |
| 505 |
|
representing notations belong to the node. The returned |
| 506 |
|
[CODE(DOMi)@en[[[NamedNodeMap]]]] object [['''MUST''']] be read-only if and only if |
| 507 |
|
the node is read-only. Note that the [CODE(DOMi)@en[[[NamedNodeMap]]]] object is live |
| 508 |
|
and therefore any change of read-only flag on the node is immediately |
| 509 |
|
reflected by that of the object. |
| 510 |
|
|
| 511 |
|
A DOM implementation is not required to implement the |
| 512 |
|
[CODE(DOMa)@en[[[notations]]]] attribute twice |
| 513 |
|
for the [CODE(DOMi)@en[[[DocumentType]]]] and |
| 514 |
|
the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] interfaces; |
| 515 |
|
the latter is defined to contain the same value as the former. |
| 516 |
|
|
| 517 |
|
|
| 518 |
|
** Open Issues (informative) |
| 519 |
|
|
| 520 |
|
[5] A future version of the interface might define the |
| 521 |
|
[CODE(DOMa)@en[[[parameterEntities]]]] attribute and |
| 522 |
|
getter/setter for parameter entities. |
| 523 |
|
</pre> |
| 524 |
|
</div> |
| 525 |
|
|
| 526 |
|
<div class=section id=section-elementtypedefinition> |
| 527 |
|
<h2>The <code>ElementTypeDefinition</code> Interface</h2> |
| 528 |
|
|
| 529 |
|
<pre class=idl><code>interface <dfn id=ElementTypeDefinition><code>ElementTypeDefinition</code></dfn> { |
| 530 |
|
|
| 531 |
|
}</code></pre> |
| 532 |
|
|
| 533 |
|
<pre class=ed>** Modifications to [CODE(DOMi)@en[[[Node]]]] members |
| 534 |
|
|
| 535 |
|
[3] The getter of the [CODE(DOMa)@en[[[attributes]]]] attribute |
| 536 |
|
of an [CODE(DOMi)@en[[[ElementTypeDefinition]]]] object |
| 537 |
|
[['''MUST''']] return [CODE(IDL)@en[[[null]]]]. |
| 538 |
|
|
| 539 |
|
[4] The getter of the [CODE(DOMa)@en[[[baseURI]]]] attribute |
| 540 |
|
of an [CODE(DOMi)@en[[[ElementTypeDefinition]]]] object |
| 541 |
|
[['''MUST''']] return the [CODE(DOMa)@en[[[baseURI]]]] |
| 542 |
|
of the [CDOE(DOMa)@en[[[ownerDocument]]]] of the |
| 543 |
|
[CODE(DOMi)@en[[[ElementTypeDefinition]]]] object. |
| 544 |
|
Note that it might be [CODE(IDL)@en[[[null]]]]. |
| 545 |
|
|
| 546 |
|
[1] The getter of the [CODE(DOMa)@en[[[nodeName]]]] attribute |
| 547 |
|
of an [CODE(DOMi)@en[[[ElementTypeDefinition]]]] object |
| 548 |
|
[['''MUST''']] return the name of the element type. |
| 549 |
|
|
| 550 |
|
[2] The getters of the [CODE(DOMa)@en[[[nodeValue]]]] |
| 551 |
|
and [CODE(DOMa)@en[[[textContent]]]] attributes |
| 552 |
|
of an [CODE(DOMi)@en[[[ElementTypeDefinition]]]] |
| 553 |
|
object [['''MUST''']] return [CODE(IDL)@en[[[null]]]]. |
| 554 |
|
|
| 555 |
|
;; Thus, the setter of these attributes do nothing. |
| 556 |
|
|
| 557 |
|
The setter of the [CODE(DOMa)@en[[[textContent]]]] |
| 558 |
|
attribute of an [CODE(DOMi)@en[[[ElementTypeDefinition]]]] |
| 559 |
|
object [['''MUST NOT''']] throw a |
| 560 |
|
[CODE(DOMc)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]]. |
| 561 |
|
|
| 562 |
|
** The [CODE(DOMi)@en[ElementTypeDefinition]] Interface |
| 563 |
|
|
| 564 |
|
[5] The |
| 565 |
|
[DFN@en[[CODE(DOMa)@en[[[ownerDocumentTypeDefinition]]]] attribute]] |
| 566 |
|
of the [CODE(DOMi)@en[[[ElementTypeDefinition]]]] |
| 567 |
|
interface is defined in [[manakai//DOM Extensions]>>50].</pre> |
| 568 |
|
</div> |
| 569 |
|
|
| 570 |
|
<div class=section id=section-attributedefinition> |
| 571 |
|
<h2>The <code>AttributeDefinition</code> Interface</h2> |
| 572 |
|
|
| 573 |
|
<pre class=idl><code>interface <dfn id=AttributeDefinition><code>AttributeDefinition</code></dfn> { |
| 574 |
|
|
| 575 |
|
}</code></pre> |
| 576 |
|
|
| 577 |
|
<pre class=ed>** Modifications to [CODE(DOMi)@en[[[Node]]]] members |
| 578 |
|
|
| 579 |
|
[3] The getter of the [CODE(DOMa)@en[[[attributes]]]] attribute |
| 580 |
|
of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object |
| 581 |
|
[['''MUST''']] return [CODE(IDL)@en[[[null]]]]. |
| 582 |
|
|
| 583 |
|
[9] The getter of the [CODE(DOMa)@en[[[baseURI]]]] attribute |
| 584 |
|
of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object |
| 585 |
|
[['''MUST''']] return the [CODE(DOMa)@en[[[baseURI]]]] |
| 586 |
|
of the [CDOE(DOMa)@en[[[ownerDocument]]]] of the |
| 587 |
|
[CODE(DOMi)@en[[[AttributeDefinition]]]] object. |
| 588 |
|
Note that it might be [CODE(IDL)@en[[[null]]]]. |
| 589 |
|
|
| 590 |
|
[1] The getter of the [CODE(DOMa)@en[[[nodeName]]]] attribute |
| 591 |
|
of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object |
| 592 |
|
[['''MUST''']] return the name of the attribute. |
| 593 |
|
|
| 594 |
|
[2] The getter of the [CODE(DOMa)@en[[[nodeValue]]]] attribute |
| 595 |
|
of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object |
| 596 |
|
[['''MUST''']] return the normalized default value |
| 597 |
|
of the attribute. |
| 598 |
|
|
| 599 |
|
@@ |
| 600 |
|
|
| 601 |
|
[4] The getter of the [CODE(DOMa)@en[[[textContent]]]] |
| 602 |
|
attribute of an [CODE(DOMi)@en[[[AttributeDefinition]]]] |
| 603 |
|
object [['''MUST''']] behave as if it were an |
| 604 |
|
[CODE(DOMi)@en[[[Attr]]]] object. |
| 605 |
|
|
| 606 |
|
The setter of the [CODE(DOMa)@en[[[textContent]]]] attribute |
| 607 |
|
of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object |
| 608 |
|
[['''MUST''']] behave as if the following algorithm |
| 609 |
|
is performed: |
| 610 |
|
= If the [CODE(DOMi)@en[[[AttributeDefinition]]]] |
| 611 |
|
object is read-only, then throw an |
| 612 |
|
[CODE(DOMc)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]]. |
| 613 |
|
= Remove any child node the node has. |
| 614 |
|
= If the new value is not empty and not [CODE(IDL)@en[[[null]]]], |
| 615 |
|
then create a [CODE(DOMi)@en[[[Text]]]] node |
| 616 |
|
whose [CODE(DOMa)@en[[[data]]]] is the new value |
| 617 |
|
and append it to the [CODE(DOMi)@en[[[AttributeDefinition]]]]. |
| 618 |
|
|
| 619 |
|
** Definition groups |
| 620 |
|
|
| 621 |
|
[6] The |
| 622 |
|
[DFN@en[definition group [CODE(DOM)@en[[[DeclaredValueType]]]]]] |
| 623 |
|
contains integers indicating the type of |
| 624 |
|
attribute value: |
| 625 |
|
,[CODE(DOMc)@en[[[NO_TYPE_ATTR]]]],[CODE(IDL)[[[0]]]],The attribute value type corresponding to [[no value]] in XML Information Set. |
| 626 |
|
,[CODE(DOMc)@en[[[CDATA_ATTR]]]],[CODE(IDL)[[[1]]]],The attribute value type is [CODE(XML)@en[[[CDATA]]]]. |
| 627 |
|
,[CODE(DOMc)@en[[[ID_ATTR]]]],[CODE(IDL)[[[2]]]],The attribute value type is [CODE(XML)@en[[[ID]]]]. |
| 628 |
|
,[CODE(DOMc)@en[[[IDREF_ATTR]]]],[CODE(IDL)[[[3]]]],The attribute value type is [CODE(XML)@en[[[IDREF]]]]. |
| 629 |
|
,[CODE(DOMc)@en[[[IDREFS_ATTR]]]],[CODE(IDL)[[[4]]]],The attribute value type is [CODE(XML)@en[[[IDREFS]]]]. |
| 630 |
|
,[CODE(DOMc)@en[[[ENTITY_ATTR]]]],[CODE(IDL)[[[5]]]],The attribute value type is [CODE(XML)@en[[[ENTITY]]]]. |
| 631 |
|
,[CODE(DOMc)@en[[[ENTITIES_ATTR]]]],[CODE(IDL)[[[6]]]],The attribute value type is [CODE(XML)@en[[[ENTITIES]]]]. |
| 632 |
|
,[CODE(DOMc)@en[[[NMTOKEN_ATTR]]]],[CODE(IDL)[[[7]]]],The attribute value type is [CODE(XML)@en[[[NMTOKEN]]]]. |
| 633 |
|
,[CODE(DOMc)@en[[[NMTOKENS_ATTR]]]],[CODE(IDL)[[[8]]]],The attribute value type is [CODE(XML)@en[[[NMTOKENS]]]]. |
| 634 |
|
,[CODE(DOMc)@en[[[NOTATION_ATTR]]]],[CODE(IDL)[[[9]]]],The attribute value type is [CODE(XML)@en[[[NOTATION]]]]. |
| 635 |
|
,[CODE(DOMc)@en[[[ENUMERATION_ATTR]]]],[CODE(IDL)[[[10]]]],The attribute value is enumeration type. |
| 636 |
|
,[CODE(DOMc)@en[[[UNKNOWN_ATTR]]]],[CODE(IDL)[[[11]]]],"The attribute value type is unknown, because no declaration for the attribute has been read but not [CODE(InfoProp)@en[[[all declarations processed]]]] property would be false." |
| 637 |
|
|
| 638 |
|
The type of these constants are |
| 639 |
|
[CODE(IDL)@en[[[unsigned]] [[short]]]]. |
| 640 |
|
|
| 641 |
|
If no attribute type information is provided, |
| 642 |
|
or if the source of that information does not |
| 643 |
|
distinguish [[no value]] and [[unknown]] as in |
| 644 |
|
XML Information Set, then the |
| 645 |
|
[CODE(DOMc)@en[[[NO_TYPE_ATTR]]]] value |
| 646 |
|
[['''MUST''']] be used. |
| 647 |
|
|
| 648 |
|
;; A newly created [CODE(DOMi)@en[[[AttributeDefinition]]]] |
| 649 |
|
object by [CODE(DOMm)@en[[[createAttributeDefinition]]]] |
| 650 |
|
method has [CODE(DOMa)@en[[[declaredType]]]] attribute |
| 651 |
|
set to [CODE(DOMc)@en[[[NO_TYPE_ATTR]]]]. |
| 652 |
|
|
| 653 |
|
If the source of the attribute type information |
| 654 |
|
does not distinguish [[no value]] and / or [[unknown]] |
| 655 |
|
and [CODE(XML)@en[[[CDATA]]]], then the |
| 656 |
|
[CODE(DOMc)@en[[[CDATA_ATTR]]]] value [['''MUST''']] |
| 657 |
|
be used. |
| 658 |
|
|
| 659 |
|
[11] |
| 660 |
|
In Perl binding, the objects implementing the |
| 661 |
|
[CODE(DOMi)@en[[[Attr]]]] interface [['''MUST''']] |
| 662 |
|
also implement the [CODE(DOM)@en[[[DeclaredValueType]]]] |
| 663 |
|
constant group. |
| 664 |
|
|
| 665 |
|
[7] The |
| 666 |
|
[DFN@en[definition group [CODE(DOM)@en[[[DefaultValueType]]]]]] |
| 667 |
|
contains integers indicating the type of |
| 668 |
|
default attribute value: |
| 669 |
|
,[CODE(DOMc)@en[[[UNKNOWN_DEFAULT]]]],[CODE(IDL)[[[0]]]],The default value is unknown. |
| 670 |
|
,[CODE(DOMc)@en[[[FIXED_DEFAULT]]]],[CODE(IDL)[[[1]]]],The default value is provided and the attribute is [CODE(XML)@en[#[[FIXED]]]] to that value. |
| 671 |
|
,[CODE(DOMc)@en[[[REQUIRED_DEFAULT]]]],[CODE(IDL)[[[2]]]],An attribute specification is [CODE(XML)@en[#[[REQUIRED]]]] for the attribute. |
| 672 |
|
,[CODE(DOMc)@en[[[IMPLIED_DEFAULT]]]],[CODE(IDL)[[[3]]]],The default value is [CODE(XML)@en[#[[IMPLIED]]]]. |
| 673 |
|
,[CODE(DOMc)@en[[[EXPLICIT_DEFAULT]]]],[CODE(IDL)[[[4]]]],The default value is provided but the attribute is not fixed to it. |
| 674 |
|
|
| 675 |
|
The type of these constants are |
| 676 |
|
[CODE(IDL)@en[[[unsigned]] [[short]]]]. |
| 677 |
|
|
| 678 |
|
If the source of the attribute default value type |
| 679 |
|
does not distinguish the [CODE(XML)@en[#[[IMPLIED]]]] |
| 680 |
|
default and unknown default, then the |
| 681 |
|
[CODE(DOMc)@en[[[IMPLIED_DEFAULT]]]] value |
| 682 |
|
[['''MUST''']] be used. |
| 683 |
|
|
| 684 |
|
;; A newly created [CODE(DOMi)@en[[[AttributeDefinition]]]] |
| 685 |
|
object by [CODE(DOMm)@en[[[createAttributeDefinition]]]] |
| 686 |
|
method has [CODE(DOMa)@en[[[declaredType]]]] attribute |
| 687 |
|
set to [CODE(DOMc)@en[[[NO_TYPE_ATTR]]]]. |
| 688 |
|
|
| 689 |
|
** Tree-relationship Attributes |
| 690 |
|
|
| 691 |
|
[10] |
| 692 |
|
The |
| 693 |
|
[DFN@en[[CODE(DOMa)@en[[[ownerElementTypeDefinition]]]] attribute]] |
| 694 |
|
of the [CODE(DOMi)@en[[[AttributeDefinition]]]] interface |
| 695 |
|
is read-only and of type |
| 696 |
|
[CODE(DOMi)@en[[[ElementTypeDefinition]]]]. |
| 697 |
|
It is the [CODE(DOMi)@en[[[ElementTypeDefinition]]]] node |
| 698 |
|
which the [CODE(DOMi)@en[[[AttributeDefinition]]]] node |
| 699 |
|
belong to. |
| 700 |
|
|
| 701 |
|
If the [CODE(DOMi)@en[[[AttributeDefinition]]]] node |
| 702 |
|
is included in the [CODE(DOMa)@en[[[attributeDefinitions]]]] |
| 703 |
|
list of an [CODE(DOMi)@en[[[ElementTypeDefinition]]]] node, |
| 704 |
|
then the attribute [['''MUST''']] return the |
| 705 |
|
[CODE(DOMi)@en[[[ElementTypeDefinition]]]] node. |
| 706 |
|
Otherwise, it [['''MUST''']] return [CODE(DOM)@en[[[null]]]]. |
| 707 |
|
|
| 708 |
|
;; This attribute is analogue to the |
| 709 |
|
[CODE(DOMa)@en[[[ownerDocumentTypeDefinition]]]] attribute |
| 710 |
|
for [CODE(DOMi)@en[[[ElementTypeDefinition]]]], |
| 711 |
|
[CODE(DOMi)@en[[[Entity]]]], and [CODE(DOMi)@en[[[Notation]]]] |
| 712 |
|
nodes, or the [CODE(DOMa)@en[[[ownerElement]]]] |
| 713 |
|
attribute for [CODE(DOMi)@en[[[Attr]]]] nodes. |
| 714 |
|
|
| 715 |
|
** Attributes |
| 716 |
|
|
| 717 |
|
[5] |
| 718 |
|
The [DFN@en[[CODE(DOMa)@en[[[declaredType]]]] attribute]] |
| 719 |
|
of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object |
| 720 |
|
represents the type of the attribute value. |
| 721 |
|
|
| 722 |
|
This attribute is read-write. |
| 723 |
|
The type of the attribute is |
| 724 |
|
[CODE(IDL)@en[[[unsigned]] [[short]]]]. It is expected |
| 725 |
|
that this attribute has a value from the definition group |
| 726 |
|
[CODE(DOM)@en[[[DeclaredValueType]]]]. |
| 727 |
|
|
| 728 |
|
The getter [['''MUST''']] return a value associated |
| 729 |
|
to this attribute. |
| 730 |
|
|
| 731 |
|
The setter [['''MUST''']] |
| 732 |
|
throw a [CODE(DOMc)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]] |
| 733 |
|
[CODE(DOMi)@en[[[DOMException]]]] if the |
| 734 |
|
[CODE(DOMi)@en[[[AttributeDefinition]]]] object is read-only. |
| 735 |
|
Otherwise, the setter [['''MUST''']] set the specified |
| 736 |
|
value as the value associated to this attribute. |
| 737 |
|
|
| 738 |
|
If a parser create an [CODE(DOMi)@en[[[AttributeDefinition]]]] |
| 739 |
|
object, then it [['''MUST''']] set a value |
| 740 |
|
from the [CODE(DOM)@en[[[DeclaredValueType]]]] |
| 741 |
|
definition group. |
| 742 |
|
|
| 743 |
|
[8] |
| 744 |
|
The [DFN@en[[CODE(DOMa)@en[[[defaultType]]]] attribute]] |
| 745 |
|
of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object |
| 746 |
|
represents the type of the attribute default value. |
| 747 |
|
|
| 748 |
|
This attribute is read-write. |
| 749 |
|
The type of the attribute is |
| 750 |
|
[CODE(IDL)@en[[[unsigned]] [[short]]]]. It is expected |
| 751 |
|
that this attribute has a value from the definition group |
| 752 |
|
[CODE(DOM)@en[[[DefaultValueType]]]]. |
| 753 |
|
|
| 754 |
|
The getter [['''MUST''']] return a value associated |
| 755 |
|
to this attribute. |
| 756 |
|
|
| 757 |
|
The setter [['''MUST''']] |
| 758 |
|
throw a [CODE(DOMc)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]] |
| 759 |
|
[CODE(DOMi)@en[[[DOMException]]]] if the |
| 760 |
|
[CODE(DOMi)@en[[[AttributeDefinition]]]] object is read-only. |
| 761 |
|
Otherwise, the setter [['''MUST''']] set the specified |
| 762 |
|
value as the value associated to this attribute. |
| 763 |
|
|
| 764 |
|
If a parser create an [CODE(DOMi)@en[[[AttributeDefinition]]]] |
| 765 |
|
object, then it [['''MUST''']] set a value |
| 766 |
|
from the [CODE(DOM)@en[[[DefaultValueType]]]] |
| 767 |
|
definition group.</pre> |
| 768 |
|
</div> |
| 769 |
|
|
| 770 |
</div> |
</div> |
| 771 |
|
|
| 772 |
|
|