CR-DOM-Parsing-20140624.html
author Art Barstow <art.barstow@gmail.com>
Sun, 05 Oct 2014 08:38:12 -0400
changeset 75 5b04cbad78d9
parent 73 d69286304cc3
permissions -rw-r--r--
Add an explicit URL to file a bug
72
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
     1
<!DOCTYPE html>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
     2
<html lang="en" dir="ltr" typeof="bibo:Document w3p:CR" about="" property="dcterms:language" content="en">
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
     3
<head>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
     4
    <meta charset="UTF-8">
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
     5
    <title>DOM Parsing and Serialization</title>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
     6
    <style>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
     7
        /* Make these stand-out more... */
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
     8
        .externalDFN {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
     9
            font-style: italic;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    10
            background-color: #fff9d6;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    11
        }
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    12
        /* Switch statement */
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    13
        dl.switch dt::before {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    14
            content: "↪ ";
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    15
            margin-left: 1em;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    16
        }
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    17
        /* Better spacing around various lists (implied paragraph children) */
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    18
        ol > li, section:not(#toc) ul > li, section dl > dt {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    19
            margin: 1em 0;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    20
        }
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    21
        var { color: maroon; }
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    22
        /* domintro styling */
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    23
        dl.domintro {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    24
            background-color: rgb(221, 255, 221);
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    25
            padding: 1em 0.5em 1em 2em;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    26
            clear: both;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    27
        }
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    28
        dl.domintro dt {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    29
            color: black;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    30
        }
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    31
        dl.domintro > dd {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    32
            color: green;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    33
        }
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    34
        dl.domintro::before {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    35
            float: right;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    36
            background-color: white;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    37
            display: block;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    38
            border: 2px solid black;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    39
            color: green;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    40
            margin-top: -20px;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    41
            padding: 2px;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    42
            content: "This box is non-normative. Implementation requirements are given below this box.";
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    43
        }
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    44
        /* Fancy table stuff */
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    45
        table {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    46
            border-collapse: collapse;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    47
        }
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    48
        thead tr {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    49
            border-bottom: 2px solid black;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    50
        }
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    51
        tbody tr:not(:last-child) {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    52
            border-bottom: 1px solid black;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    53
        }
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    54
        td {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    55
            border-left: 1px solid black;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    56
            padding: 4px;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    57
        }
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    58
        /* Extra IDL :-) */
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    59
        .extraidl {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    60
            line-height: 120%;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    61
            padding: 1em;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    62
            border-top: 1px solid #90b8de;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    63
            border-bottom: 1px solid #90b8de;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    64
        }
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    65
        .extraidl:before {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    66
            width: 150px;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    67
            color: #fff;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    68
            padding: 3px;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    69
            font-weight: bold;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    70
            font-family: initial;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    71
            margin: -1em 0 1em -1em;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    72
            display: block;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    73
            content: "WebIDL";
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    74
            background-color: rgb(144, 184, 222);
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    75
        }
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    76
    </style>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    77
    
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    78
    
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    79
<style>/*****************************************************************
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    80
 * ReSpec 3 CSS
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    81
 * Robin Berjon - http://berjon.com/
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    82
 *****************************************************************/
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    83
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    84
/* --- INLINES --- */
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    85
em.rfc2119 { 
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    86
    text-transform:     lowercase;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    87
    font-variant:       small-caps;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    88
    font-style:         normal;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    89
    color:              #900;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    90
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    91
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    92
h1 acronym, h2 acronym, h3 acronym, h4 acronym, h5 acronym, h6 acronym, a acronym,
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    93
h1 abbr, h2 abbr, h3 abbr, h4 abbr, h5 abbr, h6 abbr, a abbr {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    94
    border: none;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    95
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    96
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    97
dfn {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    98
    font-weight:    bold;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
    99
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   100
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   101
a.internalDFN {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   102
    color:  inherit;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   103
    border-bottom:  1px solid #99c;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   104
    text-decoration:    none;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   105
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   106
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   107
a.externalDFN {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   108
    color:  inherit;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   109
    border-bottom:  1px dotted #ccc;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   110
    text-decoration:    none;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   111
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   112
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   113
a.bibref {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   114
    text-decoration:    none;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   115
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   116
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   117
cite .bibref {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   118
    font-style: normal;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   119
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   120
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   121
code {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   122
    color:  #ff4500;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   123
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   124
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   125
/* --- TOC --- */
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   126
.toc a, .tof a {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   127
    text-decoration:    none;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   128
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   129
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   130
a .secno, a .figno {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   131
    color:  #000;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   132
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   133
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   134
ul.tof, ol.tof {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   135
    list-style: none outside none;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   136
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   137
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   138
.caption {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   139
    margin-top: 0.5em;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   140
    font-style:   italic;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   141
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   142
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   143
/* --- TABLE --- */
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   144
table.simple {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   145
    border-spacing: 0;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   146
    border-collapse:    collapse;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   147
    border-bottom:  3px solid #005a9c;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   148
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   149
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   150
.simple th {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   151
    background: #005a9c;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   152
    color:  #fff;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   153
    padding:    3px 5px;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   154
    text-align: left;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   155
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   156
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   157
.simple th[scope="row"] {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   158
    background: inherit;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   159
    color:  inherit;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   160
    border-top: 1px solid #ddd;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   161
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   162
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   163
.simple td {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   164
    padding:    3px 10px;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   165
    border-top: 1px solid #ddd;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   166
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   167
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   168
.simple tr:nth-child(even) {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   169
    background: #f0f6ff;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   170
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   171
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   172
/* --- DL --- */
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   173
.section dd > p:first-child {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   174
    margin-top: 0;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   175
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   176
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   177
.section dd > p:last-child {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   178
    margin-bottom: 0;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   179
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   180
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   181
.section dd {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   182
    margin-bottom:  1em;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   183
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   184
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   185
.section dl.attrs dd, .section dl.eldef dd {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   186
    margin-bottom:  0;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   187
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   188
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   189
@media print {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   190
    .removeOnSave {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   191
        display: none;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   192
    }
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   193
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   194
</style><style>/* --- ISSUES/NOTES --- */
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   195
div.issue-title, div.note-title {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   196
    padding-right:  1em;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   197
    min-width: 7.5em;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   198
    color: #b9ab2d;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   199
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   200
div.issue-title { color: #e05252; }
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   201
div.note-title { color: #2b2; }
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   202
div.issue-title span, div.note-title span {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   203
    text-transform: uppercase;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   204
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   205
div.note, div.issue {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   206
    margin-top: 1em;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   207
    margin-bottom: 1em;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   208
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   209
.note > p:first-child, .issue > p:first-child { margin-top: 0 }
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   210
.issue, .note {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   211
    padding: .5em;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   212
    border-left-width: .5em;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   213
    border-left-style: solid;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   214
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   215
div.issue, div.note {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   216
    padding: 1em 1.2em 0.5em;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   217
    margin: 1em 0;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   218
    position: relative;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   219
    clear: both;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   220
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   221
span.note, span.issue { padding: .1em .5em .15em; }
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   222
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   223
.issue {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   224
    border-color: #e05252;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   225
    background: #fbe9e9;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   226
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   227
.note {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   228
    border-color: #52e052;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   229
    background: #e9fbe9;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   230
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   231
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   232
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   233
</style><style>/* --- WEB IDL --- */
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   234
pre.idl {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   235
    border-top: 1px solid #90b8de;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   236
    border-bottom: 1px solid #90b8de;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   237
    padding:    1em;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   238
    line-height:    120%;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   239
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   240
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   241
pre.idl::before {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   242
    content:    "WebIDL";
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   243
    display:    block;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   244
    width:      150px;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   245
    background: #90b8de;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   246
    color:  #fff;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   247
    font-family:    initial;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   248
    padding:    3px;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   249
    font-weight:    bold;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   250
    margin: -1em 0 1em -1em;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   251
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   252
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   253
.idlType {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   254
    color:  #ff4500;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   255
    font-weight:    bold;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   256
    text-decoration:    none;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   257
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   258
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   259
/*.idlModule*/
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   260
/*.idlModuleID*/
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   261
/*.idlInterface*/
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   262
.idlInterfaceID, .idlDictionaryID, .idlCallbackID, .idlEnumID {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   263
    font-weight:    bold;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   264
    color:  #005a9c;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   265
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   266
a.idlEnumItem {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   267
    color:  #000;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   268
    border-bottom:  1px dotted #ccc;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   269
    text-decoration: none;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   270
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   271
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   272
.idlSuperclass {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   273
    font-style: italic;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   274
    color:  #005a9c;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   275
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   276
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   277
/*.idlAttribute*/
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   278
.idlAttrType, .idlFieldType, .idlMemberType {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   279
    color:  #005a9c;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   280
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   281
.idlAttrName, .idlFieldName, .idlMemberName {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   282
    color:  #ff4500;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   283
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   284
.idlAttrName a, .idlFieldName a, .idlMemberName a {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   285
    color:  #ff4500;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   286
    border-bottom:  1px dotted #ff4500;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   287
    text-decoration: none;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   288
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   289
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   290
/*.idlMethod*/
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   291
.idlMethType, .idlCallbackType {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   292
    color:  #005a9c;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   293
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   294
.idlMethName {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   295
    color:  #ff4500;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   296
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   297
.idlMethName a {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   298
    color:  #ff4500;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   299
    border-bottom:  1px dotted #ff4500;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   300
    text-decoration: none;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   301
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   302
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   303
/*.idlCtor*/
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   304
.idlCtorName {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   305
    color:  #ff4500;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   306
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   307
.idlCtorName a {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   308
    color:  #ff4500;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   309
    border-bottom:  1px dotted #ff4500;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   310
    text-decoration: none;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   311
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   312
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   313
/*.idlParam*/
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   314
.idlParamType {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   315
    color:  #005a9c;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   316
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   317
.idlParamName, .idlDefaultValue {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   318
    font-style: italic;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   319
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   320
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   321
.extAttr {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   322
    color:  #666;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   323
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   324
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   325
/*.idlSectionComment*/
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   326
.idlSectionComment {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   327
    color: gray;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   328
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   329
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   330
/*.idlConst*/
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   331
.idlConstType {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   332
    color:  #005a9c;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   333
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   334
.idlConstName {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   335
    color:  #ff4500;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   336
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   337
.idlConstName a {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   338
    color:  #ff4500;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   339
    border-bottom:  1px dotted #ff4500;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   340
    text-decoration: none;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   341
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   342
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   343
/*.idlException*/
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   344
.idlExceptionID {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   345
    font-weight:    bold;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   346
    color:  #c00;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   347
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   348
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   349
.idlTypedefID, .idlTypedefType {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   350
    color:  #005a9c;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   351
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   352
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   353
.idlRaises, .idlRaises a.idlType, .idlRaises a.idlType code, .excName a, .excName a code {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   354
    color:  #c00;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   355
    font-weight:    normal;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   356
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   357
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   358
.excName a {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   359
    font-family:    monospace;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   360
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   361
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   362
.idlRaises a.idlType, .excName a.idlType {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   363
    border-bottom:  1px dotted #c00;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   364
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   365
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   366
.excGetSetTrue, .excGetSetFalse, .prmNullTrue, .prmNullFalse, .prmOptTrue, .prmOptFalse {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   367
    width:  45px;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   368
    text-align: center;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   369
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   370
.excGetSetTrue, .prmNullTrue, .prmOptTrue { color:  #0c0; }
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   371
.excGetSetFalse, .prmNullFalse, .prmOptFalse { color:  #c00; }
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   372
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   373
.idlImplements a {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   374
    font-weight:    bold;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   375
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   376
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   377
dl.attributes, dl.methods, dl.constants, dl.constructors, dl.fields, dl.dictionary-members {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   378
    margin-left:    2em;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   379
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   380
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   381
.attributes dt, .methods dt, .constants dt, .constructors dt, .fields dt, .dictionary-members dt {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   382
    font-weight:    normal;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   383
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   384
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   385
.attributes dt code, .methods dt code, .constants dt code, .constructors dt code, .fields dt code, .dictionary-members dt code {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   386
    font-weight:    bold;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   387
    color:  #000;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   388
    font-family:    monospace;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   389
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   390
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   391
.attributes dt code, .fields dt code, .dictionary-members dt code {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   392
    background:  #ffffd2;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   393
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   394
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   395
.attributes dt .idlAttrType code, .fields dt .idlFieldType code, .dictionary-members dt .idlMemberType code {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   396
    color:  #005a9c;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   397
    background:  transparent;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   398
    font-family:    inherit;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   399
    font-weight:    normal;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   400
    font-style: italic;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   401
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   402
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   403
.methods dt code {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   404
    background:  #d9e6f8;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   405
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   406
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   407
.constants dt code {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   408
    background:  #ddffd2;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   409
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   410
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   411
.constructors dt code {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   412
    background:  #cfc;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   413
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   414
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   415
.attributes dd, .methods dd, .constants dd, .constructors dd, .fields dd, .dictionary-members dd {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   416
    margin-bottom:  1em;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   417
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   418
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   419
table.parameters, table.exceptions {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   420
    border-spacing: 0;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   421
    border-collapse:    collapse;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   422
    margin: 0.5em 0;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   423
    width:  100%;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   424
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   425
table.parameters { border-bottom:  1px solid #90b8de; }
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   426
table.exceptions { border-bottom:  1px solid #deb890; }
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   427
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   428
.parameters th, .exceptions th {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   429
    color:  #fff;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   430
    padding:    3px 5px;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   431
    text-align: left;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   432
    font-family:    initial;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   433
    font-weight:    normal;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   434
    text-shadow:    #666 1px 1px 0;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   435
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   436
.parameters th { background: #90b8de; }
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   437
.exceptions th { background: #deb890; }
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   438
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   439
.parameters td, .exceptions td {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   440
    padding:    3px 10px;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   441
    border-top: 1px solid #ddd;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   442
    vertical-align: top;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   443
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   444
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   445
.parameters tr:first-child td, .exceptions tr:first-child td {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   446
    border-top: none;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   447
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   448
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   449
.parameters td.prmName, .exceptions td.excName, .exceptions td.excCodeName {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   450
    width:  100px;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   451
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   452
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   453
.parameters td.prmType {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   454
    width:  120px;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   455
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   456
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   457
table.exceptions table {
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   458
    border-spacing: 0;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   459
    border-collapse:    collapse;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   460
    width:  100%;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   461
}
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   462
</style><link href="https://www.w3.org/StyleSheets/TR/W3C-CR" rel="stylesheet"><!--[if lt IE 9]><script src='https://www.w3.org/2008/site/js/html5shiv.js'></script><![endif]--></head>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   463
<body class="h-entry" id="respecDocument" role="document"><div class="head" id="respecHeader" role="contentinfo">
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   464
  <p>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   465
    
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   466
      <a href="http://www.w3.org/"><img width="72" height="48" alt="W3C" src="https://www.w3.org/Icons/w3c_home"></a>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   467
    
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   468
  </p>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   469
  <h1 class="title p-name" id="title" property="dcterms:title">DOM Parsing and Serialization</h1>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   470
  
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   471
    <h2 id="subtitle" property="bibo:subtitle">DOMParser, XMLSerializer, innerHTML, and similar APIs</h2>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   472
  
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   473
  <h2 id="w3c-candidate-recommendation-24-june-2014" property="dcterms:issued" content="2014-06-24T07:00:00.000Z" datatype="xsd:dateTime"><abbr title="World Wide Web Consortium">W3C</abbr> Candidate Recommendation <time class="dt-published" datetime="2014-06-24">24 June 2014</time></h2>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   474
  <dl>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   475
    
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   476
      <dt>This version:</dt>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   477
      <dd><a class="u-url" href="http://www.w3.org/TR/2014/CR-DOM-Parsing-20140624/">http://www.w3.org/TR/2014/CR-DOM-Parsing-20140624/</a></dd>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   478
      <dt>Latest published version:</dt>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   479
      <dd><a href="http://www.w3.org/TR/DOM-Parsing/">http://www.w3.org/TR/DOM-Parsing/</a></dd>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   480
    
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   481
    
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   482
      <dt>Latest editor's draft:</dt>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   483
      <dd><a href="https://dvcs.w3.org/hg/innerhtml/raw-file/tip/index.html">https://dvcs.w3.org/hg/innerhtml/raw-file/tip/index.html</a></dd>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   484
    
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   485
    
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   486
      <dt>Test suite:</dt>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   487
      <dd><a href="http://w3c-test.org/domparsing/">http://w3c-test.org/domparsing/</a></dd>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   488
    
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   489
    
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   490
      <dt>Implementation report:</dt>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   491
      <dd><a href="https://dvcs.w3.org/hg/innerhtml/raw-file/tip/implementationReport.html">https://dvcs.w3.org/hg/innerhtml/raw-file/tip/implementationReport.html</a></dd>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   492
    
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   493
    
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   494
    
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   495
    
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   496
      <dt>Previous version:</dt>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   497
      <dd><a href="http://www.w3.org/TR/2014/WD-DOM-Parsing-20140501/" rel="dcterms:replaces">http://www.w3.org/TR/2014/WD-DOM-Parsing-20140501/</a></dd>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   498
    
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   499
    
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   500
    <dt>Editor:</dt>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   501
    <dd class="p-author h-card vcard" inlist="" rel="bibo:editor"><span typeof="foaf:Person"><span class="p-name fn" property="foaf:name">Travis Leithead</span>, <a class="p-org org h-org h-card" href="http://www.microsoft.com" rel="foaf:workplaceHomepage">Microsoft</a>, <span class="ed_mailto"><a class="u-email email" href="mailto:travis.leithead@microsoft.com" rel="foaf:mbox">travis.leithead@microsoft.com</a></span></span>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   502
</dd>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   503
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   504
    
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   505
    
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   506
  </dl>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   507
  
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   508
  
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   509
  
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   510
  
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   511
    
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   512
      <p class="copyright">
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   513
        <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> ©
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   514
        2014
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   515
        
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   516
        <a href="http://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   517
        (<a href="http://www.csail.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>,
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   518
        <a href="http://www.ercim.eu/"><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>,
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   519
        <a href="http://www.keio.ac.jp/">Keio</a>, <a href="http://ev.buaa.edu.cn/">Beihang</a>), 
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   520
        
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   521
        All Rights Reserved.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   522
        
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   523
        <abbr title="World Wide Web Consortium">W3C</abbr> <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   524
        <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   525
        
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   526
          <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   527
        
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   528
        rules apply.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   529
      </p>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   530
    
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   531
  
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   532
  <hr>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   533
</div>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   534
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   535
    <section class="introductory" id="abstract" typeof="bibo:Chapter" property="dcterms:abstract" datatype="" rel="bibo:Chapter" resource="#abstract"><h2 id="h2_abstract" role="heading" aria-level="1">Abstract</h2>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   536
       <p>This specification defines various APIs for programmatic access to
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   537
          HTML and generic XML parsers by web applications for use in parsing
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   538
          and serializing DOM nodes.</p>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   539
    </section><section class="introductory" id="sotd" typeof="bibo:Chapter" rel="bibo:Chapter" resource="#sotd"><h2 id="h2_sotd" role="heading" aria-level="1">Status of This Document</h2>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   540
  
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   541
    
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   542
      
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   543
        <p>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   544
          <em>This section describes the status of this document at the time of its publication.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   545
          Other documents may supersede this document. A list of current <abbr title="World Wide Web Consortium">W3C</abbr> publications and the
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   546
          latest revision of this technical report can be found in the <a href="http://www.w3.org/TR/"><abbr title="World Wide Web Consortium">W3C</abbr> technical reports index</a> at
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   547
          http://www.w3.org/TR/.</em>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   548
        </p>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   549
        
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   550
        <p>This specification is based on the original work of the <a href="http://domparsing.spec.whatwg.org/">
73
d69286304cc3 Update title of WHATWG version of DOM P&S spec
Art Barstow <art.barstow@nokia.com>
parents: 72
diff changeset
   551
            DOM Parsing and Serialization Living Standard</a>, though it has diverged in terms of
72
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   552
            supported features, normative requirements, and algorithm specificity. As appropriate,
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   553
            relevant fixes from the living specification are incorporated into this document.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   554
    </p>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   555
        <p>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   556
          This document was published by the <a href="http://www.w3.org/2008/webapps/">Web Applications Working Group</a> as a Candidate Recommendation.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   557
          
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   558
            This document is intended to become a <abbr title="World Wide Web Consortium">W3C</abbr> Recommendation.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   559
          
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   560
          
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   561
            If you wish to make comments regarding this document, please send them to 
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   562
            <a href="mailto:www-dom@w3.org?subject=DOM-Parsing">www-dom@w3.org</a> 
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   563
            (<a href="mailto:www-dom-request@w3.org?subject=subscribe">subscribe</a>,
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   564
            <a href="http://lists.w3.org/Archives/Public/www-dom/">archives</a>)
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   565
              with <code>DOM-Parsing</code> at the start of your email's subject.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   566
          
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   567
          
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   568
          
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   569
            <abbr title="World Wide Web Consortium">W3C</abbr> publishes a Candidate Recommendation to indicate that the document is believed to be
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   570
            stable and to encourage implementation by the developer community. This Candidate
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   571
            Recommendation is expected to advance to Proposed Recommendation no earlier than
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   572
            24 October 2014.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   573
          
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   574
          
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   575
            All comments are welcome.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   576
          
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   577
        </p>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   578
        
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   579
          <p>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   580
            Please see the Working Group's  <a href="https://dvcs.w3.org/hg/innerhtml/raw-file/tip/implementationReport.html">implementation
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   581
            report</a>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   582
          </p>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   583
        
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   584
        
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   585
          <p>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   586
            Publication as a Candidate Recommendation does not imply endorsement by the <abbr title="World Wide Web Consortium">W3C</abbr>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   587
            Membership. This is a draft document and may be updated, replaced or obsoleted by other
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   588
            documents at any time. It is inappropriate to cite this document as other than work in
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   589
            progress.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   590
          </p>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   591
        
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   592
        
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   593
        
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   594
        <p>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   595
          
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   596
            This document was produced by a group operating under the 
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   597
            <a id="sotd_patent" href="http://www.w3.org/Consortium/Patent-Policy-20040205/" rel="w3p:patentRules" about="">5 February 2004 <abbr title="World Wide Web Consortium">W3C</abbr> Patent
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   598
            Policy</a>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   599
          
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   600
          
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   601
          
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   602
            
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   603
              <abbr title="World Wide Web Consortium">W3C</abbr> maintains a <a href="http://www.w3.org/2004/01/pp-impl/42538/status" rel="disclosure">public list of any patent
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   604
              disclosures</a> 
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   605
            
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   606
            made in connection with the deliverables of the group; that page also includes
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   607
            instructions for disclosing a patent. An individual who has actual knowledge of a patent
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   608
            which the individual believes contains
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   609
            <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   610
            Claim(s)</a> must disclose the information in accordance with
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   611
            <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   612
            6 of the <abbr title="World Wide Web Consortium">W3C</abbr> Patent Policy</a>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   613
          
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   614
          
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   615
        </p>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   616
        
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   617
      
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   618
    
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   619
  
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   620
</section><section id="toc"><h2 class="introductory" id="h2_toc" role="heading" aria-level="1">Table of Contents</h2><ul class="toc" id="respecContents" role="directory"><li class="tocline"><a class="tocxref" href="#conformance"><span class="secno">1. </span>Conformance</a><ul class="toc"><li class="tocline"><a class="tocxref" href="#dependencies"><span class="secno">1.1 </span>Dependencies</a></li><li class="tocline"><a class="tocxref" href="#extensibility"><span class="secno">1.2 </span>Extensibility</a></li></ul></li><li class="tocline"><a class="tocxref" href="#terminology"><span class="secno">2. </span>Terminology</a></li><li class="tocline"><a class="tocxref" href="#namespaces"><span class="secno">3. </span>Namespaces</a></li><li class="tocline"><a class="tocxref" href="#parsing-and-serializing-nodes"><span class="secno">4. </span>Parsing and serializing <span title="node" class="formerLink">Node</span>s</a><ul class="toc"><li class="tocline"><a class="tocxref" href="#parsing"><span class="secno">4.1 </span>Parsing</a></li><li class="tocline"><a class="tocxref" href="#serializing"><span class="secno">4.2 </span>Serializing</a></li></ul></li><li class="tocline"><a class="tocxref" href="#the-domparser-interface"><span class="secno">5. </span>The <code>DOMParser</code> interface</a><ul class="toc"><li class="tocline"><a class="tocxref" href="#methods"><span class="secno">5.1 </span>Methods</a></li></ul></li><li class="tocline"><a class="tocxref" href="#the-xmlserializer-interface"><span class="secno">6. </span>The <code>XMLSerializer</code> interface</a><ul class="toc"><li class="tocline"><a class="tocxref" href="#methods-1"><span class="secno">6.1 </span>Methods</a></li></ul></li><li class="tocline"><a class="tocxref" href="#extensions-to-the-element-interface"><span class="secno">7. </span>Extensions to the <code><span title="element" class="formerLink">Element</span></code> interface</a><ul class="toc"><li class="tocline"><a class="tocxref" href="#attributes"><span class="secno">7.1 </span>Attributes</a></li><li class="tocline"><a class="tocxref" href="#methods-2"><span class="secno">7.2 </span>Methods</a></li></ul></li><li class="tocline"><a class="tocxref" href="#extensions-to-the-range-interface"><span class="secno">8. </span>Extensions to the <code><span title="range" class="formerLink">Range</span></code> interface</a><ul class="toc"><li class="tocline"><a class="tocxref" href="#methods-3"><span class="secno">8.1 </span>Methods</a></li></ul></li><li class="tocline"><a class="tocxref" href="#revision-history"><span class="secno">A. </span>Revision History</a></li><li class="tocline"><a class="tocxref" href="#acknowledgements"><span class="secno">B. </span>Acknowledgements</a></li><li class="tocline"><a class="tocxref" href="#references"><span class="secno">C. </span>References</a><ul class="toc"><li class="tocline"><a class="tocxref" href="#normative-references"><span class="secno">C.1 </span>Normative references</a></li><li class="tocline"><a class="tocxref" href="#informative-references"><span class="secno">C.2 </span>Informative references</a></li></ul></li></ul></section>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   621
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   622
    
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   623
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   624
    <section class="introductory" id="crec" typeof="bibo:Chapter" rel="bibo:Chapter" resource="#crec">
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   625
        <h2 id="h2_crec" role="heading" aria-level="1">Candidate Recommendation Exit Criteria</h2>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   626
        <p>This specification will not advance to Proposed Recommendation before the spec's 
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   627
            <a href="http://w3c-test.org/domparsing/">test suite</a> is completed and two or 
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   628
            more independent implementations pass each test, although no single implementation 
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   629
            must pass each test. We expect to meet this criteria no sooner than 24 October 2014.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   630
            The group will also create an 
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   631
            <a href="https://dvcs.w3.org/hg/innerhtml/raw-file/tip/implementationReport.html">Implementation Report</a>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   632
    </p></section>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   633
    
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   634
    <!-- <section id="issues" class="introductory">
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   635
        <h1>Issues</h1>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   636
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   637
        <p class=issue>Open issues that appear throughout the remainder of this
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   638
        document will be highlighted like this.</p>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   639
    </section> -->
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   640
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   641
    <section id="conformance" typeof="bibo:Chapter" rel="bibo:Chapter" resource="#conformance"><!--OddPage--><h2 id="h2_conformance" role="heading" aria-level="1"><span class="secno">1. </span>Conformance</h2>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   642
<p>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   643
  As well as sections marked as non-normative, all authoring guidelines, diagrams, examples,
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   644
  and notes in this specification are non-normative. Everything else in this specification is
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   645
  normative.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   646
</p>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   647
<p>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   648
  The key words <em title="MUST" class="rfc2119">MUST</em>, <em title="MUST NOT" class="rfc2119">MUST NOT</em>, <em title="REQUIRED" class="rfc2119">REQUIRED</em>, <em title="SHOULD" class="rfc2119">SHOULD</em>, <em title="SHOULD NOT" class="rfc2119">SHOULD NOT</em>, <em title="RECOMMENDED" class="rfc2119">RECOMMENDED</em>, <em title="MAY" class="rfc2119">MAY</em>,
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   649
  and <em title="OPTIONAL" class="rfc2119">OPTIONAL</em> in this specification are to be interpreted as described in [<cite><a class="bibref" href="#bib-RFC2119">RFC2119</a></cite>].
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   650
</p>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   651
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   652
        <p>Requirements phrased in the imperative as part of algorithms
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   653
        (such as "strip any leading space characters" or "return false and
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   654
        terminate these steps") are to be interpreted with the meaning of the
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   655
        key word ("must", "should", "may", etc) used in introducing the
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   656
        algorithm.</p>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   657
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   658
        <p>Conformance requirements phrased as algorithms or specific steps
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   659
        may be implemented in any manner, so long as the end result is
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   660
        equivalent. (In particular, the algorithms defined in this
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   661
        specification are intended to be easy to follow, and not intended to
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   662
        be performant.)</p>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   663
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   664
        <p id="hardwareLimitations">User agents may impose
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   665
        implementation-specific limits on otherwise unconstrained inputs,
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   666
        e.g. to prevent denial of service attacks, to guard against running
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   667
        out of memory, or to work around platform-specific limitations.</p>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   668
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   669
        <p>When a method or an attribute is said to call another method or
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   670
        attribute, the user agent must invoke its internal API for that
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   671
        attribute or method so that e.g. the author can't change the behavior
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   672
        by overriding attributes or methods with custom properties or functions
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   673
        in ECMAScript.</p>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   674
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   675
        <p>Unless otherwise stated, string comparisons are done in a <a title="case-sensitive" class="externalDFN" href="http://www.w3.org/TR/dom/#case-sensitive">
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   676
        case-sensitive</a> manner.</p>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   677
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   678
        <p>If an algorithm calls into another algorithm, any exception that is
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   679
        thrown by the latter (unless it is explicitly caught), must cause the
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   680
        former to terminate, and the exception to be propagated up to
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   681
        <em>its</em> caller.</p>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   682
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   683
        <section id="dependencies">
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   684
            <h3 id="h3_dependencies" role="heading" aria-level="2"><span class="secno">1.1 </span>Dependencies</h3>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   685
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   686
            <p>The IDL fragments in this specification must be interpreted as
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   687
            required for conforming IDL fragments, as described in the Web IDL
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   688
            specification. [<cite><a class="bibref" href="#bib-WEBIDL">WEBIDL</a></cite>]</p>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   689
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   690
            <p>Some of the terms used in this specification are defined in
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   691
            [<cite><a class="bibref" href="#bib-DOM4">DOM4</a></cite>], [<cite><a class="bibref" href="#bib-HTML5">HTML5</a></cite>], and [<cite><a class="bibref" href="#bib-XML10">XML10</a></cite>].
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   692
        </p></section>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   693
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   694
        <section id="extensibility">
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   695
            <h3 id="h3_extensibility" role="heading" aria-level="2"><span class="secno">1.2 </span>Extensibility</h3>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   696
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   697
            <p>Vendor-specific proprietary extensions to this specification are
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   698
            strongly discouraged. Authors must not use such extensions, as
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   699
            doing so reduces interoperability and fragments the user base,
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   700
            allowing only users of specific user agents to access the content in
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   701
            question.</p>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   702
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   703
            <p>If vendor-specific extensions are needed, the members should be
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   704
            prefixed by vendor-specific strings to prevent clashes with future
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   705
            versions of this specification. Extensions must be defined so that
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   706
            the use of extensions neither contradicts nor causes the
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   707
            non-conformance of functionality defined in the specification.</p>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   708
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   709
            <p>When vendor-neutral extensions to this specification are needed,
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   710
            either this specification can be updated accordingly, or an
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   711
            extension specification can be written that overrides the
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   712
            requirements in this specification. When someone applying this
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   713
            specification to their activities decides that they will recognise
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   714
            the requirements of such an extension specification, it becomes an
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   715
            <dfn title="other applicable specifications" id="dfn-other-applicable-specifications">applicable
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   716
            specification</dfn> for the purposes of conformance requirements in
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   717
            this specification.</p>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   718
            <!-- http://www.w3.org/mid/17E341CD-E790-422C-9F9A-69347EE01CEB@iki.fi -->
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   719
        </section>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   720
    </section>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   721
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   722
    <section id="terminology">
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   723
        <!--OddPage--><h2 id="h2_terminology" role="heading" aria-level="1"><span class="secno">2. </span>Terminology</h2>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   724
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   725
        <p>The term <dfn id="dfn-context-object">context object</dfn> means the object on which the method or
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   726
        attribute being discussed was called.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   727
    </p></section>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   728
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   729
    <section id="namespaces">
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   730
        <!--OddPage--><h2 id="h2_namespaces" role="heading" aria-level="1"><span class="secno">3. </span>Namespaces</h2>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   731
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   732
        <p>The <dfn title="html-ns" id="dfn-html-ns">HTML namespace</dfn> is <code>http://www.w3.org/1999/xhtml</code>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   733
        <p>The <dfn title="xml-ns" id="dfn-xml-ns">XML namespace</dfn> is <code>http://www.w3.org/XML/1998/namespace</code>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   734
        <p>The <dfn title="xmlns-ns" id="dfn-xmlns-ns">XMLNS namespace</dfn> is <code>http://www.w3.org/2000/xmlns/</code>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   735
    </p></section>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   736
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   737
    <section id="parsing-and-serializing-nodes">
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   738
        <!--OddPage--><h2 id="h2_parsing-and-serializing-nodes" role="heading" aria-level="1"><span class="secno">4. </span>Parsing and serializing <a title="node" class="externalDFN" href="http://www.w3.org/TR/dom/#node">Node</a>s</h2>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   739
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   740
        <section id="parsing">
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   741
            <h3 id="h3_parsing" role="heading" aria-level="2"><span class="secno">4.1 </span>Parsing</h3>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   742
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   743
            <p>The following steps form the
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   744
            <dfn title="concept-parse-fragment" id="dfn-concept-parse-fragment">fragment parsing algorithm</dfn>, whose
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   745
            arguments are a <var>markup</var> string and a
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   746
            <var>context element</var>:
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   747
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   748
            <ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   749
              <li>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   750
                <p>If the <var>context element</var>'s
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   751
                <a title="concept-node-document" class="externalDFN" href="http://www.w3.org/TR/dom/#concept-node-document">node document</a>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   752
                is an <a title="html-document" class="externalDFN" href="http://www.w3.org/TR/dom/#html-document">HTML document</a>: let
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   753
                <var>algorithm</var> be the
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   754
                <a title="html-fragment-parsing-algorithm" class="externalDFN" href="http://www.w3.org/TR/html5/single-page.html#html-fragment-parsing-algorithm">HTML
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   755
                fragment parsing algorithm</a>.</p>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   756
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   757
                <p>If the <var>context element</var>'s
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   758
                <a title="concept-node-document" class="externalDFN" href="http://www.w3.org/TR/dom/#concept-node-document">node document</a>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   759
                is an <a title="xml-document" class="externalDFN" href="http://www.w3.org/TR/dom/#xml-document">XML document</a>: let
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   760
                <var>algorithm</var> be the
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   761
                <a title="xml-fragment-parsing-algorithm" class="externalDFN" href="http://www.w3.org/TR/html5/single-page.html#xml-fragment-parsing-algorithm">XML
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   762
                fragment parsing algorithm</a>.</p>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   763
              </li>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   764
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   765
              <li>Let <var>new children</var> be the result of invoking <var>algorithm</var> with <var>markup</var> as
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   766
              the <var>input</var>, and <var>context element</var> as the
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   767
              <var><a title="concept-frag-parse-context" class="externalDFN" href="http://www.w3.org/TR/html5/single-page.html#concept-frag-parse-context">context</a></var>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   768
              element.</li>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   769
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   770
              <li>Let <var>fragment</var> be a new
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   771
              <code><a title="documentfragment" class="externalDFN" href="http://www.w3.org/TR/dom/#documentfragment">DocumentFragment</a></code> whose
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   772
              <a title="concept-node-document" class="externalDFN" href="http://www.w3.org/TR/dom/#concept-node-document">node document</a>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   773
              is <var>context element</var>'s
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   774
              <a title="concept-node-document" class="externalDFN" href="http://www.w3.org/TR/dom/#concept-node-document">node document</a>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   775
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   776
              <li><a title="concept-node-append" class="externalDFN" href="http://www.w3.org/TR/dom/#concept-node-append">Append</a>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   777
              each <a title="concept-node" class="externalDFN" href="http://www.w3.org/TR/dom/#concept-node">node</a> in
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   778
              <var>new children</var> to <var>fragment</var>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   779
              (in <a title="concept-tree-order" class="externalDFN" href="http://www.w3.org/TR/dom/#concept-tree-order">tree order</a>).
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   780
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   781
              <div class="note"><div class="note-title" id="h_note_1" role="heading" aria-level="3"><span>Note</span></div><p>This ensures the
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   782
              <a title="concept-node-document" class="externalDFN" href="http://www.w3.org/TR/dom/#concept-node-document">node document</a>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   783
              for the new <a title="concept-node" class="externalDFN" href="http://www.w3.org/TR/dom/#concept-node">nodes</a> is correct.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   784
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   785
              </p></div><li>Return the value of <var>fragment</var>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   786
            </li></ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   787
    </section>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   788
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   789
    <section id="serializing">
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   790
        <h3 id="h3_serializing" role="heading" aria-level="2"><span class="secno">4.2 </span>Serializing</h3>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   791
        <p>The following steps form the
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   792
            <dfn title="concept-fragment-serializing-algorithm" id="dfn-concept-fragment-serializing-algorithm">fragment serializing algorithm</dfn>,
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   793
            whose arguments are a <code><a title="node" class="externalDFN" href="http://www.w3.org/TR/dom/#node">Node</a></code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   794
            <var>node</var> and a flag <dfn title="concept-well-formed" id="dfn-concept-well-formed">require well-formed</dfn>:
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   795
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   796
        <ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   797
            <li>Let <var>context document</var> be the value of <var>node</var>'s
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   798
                <a title="concept-node-document" class="externalDFN" href="http://www.w3.org/TR/dom/#concept-node-document">node document</a>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   799
            <li>If <var>context document</var> is an
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   800
                <a title="html-document" class="externalDFN" href="http://www.w3.org/TR/dom/#html-document">HTML document</a>,
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   801
                return an <a title="concept-serialize-html" class="internalDFN" href="#dfn-concept-serialize-html">HTML serialization</a> of <var>node</var>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   802
            <li>Otherwise, <var>context document</var> is an
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   803
                <a title="xml-document" class="externalDFN" href="http://www.w3.org/TR/dom/#xml-document">XML document</a>;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   804
                return an <a title="concept-serialize-xml" class="internalDFN" href="#dfn-concept-serialize-xml">XML serialization</a> of <var>node</var>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   805
                passing the flag <var>require well-formed</var>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   806
            <div class="note"><div class="note-title" id="h_note_2" role="heading" aria-level="3"><span>Note</span></div><p>The <a title="concept-serialize-xml" class="internalDFN" href="#dfn-concept-serialize-xml">XML serialization</a> defined in this document
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   807
                conforms to the requirements of the <a title="xml-fragment-serialization-algorithm" class="externalDFN" href="http://www.w3.org/TR/html5/single-page.html#xml-fragment-serialization-algorithm">XML fragment serialization algorithm</a> defined in [<cite><a class="bibref" href="#bib-HTML5">HTML5</a></cite>].</p></div>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   808
        </li></ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   809
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   810
        <p>To produce an <dfn title="concept-serialize-html" id="dfn-concept-serialize-html">HTML serialization</dfn> of a
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   811
            <code><a title="node" class="externalDFN" href="http://www.w3.org/TR/dom/#node">Node</a></code> <var>node</var>, the user agent
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   812
            must run the
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   813
            <a title="html-fragment-serialization-algorithm" class="externalDFN" href="http://www.w3.org/TR/html5/single-page.html#html-fragment-serialization-algorithm">HTML
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   814
            fragment serialization algorithm</a> [<cite><a class="bibref" href="#bib-HTML5">HTML5</a></cite>] on <var>node</var> and return the string produced.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   815
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   816
        <p>To produce an <dfn title="concept-serialize-xml" id="dfn-concept-serialize-xml">XML serialization</dfn> of a
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   817
            <code><a title="node" class="externalDFN" href="http://www.w3.org/TR/dom/#node">Node</a></code> <var>node</var> given a
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   818
            flag <var>require well-formed</var>, run the following steps:
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   819
        <ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   820
            <li>Let <dfn title="concept-context-namespace" id="dfn-concept-context-namespace">context namespace</dfn> be <code>null</code>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   821
                The <a title="concept-context-namespace" class="internalDFN" href="#dfn-concept-context-namespace">context namespace</a> is changed when a
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   822
                <var>node</var> serializes a different default namespace definition from its parent. The
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   823
                algorithm assumes no namespace to start.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   824
            <li>Let <dfn title="concept-namespace-prefix-map" id="dfn-concept-namespace-prefix-map">namespace prefix map</dfn> be a new map
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   825
                for associating <code>namespaceURI</code> and namespace <code>prefix</code> pairs, where
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   826
                <code>namespaceURI</code> values are the map's keys, and <code>prefix</code> values are
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   827
                the map's key values. The <a title="concept-namespace-prefix-map" class="internalDFN" href="#dfn-concept-namespace-prefix-map">namespace prefix map</a>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   828
                will be populated by previously seen namespaceURIs and their most recent prefix associations
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   829
                for a subtree. <span class="note"><strong>Note:</strong> the
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   830
                <a title="concept-namespace-prefix-map" class="internalDFN" href="#dfn-concept-namespace-prefix-map">namespace prefix map</a> only associates a single
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   831
                prefix value with a given namespaceURI. During serialization, if different namespace prefixes
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   832
                are found that map to the same namespaceURI, the last one encountered "wins" by replacing the
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   833
                existing key value in the map with the new prefix value.</span>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   834
            <li>Initialize the <a title="concept-namespace-prefix-map" class="internalDFN" href="#dfn-concept-namespace-prefix-map">namespace prefix map</a> with the
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   835
                <a title="xml-ns" class="internalDFN" href="#dfn-xml-ns">XML namespace</a> key and string "<code>xml</code>" as the key value.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   836
            <li>Let <dfn title="concept-generated-prefix" id="dfn-concept-generated-prefix">generated namespace prefix index</dfn> be an integer
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   837
                with a value of <code>1</code>. The <a title="concept-generated-prefix" class="internalDFN" href="#dfn-concept-generated-prefix">generated namespace
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   838
                prefix index</a> is used to generate a new unique prefix value when no suitable existing
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   839
                namespace prefix is available to serialize a <var>node</var>'s namespaceURI (or the namespaceURI
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   840
                of one of <var>node</var>'s attributes). <span class="note">See the
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   841
                <a title="concept-generate-prefix" class="internalDFN" href="#dfn-concept-generate-prefix">generate a prefix</a> algorithm.</span>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   842
            <li>Return the result of running the <a title="concept-xml-serialization-algorithm" class="internalDFN" href="#dfn-concept-xml-serialization-algorithm">XML serialization
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   843
                algorithm</a> on <var>node</var> passing the <a title="concept-context-namespace" class="internalDFN" href="#dfn-concept-context-namespace">context
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   844
                namespace</a>, <a title="concept-namespace-prefix-map" class="internalDFN" href="#dfn-concept-namespace-prefix-map">namespace prefix map</a>,
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   845
                <a title="concept-generated-prefix" class="internalDFN" href="#dfn-concept-generated-prefix">generated namespace prefix index</a> reference, and the
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   846
                flag <var>require well-formed</var>. If an <dfn title="concept-algorithm-exception" id="dfn-concept-algorithm-exception">exception</dfn>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   847
                occurs during the execution of the algorithm, then catch that exception and throw a
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   848
                <code><a title="domexception" class="externalDFN" href="http://www.w3.org/TR/dom/#domexception">DOMException</a></code> with
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   849
                name "<code><a title="invalidstateerror" class="externalDFN" href="http://www.w3.org/TR/dom/#invalidstateerror">InvalidStateError</a></code>".
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   850
        </li></ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   851
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   852
        <p>An <a title="concept-serialize-xml" class="internalDFN" href="#dfn-concept-serialize-xml">XML serialization</a> differs from an
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   853
            <a title="concept-serialize-html" class="internalDFN" href="#dfn-concept-serialize-html">HTML serialization</a> in the following ways:
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   854
        <ul>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   855
            <li><a title="element" class="externalDFN" href="http://www.w3.org/TR/dom/#element">Elements</a> and
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   856
                <a title="concept-attribute" class="externalDFN" href="http://www.w3.org/TR/dom/#concept-attribute">attributes</a>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   857
                will always be serialized such that their namespaceURI is preserved. In some cases
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   858
                this means that an existing prefix, prefix declaration attribute or default namespace
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   859
                declaration attribute might be dropped, substituted or changed.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   860
                An <a title="concept-serialize-html" class="internalDFN" href="#dfn-concept-serialize-html">HTML serialization</a> does not attempt to
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   861
                preserve the namespaceURI.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   862
            <li><a title="element" class="externalDFN" href="http://www.w3.org/TR/dom/#element">Elements</a> not in the
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   863
                <a title="html-ns" class="internalDFN" href="#dfn-html-ns">HTML namespace</a> containing no <a title="concept-tree-child" class="externalDFN" href="http://www.w3.org/TR/dom/#concept-tree-child">children</a>, are serialized using
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   864
                the self-closing tag syntax (i.e., according to the <code>EmptyElemTag</code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   865
                production of [<cite><a class="bibref" href="#bib-XML10">XML10</a></cite>]).
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   866
        </li></ul>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   867
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   868
        <p>Otherwise, the algorithm for producing an <a title="concept-serialize-xml" class="internalDFN" href="#dfn-concept-serialize-xml">XML serialization</a>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   869
            is designed to produce a serialization that is compatible with the
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   870
            <a title="html-parser" class="externalDFN" href="http://www.w3.org/TR/html5/single-page.html#html-parser">HTML parser</a>. For example,
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   871
            elements in the <a title="html-ns" class="internalDFN" href="#dfn-html-ns">HTML namespace</a>closing tag syntax [<cite><a class="bibref" href="#bib-XML10">XML10</a></cite>].
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   872
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   873
        <div class="note"><div class="note-title" id="h_note_3" role="heading" aria-level="3"><span>Note</span></div><p>Per [<cite><a class="bibref" href="#bib-DOM4">DOM4</a></cite>], <code><a title="interface-attr" class="externalDFN" href="http://www.w3.org/TR/dom/#interface-attr">Attr</a></code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   874
            objects do not inherit from <code><a title="node" class="externalDFN" href="http://www.w3.org/TR/dom/#node">Node</a></code>, and thus cannot
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   875
            be serialized by the <a title="concept-xml-serialization-algorithm" class="internalDFN" href="#dfn-concept-xml-serialization-algorithm">XML serialization algorithm</a>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   876
            An attempt to serialize an <code><a title="interface-attr" class="externalDFN" href="http://www.w3.org/TR/dom/#interface-attr">Attr</a></code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   877
            object will result in a <code>TypeError</code> exception [<cite><a class="bibref" href="#bib-WEBIDL">WEBIDL</a></cite>].
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   878
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   879
        </p></div><p>To run the <dfn title="concept-xml-serialization-algorithm" id="dfn-concept-xml-serialization-algorithm">XML serialization algorithm</dfn> on
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   880
            a <var>node</var> given a <a title="concept-context-namespace" class="internalDFN" href="#dfn-concept-context-namespace">context namespace</a>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   881
            <var>namespace</var>, a <a title="concept-namespace-prefix-map" class="internalDFN" href="#dfn-concept-namespace-prefix-map">namespace prefix map</a>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   882
            <var>prefix map</var>, a <a title="concept-generated-prefix" class="internalDFN" href="#dfn-concept-generated-prefix">generated namespace prefix index</a>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   883
            <var>prefix index</var>, and a flag <var>require well-formed</var>, the user agent must run the
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   884
            appropriate steps, depending on <var>node</var>'s interface:</p>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   885
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   886
        <dl class="switch">
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   887
            <dt><code><a title="interface-element" class="externalDFN" href="http://www.w3.org/TR/dom/#interface-element">Element</a></code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   888
            <dd>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   889
                <p>Run the following algorithm:
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   890
                <ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   891
                    <!-- "namespace" was passed via the caller, it's the default namespace scope -->
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   892
                    <!-- "prefix map" was passed via the caller, it's the namespace->prefix map -->
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   893
                    <!-- "prefix index" was passed via the caller, it's a number for generating prefixes if necessary -->
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   894
                    <!-- "require well-formed" was passed via the caller, it's a flag (true/false) for whether certain validation steps should be taken during serialization. -->
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   895
                    <li>If the <a title="concept-well-formed" class="internalDFN" href="#dfn-concept-well-formed">require well-formed</a> flag is set (its value is
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   896
                        <code>true</code>), and this <var>node</var>'s
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   897
                        <code><a title="dom-element-localname" class="externalDFN" href="http://www.w3.org/TR/dom/#dom-element-localname">localName</a></code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   898
                        attribute contains the character "<code>:</code>" (U+003A COLON) or does not match the
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   899
                        XML <code>Name</code> production [<cite><a class="bibref" href="#bib-XML10">XML10</a></cite>], then <a title="concept-algorithm-exception" class="internalDFN" href="#dfn-concept-algorithm-exception">throw an
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   900
                        exception</a>; the serialization of this <var>node</var> would not be a well-formed element.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   901
                    <li>Let <var>markup</var> be the string "<code>&lt;</code>" (U+003C LESS-THAN SIGN).
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   902
                    <li>Let <var>qualified name</var> be an empty string.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   903
                    <li>Let a <var>skip end tag</var> flag have the value <code>false</code>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   904
                    <li>Let an <var>ignore namespace definition attribute</var> flag have the value <code>false</code>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   905
                    <li>Let <var>map</var> be a copy of the <var>prefix map</var>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   906
                    <li>Let <var>element prefixes list</var> be an empty list. <span class="note">This list is
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   907
                        local to each element. Its purpose is to ensure that there are no conflicting prefixes
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   908
                        should a new namespace prefix attribute need to be generated.</span>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   909
                    <li>Let <var>duplicate prefix definition</var> be <code>null</code>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   910
                    <li>Let <var>local default namespace</var> be the result of
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   911
                        <a title="concept-record-namespace-info" class="internalDFN" href="#dfn-concept-record-namespace-info">recording the namespace information</a> for
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   912
                        <var>node</var> given <var>map</var>, <var>element prefixes list</var>, and
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   913
                        <var>duplicate prefix definition</var>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   914
                    <div class="note"><div class="note-title" id="h_note_4" role="heading" aria-level="3"><span>Note</span></div><p>This above step will update the <var>map</var> with any found namespace prefix
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   915
                        definitions, add the found prefix definitions to the <var>element prefixes list</var>, optionally
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   916
                        set the <var>duplicate prefix definition</var> value, and return a local default namespace
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   917
                        value defined by a default namespace attribute if one exists. Otherwise it returns
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   918
                        <code>null</code>.</p></div>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   919
                    <li>Let <var>inherited ns</var> be a copy of <var>namespace</var>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   920
                    <li>Let <var>ns</var> be the value of <var>node</var>'s
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   921
                        <code><a title="dom-element-namespaceuri" class="externalDFN" href="http://www.w3.org/TR/dom/#dom-element-namespaceuri">namespaceURI</a></code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   922
                        attribute.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   923
                    <li>If <var>inherited ns</var> is equal to <var>ns</var>, then:
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   924
                    <ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   925
                        <li>If <var>local default namespace</var> is not <code>null</code>, then set <var>ignore
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   926
                            namespace definition attribute</var> to <code>true</code>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   927
                        <li>If <var>ns</var> is the <a title="xml-ns" class="internalDFN" href="#dfn-xml-ns">XML namespace</a>, then let <var>qualified name</var>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   928
                            be the concatenation of the string "<code>xml:</code>" and the value of <var>node</var>'s
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   929
                            <code><a title="dom-element-localname" class="externalDFN" href="http://www.w3.org/TR/dom/#dom-element-localname">localName</a></code>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   930
                        <li>Otherwise, let <var>qualified name</var> be the value of <var>node</var>'s
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   931
                            <code><a title="dom-element-localname" class="externalDFN" href="http://www.w3.org/TR/dom/#dom-element-localname">localName</a></code>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   932
                            <span class="note">The <var>node</var>'s prefix is always dropped.</span>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   933
                        <li>Append the value of <var>qualified name</var> to <var>markup</var>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   934
                    </li></ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   935
                    <li>Otherwise, <var>inherited ns</var> is not equal to <var>ns</var> (the <var>node</var>'s
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   936
                        own namespace is different from the context namespace of its parent). Run these sub-steps:
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   937
                    <!-- The serialization algorithm must differentiate this node's namespace from it's parent's default
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   938
                        namespace. There are two ways to do this: (1) [preferred due to assumed minimum length] use a
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   939
                        namespace prefix if one is available or (2) use a default namespace declaration. Both cases can
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   940
                        run into conflicts with existing attributes on the element and are handled accordingly. -->
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   941
                    <ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   942
                        <li>Let <var>prefix</var> be the value of <var>node</var>'s
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   943
                            <code><a title="dom-element-prefix" class="externalDFN" href="http://www.w3.org/TR/dom/#dom-element-prefix">prefix</a></code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   944
                            attribute.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   945
                        <li>Let <var>candidate prefix</var> be a value from <var>map</var> where there exists a key in
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   946
                            <var>map</var> that matches the value of <var>ns</var> or if there is no such key, then let
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   947
                            <var>candidate prefix</var> be <code>null</code>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   948
                        <!-- Found a suitable prefix to use, either locally, or inherited through a parent node that
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   949
                            matches the node's namespaceURI. This prefix will be used in serialization even if the node
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   950
                            doesn't have a real prefix. -->
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   951
                        <li>If <var>candidate prefix</var> is not <code>null</code> (a suitable namespace prefix is defined
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   952
                            which maps to <var>ns</var>), then:
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   953
                        <ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   954
                            <li>Let <var>qualified name</var> be the concatenation of <var>candidate prefix</var>,
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   955
                                "<code>:</code>" (U+003A COLON), and <var>node</var>'s <code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   956
                                <a title="dom-element-localname" class="externalDFN" href="http://www.w3.org/TR/dom/#dom-element-localname">localName</a></code>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   957
                                <span class="note">There exists on this <var>node</var> or the <var>node</var>'s ancestry a
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   958
                                namespace prefix definition that defines the <var>node</var>'s namespace.</span>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   959
                            <li>If <var>local default namespace</var> is not <code>null</code> (there exists a locally-defined
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   960
                                default namespace declaration attribute), then let <var>inherited ns</var> get the value of
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   961
                                <var>ns</var>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   962
                            <li>Append the value of <var>qualified name</var> to <var>markup</var>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   963
                        </li></ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   964
                        <!-- Now there's no existing namespace->prefix mapping to override; try to use a prefix: -->
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   965
                        <li>Otherwise, if <var>prefix</var> is not <code>null</code> and <var>local default namespace</var> is
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   966
                            <code>null</code>, then:
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   967
                        <ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   968
                            <li>If the <var>element prefixes list</var> contains the value of <var>prefix</var>, then
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   969
                                let <var>prefix</var> be the result of
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   970
                                <a title="concept-generate-prefix" class="internalDFN" href="#dfn-concept-generate-prefix">generating a prefix</a> providing as input the
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   971
                                <a title="concept-namespace-prefix-map" class="internalDFN" href="#dfn-concept-namespace-prefix-map">namespace prefix map</a> <var>map</var>,
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   972
                                <var>node</var>'s <var>ns</var> string, and the <var>prefix index</var> integer.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   973
                            <li>Otherwise, append to <var>map</var> a new key <var>ns</var> whose key value is
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   974
                                <var>prefix</var>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   975
                            <!-- Prefix is now either real or generated, and added to the map. -->
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   976
                            <li>Let <var>qualified name</var> be the concatenation
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   977
                            of <var>prefix</var>, "<code>:</code>" (U+003A COLON), and <var>node</var>'s
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   978
                            <code><a title="dom-element-localname" class="externalDFN" href="http://www.w3.org/TR/dom/#dom-element-localname">localName</a></code>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   979
                            <li>Append the value of <var>qualified name</var> to <var>markup</var>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   980
                            <li>Append the following to <var>markup</var>, in the order listed: <span class="note">The following
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   981
                                serializes the new namespace/prefix association just added to the <var>map</var>.</span>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   982
                            <ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   983
                                <li>"<code> </code>" (U+0020 SPACE);
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   984
                                <li>The string "<code>xmlns:</code>";
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   985
                                <li>The value of <var>prefix</var>;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   986
                                <li>"<code>="</code>" (U+003D EQUALS SIGN, U+0022 QUOTATION MARK);
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   987
                                <li>The result of <a title="concept-serialize-attr-value" class="internalDFN" href="#dfn-concept-serialize-attr-value">serializing an attribute value</a>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   988
                                    given <var>ns</var> and the <a title="concept-well-formed" class="internalDFN" href="#dfn-concept-well-formed">require well-formed</a> flag
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   989
                                    as input;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   990
                                <li>"<code>"</code>" (U+0022 QUOTATION MARK).
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   991
                            </li></ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   992
                        </li></ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   993
                        <!-- Giving up on the prefix route, try to use a default namespace instead (stomping on an existing
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   994
                             one if necessary) and dropping the node's prefix -->
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   995
                        <li>Otherwise, if <var>local default namespace</var> is <code>null</code>, or <var>local default
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   996
                            namespace</var> is not <code>null</code> and its value is not equal to <var>ns</var>, then:
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   997
                        <ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   998
                            <li>Set the <var>ignore namespace definition attribute</var> flag to <code>true</code>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
   999
                            <li>Let <var>qualified name</var> be the value of <var>node</var>'s <code><a title="dom-element-localname" class="externalDFN" href="http://www.w3.org/TR/dom/#dom-element-localname">localName</a></code>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1000
                            <li>Let the value of <var>inherited ns</var> be <var>ns</var>. <span class="note">The new
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1001
                                default namespace will be used in the serialization to define this <var>node</var>'s
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1002
                                namespace and act as the context namespace for its <a title="concept-tree-child" class="externalDFN" href="http://www.w3.org/TR/dom/#concept-tree-child">children</a>.</span>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1003
                            <li>Append the value of <var>qualified name</var> to <var>markup</var>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1004
                            <li>Append the following to <var>markup</var>, in the order listed: <span class="note">The following
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1005
                                serializes the new (or replacement) default namespace definition.</span>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1006
                            <ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1007
                                <li>"<code> </code>" (U+0020 SPACE);
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1008
                                <li>The string "<code>xmlns</code>";
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1009
                                <li>"<code>="</code>" (U+003D EQUALS SIGN, U+0022 QUOTATION MARK);
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1010
                                <li>The result of <a title="concept-serialize-attr-value" class="internalDFN" href="#dfn-concept-serialize-attr-value">serializing an attribute value</a>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1011
                                    given <var>ns</var> and the <a title="concept-well-formed" class="internalDFN" href="#dfn-concept-well-formed">require well-formed</a> flag
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1012
                                    as input;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1013
                                <li>"<code>"</code>" (U+0022 QUOTATION MARK).
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1014
                            </li></ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1015
                        </li></ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1016
                        <!-- Finally, regardless of prefix, the node has a local default namespace that matches 'ns'.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1017
                            So, we'll just use that and drop the prefix -->
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1018
                        <li>Otherwise, the <var>node</var> has a <var>local default namespace</var> that matches
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1019
                            <var>ns</var>. Let <var>qualified name</var> be the value of <var>node</var>'s
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1020
                            <code><a title="dom-element-localname" class="externalDFN" href="http://www.w3.org/TR/dom/#dom-element-localname">localName</a></code>,
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1021
                            let the value of <var>inherited ns</var> be <var>ns</var>, and append the value of
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1022
                            <var>qualified name</var> to <var>markup</var>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1023
                    </li></ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1024
                    <li>Append to <var>markup</var> the result of the
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1025
                        <a title="concept-serialize-xml-attributes" class="internalDFN" href="#dfn-concept-serialize-xml-attributes">XML serialization of <var>node</var>'s
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1026
                        attributes</a> given the
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1027
                        <a title="concept-namespace-prefix-map" class="internalDFN" href="#dfn-concept-namespace-prefix-map">namespace prefix map</a> <var>map</var>,
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1028
                        the <a title="concept-generated-prefix" class="internalDFN" href="#dfn-concept-generated-prefix">generated prefix index</a> <var>prefix index</var>, the
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1029
                        flag <var>ignore namespace definition attribute</var> and the value of <var>duplicate
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1030
                        prefix definition</var>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1031
                    <li>If <var>ns</var> is the <a title="html-ns" class="internalDFN" href="#dfn-html-ns">HTML namespace</a>,
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1032
                        and the <var>node</var>'s list of
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1033
                        <a title="concept-tree-child" class="externalDFN" href="http://www.w3.org/TR/dom/#concept-tree-child">children</a>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1034
                        is empty, and the <var>node</var>'s
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1035
                        <code><a title="dom-element-localname" class="externalDFN" href="http://www.w3.org/TR/dom/#dom-element-localname">localName</a></code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1036
                        matches any one of the following
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1037
                        <a title="void-elements" class="externalDFN" href="http://www.w3.org/TR/html5/single-page.html#void-elements">void elements</a>:
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1038
                        "<code>area</code>",
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1039
                        "<code>base</code>",
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1040
                        "<code>basefont</code>",
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1041
                        "<code>bgsound</code>",
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1042
                        "<code>br</code>",
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1043
                        "<code>col</code>",
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1044
                        "<code>embed</code>",
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1045
                        "<code>frame</code>",
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1046
                        "<code>hr</code>",
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1047
                        "<code>img</code>",
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1048
                        "<code>input</code>",
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1049
                        "<code>keygen</code>",
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1050
                        "<code>link</code>",
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1051
                        "<code>menuitem</code>",
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1052
                        "<code>meta</code>",
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1053
                        "<code>param</code>",
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1054
                        "<code>source</code>",
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1055
                        "<code>track</code>",
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1056
                        "<code>wbr</code>";
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1057
                        then append the following to <var>markup</var>, in the order listed:
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1058
                        <ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1059
                            <li>"<code> </code>" (U+0020 SPACE);
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1060
                            <li>"<code>/</code>" (U+002F SOLIDUS).
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1061
                        </li></ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1062
                        and set the <var>skip end tag</var> flag to <code>true</code>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1063
                    <li>If <var>ns</var> is not the <a title="html-ns" class="internalDFN" href="#dfn-html-ns">HTML namespace</a>,
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1064
                        and the <var>node</var>'s list of
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1065
                        <a title="concept-tree-child" class="externalDFN" href="http://www.w3.org/TR/dom/#concept-tree-child">children</a>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1066
                        is empty, then append "<code>/</code>" (U+002F SOLIDUS) to <var>markup</var>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1067
                        and set the <var>skip end tag</var> flag to <code>true</code>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1068
                    <li>Append "<code>&gt;</code>" (U+003E GREATER-THAN SIGN) to <var>markup</var>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1069
                    <li>If the value of <var>skip end tag</var> is <code>true</code>, then return
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1070
                        the value of <var>markup</var> and skip the remaining steps. The
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1071
                        <var>node</var> is a leaf-node.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1072
                    <li>If <var>ns</var> is the <a title="html-ns" class="internalDFN" href="#dfn-html-ns">HTML namespace</a>, and the <var>node</var>'s
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1073
                        <code><a title="dom-element-localname" class="externalDFN" href="http://www.w3.org/TR/dom/#dom-element-localname">localName</a></code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1074
                        matches the string "<code>template</code>", then this is a
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1075
                        <code><a title="the-template-element" class="externalDFN" href="http://www.w3.org/TR/html5/single-page.html#the-template-element">template</a></code> element.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1076
                        Append to <var>markup</var> the result of running the
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1077
                        <a title="concept-xml-serialization-algorithm" class="internalDFN" href="#dfn-concept-xml-serialization-algorithm">XML serialization algorithm</a> on the
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1078
                        <a title="the-template-element" class="externalDFN" href="http://www.w3.org/TR/html5/single-page.html#the-template-element">template</a> element's
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1079
                        <a title="template-contents" class="externalDFN" href="http://www.w3.org/TR/html5/single-page.html#template-contents">template contents</a>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1080
                        (a <code><a title="interface-documentfragment" class="externalDFN" href="http://www.w3.org/TR/dom/#interface-documentfragment">DocumentFragment</a></code>),
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1081
                        providing the value of <var>inherited ns</var> for the
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1082
                        <a title="concept-context-namespace" class="internalDFN" href="#dfn-concept-context-namespace">context namespace</a>,
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1083
                        <var>map</var> for the <a title="concept-namespace-prefix-map" class="internalDFN" href="#dfn-concept-namespace-prefix-map">namespace prefix map</a>,
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1084
                        <var>prefix index</var> for the
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1085
                        <a title="concept-generated-prefix" class="internalDFN" href="#dfn-concept-generated-prefix">generated namespace prefix index</a>, and the value
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1086
                        of the <var>require well-formed</var> flag. <span class="note">This allows
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1087
                        <a title="template-contents" class="externalDFN" href="http://www.w3.org/TR/html5/single-page.html#template-contents">template content</a> to
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1088
                        round-trip , given the rules for
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1089
                        <a title="parsing-xhtml-documents" class="externalDFN" href="http://www.w3.org/TR/html5/single-page.html#parsing-xhtml-documents">parsing XHTML documents</a>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1090
                        [<cite><a class="bibref" href="#bib-HTML5">HTML5</a></cite>].</span>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1091
                    <li>Otherwise, append to <var>markup</var> the result of running the
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1092
                        <a title="concept-xml-serialization-algorithm" class="internalDFN" href="#dfn-concept-xml-serialization-algorithm">XML serialization algorithm</a> on each
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1093
                        of <var>node</var>'s
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1094
                        <a title="concept-tree-child" class="externalDFN" href="http://www.w3.org/TR/dom/#concept-tree-child">children</a>,
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1095
                        in <a title="concept-tree-order" class="externalDFN" href="http://www.w3.org/TR/dom/#concept-tree-order">tree order</a>,
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1096
                        providing the value of <var>inherited ns</var> for the
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1097
                        <a title="concept-context-namespace" class="internalDFN" href="#dfn-concept-context-namespace">context namespace</a>,
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1098
                        <var>map</var> for the <a title="concept-namespace-prefix-map" class="internalDFN" href="#dfn-concept-namespace-prefix-map">namespace prefix map</a>,
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1099
                        <var>prefix index</var> for the
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1100
                        <a title="concept-generated-prefix" class="internalDFN" href="#dfn-concept-generated-prefix">generated namespace prefix index</a>, and the value
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1101
                        of the <var>require well-formed</var> flag.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1102
                    <li>Append the following to <var>markup</var>, in the order listed:
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1103
                        <ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1104
                            <li>"<code>&lt;/</code>" (U+003C LESS-THAN SIGN, U+002F SOLIDUS);
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1105
                            <li>The value of <var>qualified name</var>;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1106
                            <li>"<code>&gt;</code>" (U+003E GREATER-THAN SIGN).
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1107
                        </li></ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1108
                    <li>Return the value of <var>markup</var>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1109
                </li></ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1110
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1111
            <dt><code><a title="interface-document" class="externalDFN" href="http://www.w3.org/TR/dom/#interface-document">Document</a></code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1112
            <dd>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1113
                <p>If the <a title="concept-well-formed" class="internalDFN" href="#dfn-concept-well-formed">require well-formed</a> flag is set (its value is
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1114
                    <code>true</code>), and this <var>node</var> has no
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1115
                    <code><a title="dom-document-documentelement" class="externalDFN" href="http://www.w3.org/TR/dom/#dom-document-documentelement">documentElement</a></code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1116
                    (the <code><a title="dom-document-documentelement" class="externalDFN" href="http://www.w3.org/TR/dom/#dom-document-documentelement">documentElement</a></code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1117
                    attribute's value is <code>null</code>), then <a title="concept-algorithm-exception" class="internalDFN" href="#dfn-concept-algorithm-exception">throw an
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1118
                    exception</a>; the serialization of this <var>node</var> would not be a well-formed document.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1119
                <p>Otherwise, run the following steps:
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1120
                <ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1121
                    <li>Let <var>serialized document</var> be an empty string.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1122
                    <li>Append to <var>serialized document</var> the string produced by running the steps to
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1123
                        <a title="concept-serialize-doctype" class="internalDFN" href="#dfn-concept-serialize-doctype">produce a DocumentType serialization</a>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1124
                        of <var>node</var>'s
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1125
                        <code><a title="dom-document-doctype" class="externalDFN" href="http://www.w3.org/TR/dom/#dom-document-doctype">doctype</a></code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1126
                        attribute provided the <var>require well-formed</var> flag if <var>node</var>'s
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1127
                        <code><a title="dom-document-doctype" class="externalDFN" href="http://www.w3.org/TR/dom/#dom-document-doctype">doctype</a></code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1128
                        attribute is not <code>null</code>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1129
                    <li>For each <a title="concept-tree-child" class="externalDFN" href="http://www.w3.org/TR/dom/#concept-tree-child">child</a>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1130
                        <var>child</var> of <var>node</var>, in
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1131
                        <a title="concept-tree-order" class="externalDFN" href="http://www.w3.org/TR/dom/#concept-tree-order">tree order</a>, run the
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1132
                        <a title="concept-xml-serialization-algorithm" class="internalDFN" href="#dfn-concept-xml-serialization-algorithm">XML serialization algorithm</a>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1133
                        on the <var>child</var> given a <a title="concept-context-namespace" class="internalDFN" href="#dfn-concept-context-namespace">context namespace</a>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1134
                        <var>namespace</var>, a <a title="concept-namespace-prefix-map" class="internalDFN" href="#dfn-concept-namespace-prefix-map">namespace prefix map</a>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1135
                        <var>prefix map</var>, a reference to a <a title="concept-generated-prefix" class="internalDFN" href="#dfn-concept-generated-prefix">generated
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1136
                        namespace prefix index</a> <var>prefix index</var>, flag <var>require well-formed</var>, and
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1137
                        append the result to <var>serialized document</var>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1138
                    <li>Return the value of <var>serialized document</var>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1139
                </li></ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1140
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1141
            <dt><code><a title="interface-comment" class="externalDFN" href="http://www.w3.org/TR/dom/#interface-comment">Comment</a></code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1142
            <dd>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1143
                <p>If the <a title="concept-well-formed" class="internalDFN" href="#dfn-concept-well-formed">require well-formed</a> flag is set (its value is
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1144
                    <code>true</code>), and <var>node</var>'s
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1145
                    <code><a title="dom-characterdata-data" class="externalDFN" href="http://www.w3.org/TR/dom/#dom-characterdata-data">data</a></code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1146
                    contains characters that are not matched by the XML <code>Char</code> production [<cite><a class="bibref" href="#bib-XML10">XML10</a></cite>] or
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1147
                    contains "<code>--</code>" (two adjacent U+002D HYPHEN-MINUS characters) or that ends with
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1148
                    a "<code>-</code>" (U+002D HYPHEN-MINUS) character, then
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1149
                    <a title="concept-algorithm-exception" class="internalDFN" href="#dfn-concept-algorithm-exception">throw an exception</a>; the serialization of this
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1150
                    <var>node</var>'s
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1151
                    <code><a title="dom-characterdata-data" class="externalDFN" href="http://www.w3.org/TR/dom/#dom-characterdata-data">data</a></code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1152
                    would not be well-formed.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1153
                <p>Return the concatenation of "<code>&lt;!--</code>", <var>node</var>'s
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1154
                <code><a title="dom-characterdata-data" class="externalDFN" href="http://www.w3.org/TR/dom/#dom-characterdata-data">data</a></code>, and
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1155
                "<code>--&gt;</code>".
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1156
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1157
            <!-- Removing CDATA Serialization steps as this interface type is removed from DOM4:
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1158
            <dt><code><a title="cdata" data-spec="DOML2" class="externalDFN">CDATASection</a></code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1159
            <dd><ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1160
                <li>Let <var>markup</var> be the concatenation of "<code>&lt;![CDATA[</code>",
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1161
                    <var>node</var>'s <code><a title="dom-characterdata-data" data-spec="DOM4"
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1162
                    class="externalDFN">data</a></code>, and "<code>]]></code>".
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1163
                <li>Return the value of <var>markup</var>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1164
              </ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1165
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1166
              <p class=note>CDATASection objects may be created by the historical
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1167
            <code>document.createCDATASection</code> API, or as a result of parsing an
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1168
            <a title="xml-document" data-spec="DOM4" class="externalDFN">XML document</a>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1169
            -->
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1170
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1171
            </p><dt><code><a title="interface-text" class="externalDFN" href="http://www.w3.org/TR/dom/#interface-text">Text</a></code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1172
            <dd><ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1173
                <li>If the <a title="concept-well-formed" class="internalDFN" href="#dfn-concept-well-formed">require well-formed</a> flag is set (its value is
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1174
                    <code>true</code>), and <var>node</var>'s
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1175
                    <code><a title="dom-characterdata-data" class="externalDFN" href="http://www.w3.org/TR/dom/#dom-characterdata-data">data</a></code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1176
                    contains characters that are not matched by the XML <code>Char</code> production [<cite><a class="bibref" href="#bib-XML10">XML10</a></cite>],
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1177
                    then <a title="concept-algorithm-exception" class="internalDFN" href="#dfn-concept-algorithm-exception">throw an exception</a>; the serialization of this
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1178
                    <var>node</var>'s
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1179
                    <code><a title="dom-characterdata-data" class="externalDFN" href="http://www.w3.org/TR/dom/#dom-characterdata-data">data</a></code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1180
                    would not be well-formed.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1181
                <li>Let <var>markup</var> be the value of <var>node</var>'s
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1182
                <code><a title="dom-characterdata-data" class="externalDFN" href="http://www.w3.org/TR/dom/#dom-characterdata-data">data</a></code>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1183
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1184
                <li>Replace any occurrences of "<code>&amp;</code>" in <var>markup</var> by
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1185
                "<code>&amp;amp;</code>".
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1186
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1187
                <li>Replace any occurrences of "<code>&lt;</code>" in <var>markup</var> by
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1188
                "<code>&amp;lt;</code>".
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1189
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1190
                <li>Replace any occurrences of "<code>&gt;</code>" in <var>markup</var> by
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1191
                "<code>&amp;gt;</code>".
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1192
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1193
                <li>Return the value of <var>markup</var>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1194
              </li></ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1195
            <dt><code><a title="interface-documentfragment" class="externalDFN" href="http://www.w3.org/TR/dom/#interface-documentfragment">DocumentFragment</a></code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1196
            <dd><ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1197
                <li>Let <var>markup</var> the empty string.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1198
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1199
                <li>For each <a title="concept-tree-child" class="externalDFN" href="http://www.w3.org/TR/dom/#concept-tree-child">child</a>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1200
                    <var>child</var> of <var>node</var>, in
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1201
                    <a title="concept-tree-order" class="externalDFN" href="http://www.w3.org/TR/dom/#concept-tree-order">tree order</a>,
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1202
                    run the <a title="concept-xml-serialization-algorithm" class="internalDFN" href="#dfn-concept-xml-serialization-algorithm">XML serialization algorithm</a>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1203
                    on the <var>child</var> given
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1204
                    a <a title="concept-context-namespace" class="internalDFN" href="#dfn-concept-context-namespace">context namespace</a> <var>namespace</var>, a
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1205
                    <a title="concept-namespace-prefix-map" class="internalDFN" href="#dfn-concept-namespace-prefix-map">namespace prefix map</a> <var>prefix map</var>,
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1206
                    a reference to a <a title="concept-generated-prefix" class="internalDFN" href="#dfn-concept-generated-prefix">generated namespace prefix index</a>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1207
                    <var>prefix index</var>, and flag <var>require well-formed</var>. Concatenate the result
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1208
                    to <var>markup</var>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1209
                <li>Return the value of <var>markup</var>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1210
              </li></ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1211
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1212
            <dt><code><a title="interface-documenttype" class="externalDFN" href="http://www.w3.org/TR/dom/#interface-documenttype">DocumentType</a></code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1213
            <dd>Run the steps to <a title="concept-serialize-doctype" class="internalDFN" href="#dfn-concept-serialize-doctype">produce a DocumentType
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1214
                serialization</a> of <var>node</var> given the <a title="concept-well-formed" class="internalDFN" href="#dfn-concept-well-formed">require well-formed</a>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1215
                flag, and return the string this produced.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1216
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1217
            <dt><code><a title="interface-processinginstruction" class="externalDFN" href="http://www.w3.org/TR/dom/#interface-processinginstruction">ProcessingInstruction</a></code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1218
            <dd><ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1219
                <li>If the <a title="concept-well-formed" class="internalDFN" href="#dfn-concept-well-formed">require well-formed</a> flag is set (its value is
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1220
                    <code>true</code>), and <var>node</var>'s
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1221
                    <code><a title="dom-processinginstruction-target" class="externalDFN" href="http://www.w3.org/TR/dom/#dom-processinginstruction-target">target</a></code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1222
                    contains a "<code>:</code>" (U+003A COLON) character or is an
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1223
                    <a title="ascii-case-insensitive" class="externalDFN" href="http://www.w3.org/TR/dom/#ascii-case-insensitive">ASCII case-insensitive</a>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1224
                    match for the string "<code>xml</code>", then <a title="concept-algorithm-exception" class="internalDFN" href="#dfn-concept-algorithm-exception">throw an
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1225
                    exception</a>; the serialization of this <var>node</var>'s
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1226
                    <code><a title="dom-processinginstruction-target" class="externalDFN" href="http://www.w3.org/TR/dom/#dom-processinginstruction-target">target</a></code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1227
                    would not be well-formed.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1228
                <li>If the <a title="concept-well-formed" class="internalDFN" href="#dfn-concept-well-formed">require well-formed</a> flag is set (its value is
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1229
                    <code>true</code>), and <var>node</var>'s
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1230
                    <code><a title="dom-characterdata-data" class="externalDFN" href="http://www.w3.org/TR/dom/#dom-characterdata-data">data</a></code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1231
                    contains characters that are not matched by the XML <code>Char</code> production [<cite><a class="bibref" href="#bib-XML10">XML10</a></cite>] or
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1232
                    contains the string "<code>?&gt;</code>" (U+003F QUESTION MARK, U+003E GREATER-THAN SIGN),
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1233
                    then <a title="concept-algorithm-exception" class="internalDFN" href="#dfn-concept-algorithm-exception">throw an exception</a>; the serialization of this
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1234
                    <var>node</var>'s
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1235
                    <code><a title="dom-characterdata-data" class="externalDFN" href="http://www.w3.org/TR/dom/#dom-characterdata-data">data</a></code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1236
                    would not be well-formed.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1237
                <li>Let <var>markup</var> be the concatenation of the following, in the order listed:
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1238
                <ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1239
                    <li>"<code>&lt;?</code>" (U+003C LESS-THAN SIGN, U+003F QUESTION MARK);
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1240
                    <li>The value of <var>node</var>'s <code><a title="dom-processinginstruction-target" class="externalDFN" href="http://www.w3.org/TR/dom/#dom-processinginstruction-target">target</a></code>;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1241
                    <li>"<code> </code>" (U+0020 SPACE);
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1242
                    <li>The value of <var>node</var>'s <code><a title="dom-characterdata-data" class="externalDFN" href="http://www.w3.org/TR/dom/#dom-characterdata-data">data</a></code>;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1243
                    <li>"<code>?&gt;</code>" (U+003F QUESTION MARK, U+003E GREATER-THAN SIGN).
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1244
                </li></ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1245
                <li>Return the value of <var>markup</var>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1246
              </li></ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1247
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1248
        </dd></dl>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1249
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1250
        <p>To <dfn title="concept-serialize-doctype" id="dfn-concept-serialize-doctype">produce a DocumentType serialization</dfn> of a
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1251
            <code><a title="node" class="externalDFN" href="http://www.w3.org/TR/dom/#node">Node</a></code> <var>node</var>, given a
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1252
            <a title="concept-well-formed" class="internalDFN" href="#dfn-concept-well-formed">require well-formed</a> flag, the user agent must return
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1253
            the result of the following algorithm:</p>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1254
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1255
        <ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1256
            <li>If the <a title="concept-well-formed" class="internalDFN" href="#dfn-concept-well-formed">require well-formed</a> flag is <code>true</code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1257
                and the <var>node</var>'s
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1258
                <code><a title="dom-documenttype-publicid" class="externalDFN" href="http://www.w3.org/TR/dom/#dom-documenttype-publicid">publicId</a></code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1259
                attribute contains characters that are not matched by the XML <code>PubidChar</code> production
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1260
                [<cite><a class="bibref" href="#bib-XML10">XML10</a></cite>], then <a title="concept-algorithm-exception" class="internalDFN" href="#dfn-concept-algorithm-exception">throw an exception</a>; the serialization
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1261
                of this <var>node</var> would not be a well-formed document type declaration.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1262
            <li>If the <a title="concept-well-formed" class="internalDFN" href="#dfn-concept-well-formed">require well-formed</a> flag is <code>true</code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1263
                and the <var>node</var>'s
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1264
                <code><a title="dom-documenttype-systemid" class="externalDFN" href="http://www.w3.org/TR/dom/#dom-documenttype-systemid">systemId</a></code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1265
                attribute contains characters that are not matched by the XML <code>Char</code> production
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1266
                [<cite><a class="bibref" href="#bib-XML10">XML10</a></cite>] or that contains both a "<code>"</code>" (U+0022 QUOTATION MARK) and a "<code>'</code>"
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1267
                (U+0027 APOSTROPHE), then <a title="concept-algorithm-exception" class="internalDFN" href="#dfn-concept-algorithm-exception">throw an exception</a>; the
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1268
                serialization of this <var>node</var> would not be a well-formed document type declaration.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1269
            <li>Let <var>markup</var> be an empty string.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1270
            <li>Append the string "<code>&lt;!DOCTYPE</code>" to <var>markup</var>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1271
            <li>Append "<code> </code>" (U+0020 SPACE) to <var>markup</var>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1272
            <li>Append the value of the <var>node</var>'s
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1273
                <code><a title="dom-documenttype-name" class="externalDFN" href="http://www.w3.org/TR/dom/#dom-documenttype-name">name</a></code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1274
                attribute to <var>markup</var>. For a <var>node</var> belonging to an
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1275
                <a title="html-document" class="externalDFN" href="http://www.w3.org/TR/dom/#html-document">HTML document</a>,
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1276
                the value will be all lowercase.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1277
            <li>If the <var>node</var>'s
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1278
                <code><a title="dom-documenttype-publicid" class="externalDFN" href="http://www.w3.org/TR/dom/#dom-documenttype-publicid">publicId</a></code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1279
                is not the empty string then append the following, in the order listed, to <var>markup</var>:
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1280
                <ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1281
                    <li>"<code> </code>" (U+0020 SPACE);
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1282
                    <li>The string "<code>PUBLIC</code>";
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1283
                    <li>"<code> </code>" (U+0020 SPACE);
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1284
                    <li>"<code>"</code>" (U+0022 QUOTATION MARK);
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1285
                    <li>The value of the <var>node</var>'s
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1286
                        <code><a title="dom-documenttype-publicid" class="externalDFN" href="http://www.w3.org/TR/dom/#dom-documenttype-publicid">publicId</a></code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1287
                        attribute;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1288
                    <li>"<code>"</code>" (U+0022 QUOTATION MARK).
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1289
                </li></ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1290
            </li>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1291
            <li>If the <var>node</var>'s
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1292
                <code><a title="dom-documenttype-systemid" class="externalDFN" href="http://www.w3.org/TR/dom/#dom-documenttype-systemid">systemId</a></code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1293
                is not the empty string and the <var>node</var>'s
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1294
                <code><a title="dom-documenttype-publicid" class="externalDFN" href="http://www.w3.org/TR/dom/#dom-documenttype-publicid">publicId</a></code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1295
                is set to the empty string, then append the following, in the order listed, to <var>markup</var>:
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1296
                <ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1297
                    <li>"<code> </code>" (U+0020 SPACE);
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1298
                    <li>The string "<code>SYSTEM</code>".
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1299
                </li></ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1300
            </li>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1301
            <li>If the <var>node</var>'s
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1302
                <code><a title="dom-documenttype-systemid" class="externalDFN" href="http://www.w3.org/TR/dom/#dom-documenttype-systemid">systemId</a></code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1303
                is not the empty string then append the following, in the order listed, to <var>markup</var>:
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1304
                <ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1305
                    <li>"<code> </code>" (U+0020 SPACE);
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1306
                    <li>"<code>"</code>" (U+0022 QUOTATION MARK);
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1307
                    <li>The value of the <var>node</var>'s
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1308
                        <code><a title="dom-documenttype-systemid" class="externalDFN" href="http://www.w3.org/TR/dom/#dom-documenttype-systemid">systemId</a></code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1309
                        attribute;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1310
                    <li>"<code>"</code>" (U+0022 QUOTATION MARK).
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1311
                </li></ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1312
            </li>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1313
            <!-- Removing internalSubset serialization steps as this property is not supported by DOM4. Also,
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1314
                optional requirements don't help improve interoperability:
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1315
            <li>Optional: if the <var>node</var> has an (historical)
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1316
                <code><a title="ID-Core-DocType-internalSubset" data-spec="DOM3" class="externalDFN">internalSubset</a></code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1317
                and the
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1318
                <code><a title="ID-Core-DocType-internalSubset" data-spec="DOM3" class="externalDFN">internalSubset</a></code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1319
                attribute's value is a non-empty string, then append the following,
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1320
                in the order listed, to <var>markup</var>:
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1321
                <ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1322
                    <li>"<code> </code>" (U+0020 SPACE);
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1323
                    <li>"<code>[</code>" (U+005B LEFT SQUARE BRACKET);
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1324
                    <li>The value of the <var>node</var>'s
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1325
                        <code><a title="ID-Core-DocType-internalSubset" data-spec="DOM3" class="externalDFN">internalSubset</a></code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1326
                        attribute;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1327
                    <li>"<code>]</code>" (U+005D RIGHT SQUARE BRACKET);
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1328
                </ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1329
                <p class=note>A <var>node</var> belonging to an
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1330
                   <a title="html-document" data-spec="DOM4" class="externalDFN">HTML document</a>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1331
                   will never have an
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1332
                   <code><a title="ID-Core-DocType-internalSubset" data-spec="DOM3" class="externalDFN">internalSubset</a></code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1333
                   because any <code><a title="ID-Core-DocType-internalSubset" data-spec="DOM3" class="externalDFN">internalSubset</a></code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1334
                   markup is ignored by the parser.</p>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1335
            </li>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1336
            -->
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1337
            <li>Append "<code>&gt;</code>" (U+003E GREATER-THAN SIGN) to <var>markup</var>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1338
            <li>Return the value of <var>markup</var>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1339
        </li></ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1340
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1341
        <p>To <dfn title="concept-record-namespace-info" id="dfn-concept-record-namespace-info">record the namespace information</dfn> for an
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1342
            <code><a title="element" class="externalDFN" href="http://www.w3.org/TR/dom/#element">Element</a></code> <var>element</var>, given a
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1343
            <a title="concept-namespace-prefix-map" class="internalDFN" href="#dfn-concept-namespace-prefix-map">namespace prefix map</a> <var>map</var>, an
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1344
            <var>element prefixes list</var> (initially empty), and a <var>duplicate prefix
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1345
            definition</var> reference, the user agent must run the following steps:
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1346
        <ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1347
            <li>Let <var>default namespace attr value</var> be <code>null</code>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1348
            <li><dfn title="record-namespace-loop" id="dfn-record-namespace-loop">Main</dfn>: For each <a title="concept-attribute" class="externalDFN" href="http://www.w3.org/TR/dom/#concept-attribute">attribute</a>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1349
                <var>attr</var> in <var>element</var>'s
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1350
                <code><a title="dom-element-attributes" class="externalDFN" href="http://www.w3.org/TR/dom/#dom-element-attributes">attributes</a></code>,
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1351
                in the order they are specified in the <var>element</var>'s
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1352
                <a title="dom-element-attributes" class="externalDFN" href="http://www.w3.org/TR/dom/#dom-element-attributes">attribute list</a>:
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1353
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1354
                <div class="note"><div class="note-title" id="h_note_5" role="heading" aria-level="3"><span>Note</span></div><p>The following conditional steps add namespace prefixes
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1355
                    into the <var>element prefixes list</var> and add or replace them in the <var>map</var>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1356
                    Only attributes in the <a title="xmlns-ns" class="internalDFN" href="#dfn-xmlns-ns">XMLNS namespace</a> are
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1357
                    considered (e.g., attributes made to look like namespace declarations via
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1358
                    <code><a title="dom-element-setattribute" class="externalDFN" href="http://www.w3.org/TR/dom/#dom-element-setattribute">setAttribute</a>(<em>"xmlns:pretend-prefix"</em>,
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1359
                    <em>"pretend-namespace"</em>)</code> are not included).</p></div>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1360
            <ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1361
                <li>Let <var>attribute namespace</var> be the value of <var>attr</var>'s
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1362
                    <code><a title="dom-attr-namespaceuri" class="externalDFN" href="http://www.w3.org/TR/dom/#dom-attr-namespaceuri">namespaceURI</a></code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1363
                    value.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1364
                <li>Let <var>attribute prefix</var> be the value of <var>attr</var>'s
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1365
                        <code><a title="dom-attr-prefix" class="externalDFN" href="http://www.w3.org/TR/dom/#dom-attr-prefix">prefix</a></code>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1366
                <li>If the <var>attribute namespace</var> is the <a title="xmlns-ns" class="internalDFN" href="#dfn-xmlns-ns">XMLNS namespace</a>, then:
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1367
                <ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1368
                    <li>If <var>attribute prefix</var> is <code>null</code>, then <var>attr</var> is a
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1369
                        default namespace declaration. Set the <var>default namespace attr value</var> to
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1370
                        <var>attr</var>'s <code><a title="dom-attr-value" class="externalDFN" href="http://www.w3.org/TR/dom/#dom-attr-value">value</a></code> and stop running these steps, returning to
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1371
                        <a title="record-namespace-loop" class="internalDFN" href="#dfn-record-namespace-loop">Main</a> to visit the next attribute.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1372
                    <li>Otherwise, the <var>attribute prefix</var> is not <code>null</code> and <var>attr</var>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1373
                        is a namespace prefix definition. Run the following steps:
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1374
                    <ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1375
                        <li>Let <var>prefix definition</var> be the value of <var>attr</var>'s
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1376
                            <code><a title="dom-attr-localname" class="externalDFN" href="http://www.w3.org/TR/dom/#dom-attr-localname">localName</a></code>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1377
                        <li>Let <var>namespace definition</var> be the value of <var>attr</var>'s
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1378
                            <code><a title="dom-attr-value" class="externalDFN" href="http://www.w3.org/TR/dom/#dom-attr-value">value</a></code>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1379
                        <li>If a key matching the value of <var>namespace definition</var> already exists in
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1380
                            <var>map</var>, and the key's value matches <var>prefix definition</var>, then
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1381
                            this is a duplicate namespace prefix definition. Set the value of <var>duplicate
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1382
                            prefix definition</var> to <var>prefix definition</var>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1383
                        <li>Otherwise, if the key matching the value of <var>namespace definition</var> already
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1384
                            exists in <var>map</var>, but the key's value does not match <var>prefix definition</var>,
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1385
                            then update the key's value to be <var>prefix definition</var>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1386
                        <li>Otherwise, no key matching the value of <var>namespace definition</var> exists;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1387
                            append to <var>map</var> a new key <var>namespace definition</var>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1388
                            whose key value is the <var>prefix definition</var>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1389
                        <li>Append the value of <var>prefix definition</var> to <var>element prefixes list</var>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1390
                    </li></ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1391
                </li></ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1392
            </li></ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1393
            <li>Return the value of <var>default namespace attr value</var>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1394
        </li></ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1395
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1396
        <p>To <dfn title="concept-generate-prefix" id="dfn-concept-generate-prefix">generate a prefix</dfn> given a
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1397
            <a title="concept-namespace-prefix-map" class="internalDFN" href="#dfn-concept-namespace-prefix-map">namespace prefix map</a> <var>map</var>, a
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1398
            string <var>new namespace</var>, and a reference to a
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1399
            <a title="concept-generated-prefix" class="internalDFN" href="#dfn-concept-generated-prefix">generated namespace prefix index</a> <var>prefix
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1400
            index</var>, the user agent must run the following steps:
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1401
        <ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1402
            <li>Let <var>generated prefix</var> be the concatenation of the string "<code>ns</code>" and
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1403
                the current numerical value of <var>prefix index</var>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1404
            <li>Let the value of <var>prefix index</var> be incremented by one.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1405
            <li>Append to <var>map</var> a new key <var>new namespace</var> whose key value is the
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1406
                <var>generated prefix</var>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1407
            <li>Return the value of <var>generated prefix</var>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1408
        </li></ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1409
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1410
        <p>The <dfn title="concept-serialize-xml-attributes" id="dfn-concept-serialize-xml-attributes">XML serialization of the attributes</dfn>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1411
            of an <code><a title="concept-element" class="externalDFN" href="http://www.w3.org/TR/dom/#concept-element">Element</a></code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1412
            <var>element</var> together with a <a title="concept-namespace-prefix-map" class="internalDFN" href="#dfn-concept-namespace-prefix-map">namespace prefix
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1413
            map</a> <var>map</var>, a <a title="concept-generated-prefix" class="internalDFN" href="#dfn-concept-generated-prefix">generated prefix index</a>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1414
            <var>prefix index</var> reference, a flag <var>ignore namespace definition attribute</var>, a
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1415
            <var>duplicate prefix definition</var> value, and a flag <var>require well-formed</var>,
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1416
            is the result of the following algorithm:
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1417
        <ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1418
            <li>Let <var>result</var> be the empty string.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1419
            <li>Let <var>localname set</var> be a new empty
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1420
                <dfn title="concept-namespace-localname-set" id="dfn-concept-namespace-localname-set">namespace localname set</dfn>. This <var>localname
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1421
                set</var> will contain tuples of unique attribute
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1422
                <code><a title="dom-attr-namespaceuri" class="externalDFN" href="http://www.w3.org/TR/dom/#dom-attr-namespaceuri">namespaceURI</a></code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1423
                and <code><a title="dom-element-localname" class="externalDFN" href="http://www.w3.org/TR/dom/#dom-element-localname">localName</a></code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1424
                pairs, and is populated as each <var>attr</var> is processed.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1425
                <span class="note">This set is used to [optionally] enforce the well-formed constraint that an
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1426
                element cannot have two attributes with the same
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1427
                <code><a title="dom-attr-namespaceuri" class="externalDFN" href="http://www.w3.org/TR/dom/#dom-attr-namespaceuri">namespaceURI</a></code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1428
                and <code><a title="dom-element-localname" class="externalDFN" href="http://www.w3.org/TR/dom/#dom-element-localname">localName</a></code>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1429
                This can occur when two otherwise identical attributes on the same element differ only by their
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1430
                prefix values.</span>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1431
            <li><dfn title="serialize-attributes-loop" id="dfn-serialize-attributes-loop">Main</dfn>: For each <a title="concept-attribute" class="externalDFN" href="http://www.w3.org/TR/dom/#concept-attribute">attribute</a>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1432
                <var>attr</var> in <var>element</var>'s
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1433
                <code><a title="dom-element-attributes" class="externalDFN" href="http://www.w3.org/TR/dom/#dom-element-attributes">attributes</a></code>,
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1434
                in the order they are specified in the <var>element</var>'s
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1435
                <a title="dom-element-attributes" class="externalDFN" href="http://www.w3.org/TR/dom/#dom-element-attributes">attribute list</a>:
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1436
            <ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1437
                <li>If the <a title="concept-well-formed" class="internalDFN" href="#dfn-concept-well-formed">require well-formed</a> flag is set (its value is
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1438
                    <code>true</code>), and the <var>localname set</var> contains a tuple whose values match those
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1439
                    of a new tuple consisting of <var>attr</var>'s
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1440
                    <code><a title="dom-attr-namespaceuri" class="externalDFN" href="http://www.w3.org/TR/dom/#dom-attr-namespaceuri">namespaceURI</a></code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1441
                    attribute and <code><a title="dom-element-localname" class="externalDFN" href="http://www.w3.org/TR/dom/#dom-element-localname">localName</a></code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1442
                    attribute, then <a title="concept-algorithm-exception" class="internalDFN" href="#dfn-concept-algorithm-exception">throw an exception</a>; the serialization of this
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1443
                    <var>attr</var> would fail to produce a well-formed element serialization.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1444
                <li>Create a new tuple consisting of <var>attr</var>'s
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1445
                    <code><a title="dom-attr-namespaceuri" class="externalDFN" href="http://www.w3.org/TR/dom/#dom-attr-namespaceuri">namespaceURI</a></code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1446
                    attribute and <code><a title="dom-element-localname" class="externalDFN" href="http://www.w3.org/TR/dom/#dom-element-localname">localName</a></code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1447
                    attribute, and add it to the <var>localname set</var>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1448
                <li>Let <var>attribute namespace</var> be the value of <var>attr</var>'s
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1449
                    <code><a title="dom-attr-namespaceuri" class="externalDFN" href="http://www.w3.org/TR/dom/#dom-attr-namespaceuri">namespaceURI</a></code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1450
                    value.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1451
                <!-- Check for an unregistered attribute namespace, and if so, serialize a definition for it -->
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1452
                <li>Let <var>candidate prefix</var> be <code>null</code>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1453
                <li>If <var>attribute namespace</var> is not <code>null</code>, then run these sub-steps:
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1454
                <ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1455
                    <li>If the value of <var>attribute namespace</var> is the
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1456
                        <a title="xmlns-ns" class="internalDFN" href="#dfn-xmlns-ns">XMLNS namespace</a> and either the <var>attr</var>'s
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1457
                        <code><a title="dom-attr-prefix" class="externalDFN" href="http://www.w3.org/TR/dom/#dom-attr-prefix">prefix</a></code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1458
                        is <code>null</code> and the <var>ignore namespace definition
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1459
                        attribute</var> flag is <code>true</code> or the <var>attr</var>'s
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1460
                        <code><a title="dom-attr-prefix" class="externalDFN" href="http://www.w3.org/TR/dom/#dom-attr-prefix">prefix</a></code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1461
                        is not <code>null</code> and the <var>attr</var>'s
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1462
                        <code><a title="dom-attr-localname" class="externalDFN" href="http://www.w3.org/TR/dom/#dom-attr-localname">localName</a></code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1463
                        matches the value of <var>duplicate prefix definition</var>, then stop running
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1464
                        these steps and goto <a title="serialize-attributes-loop" class="internalDFN" href="#dfn-serialize-attributes-loop">Main</a> to visit the next attribute.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1465
                    <li>Otherwise, if there exists a key in <var>map</var> that matches the value of <var>attribute
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1466
                        namespace</var>, then let <var>candidate prefix</var> be that key's value from the
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1467
                        <var>map</var>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1468
                    <li>Otherwise, there is no key matching <var>attribute namespace</var> in <var>map</var> and
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1469
                        the <var>attribute namespace</var> is not the <a title="xmlns-ns" class="internalDFN" href="#dfn-xmlns-ns">XMLNS namespace</a>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1470
                        Run these steps:
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1471
                    <ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1472
                        <li>Let <var>candidate prefix</var> be the result of
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1473
                            <a title="concept-generate-prefix" class="internalDFN" href="#dfn-concept-generate-prefix">generating a prefix</a> providing <var>map</var>,
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1474
                            <var>attribute namespace</var>, and <var>prefix index</var> as input.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1475
                        <li>Append the following to <var>result</var>, in the order listed:
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1476
                        <ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1477
                            <li>"<code> </code>" (U+0020 SPACE);
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1478
                            <li>The string "<code>xmlns:</code>";
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1479
                            <li>The value of <var>candidate prefix</var>;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1480
                            <li>"<code>="</code>" (U+003D EQUALS SIGN, U+0022 QUOTATION MARK);
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1481
                            <li>The result of <a title="concept-serialize-attr-value" class="internalDFN" href="#dfn-concept-serialize-attr-value">serializing an attribute value</a>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1482
                                given <var>attribute namespace</var> and the
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1483
                                <a title="concept-well-formed" class="internalDFN" href="#dfn-concept-well-formed">require well-formed</a> flag as input;
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1484
                            <li>"<code>"</code>" (U+0022 QUOTATION MARK).
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1485
                        </li></ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1486
                    </li></ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1487
                </li></ol>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1488
                <!-- A namespace prefix has been set by this point if it needed to be set -->
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1489
                <li>Append a "<code> </code>" (U+0020 SPACE) to <var>result</var>.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1490
                <li>If <var>candidate prefix</var> is not <code>null</code>, then append to <var>result</var>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1491
                    the concatenation of <var>candidate prefix</var> with "<code>:</code>" (U+003A COLON).
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1492
                <!-- Check for well-formed localName -->
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1493
                <li>If the <a title="concept-well-formed" class="internalDFN" href="#dfn-concept-well-formed">require well-formed</a> flag is set (its value is
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1494
                    <code>true</code>), and this <var>attr</var>'s
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1495
                    <code><a title="dom-element-localname" class="externalDFN" href="http://www.w3.org/TR/dom/#dom-element-localname">localName</a></code>
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1496
                    attribute contains the character "<code>:</code>" (U+003A COLON) or does not match the XML
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1497
                    <code>Name</code> production [<cite><a class="bibref" href="#bib-XML10">XML10</a></cite>] or equals "<code>xmlns</code>" and <var>attribute
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1498
                    namespace</var> is <code>null</code>, then <a title="concept-algorithm-exception" class="internalDFN" href="#dfn-concept-algorithm-exception">throw an
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1499
                    exception</a>; the serialization of this <var>attr</var> would not be a well-formed attribute.
e14bd5590323 Add the candidate CR document
travil
parents:
diff changeset
  1500
                <!-- Write out the standard attribute -->