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