<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="19" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[19]</anchor-end> This page describes how source positions of nodes, attributes, tokens, and errors
are stored and handled in <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">manakai</anchor>'s  DOM/HTML related <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Perl</anchor> modules.</p><section><h1>DocumentIndex</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[2]</anchor-end> A DocumentIndex is a positive integer used to identify a source data stream.</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="3" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[3]</anchor-end> The value <code>-1</code> represents that the source is an unknown data stream.</p></section><section><h1>CharacterIndex</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="4" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[4]</anchor-end> A CharacterIndex is a non-negative integer representing the location of a character in the given source character stream.  It is the offset from the beginning of the character string.</p><comment-p xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="5" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[5]</anchor-end> It is unclear whether &quot;an unknown character index&quot; is necessary or not at the time of writing.  If necessary, the value <code xmlns="http://www.w3.org/1999/xhtml">-1</code> will be used.</comment-p></section><section><h1>LineNumber</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="43" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[43]</anchor-end> A LineNumber is a positive integer representing the line in the given source character stream
in which the character appears.</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="47" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[47]</anchor-end> The LineNumber of the first line in the source character stream is 1.</p><comment-p xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="44" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[44]</anchor-end> It is unclear whether &quot;an unknown line number&quot; is necessary or not.
If necessary, the value -1 will be used.</comment-p></section><section><h1>ColumnNumber</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="45" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[45]</anchor-end> A ColumnNumber is a non-negative integer representing the column in the line
in the given source character stream at which the character appears.</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="46" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[46]</anchor-end> The ColumnNumber of the first character in the line is 1.</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="48" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[48]</anchor-end> The ColumnNumber of the newline can be 0 (a ColumnNumber in the next line) or
equal to the number of the characters in the previous line (a ColumnNumber
in the previous line).</p><comment-p xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="49" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[49]</anchor-end> It is unclear whether &quot;an unknown line number&quot; is necessary or not.
If necessary, the value -1 will be used.  Note that it might be possible to
use -1 for the CR of CRLF sequence...</comment-p></section><section><h1>IndexedStringSegment</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="6" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[6]</anchor-end> An IndexedStringSegment is an array reference containing a character string,
a DocumentIndex, and a CharacterIndex.</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="7" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[7]</anchor-end> The pair of the DocumentIndex and the CharacterIndex identifies the source
location of the first character of the character string.</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="8" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[8]</anchor-end> An IndexedStringSegment represents the character string.</p></section><section><h1>IndexedString</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="1" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[1]</anchor-end> An IndexedString is an array reference containing zero or more IndexedStringSegment,
representing a string consist of concatenation of strings represented by
the IndexedStringSegments, in order.</p></section><section><h1>IndexIndexMappingSegment</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="22" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[22]</anchor-end> An IndexIndexMappingSegment is an array reference whose items are
a CharacterIndex, a DocumentIndex, and a CharacterIndex.</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="23" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[23]</anchor-end> It represents that the character at the first CharacterIndex is
corresponding to the character at the last CharacterIndex in the document
identified by the DocumentIndex.</p></section><section><h1>IndexIndexMapping</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="24" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[24]</anchor-end> An IndexIndexMapping is an array reference whose items are zero or more
IndexIndexMappingSegments.</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="25" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[25]</anchor-end> The first CharacterIndex in an earlier IndexIndexMappingSegment in the IndexIndexMapping
must be less than or equal to the first CharacterIndex of a later IndexIndexMappingSegment.</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="35" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[35]</anchor-end> It defines a mapping from the CharacterIndex of a character to
a pair of DocumentIndex and CharacterIndex.</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="29" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[29]</anchor-end> The <dfn>relevant segment</dfn> of a mapping
for a CharacterIndex is the result of these steps:<figure class="steps"><ol><li><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="32" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[32]</anchor-end> Let <var>result</var> be a segment (0, -1, 0).</li><li><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="30" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[30]</anchor-end> For each segments in the mapping, in order:<ol><li><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="31" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[31]</anchor-end> If the first CharacterIndex of the segment is greater than the given CharacterIndex,
return <var>result</var> and abort these steps.</li><li><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="33" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[33]</anchor-end> Otherwise, set the item to <var>result</var>.</li></ol></li><li><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="34" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[34]</anchor-end> Return <var>result</var>.</li></ol></figure></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="26" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[26]</anchor-end> The <dfn>mapped (DocumentIndex, CharacterIndex) pair</dfn> of a character obtained by an
IndexIndexMapping is the pair of DocumentIndex and the last CharacterIndex
of the relevant segment of the IndexIndexMapping for the
CharacterIndex identifying the character.</p><comment-p xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="28" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[28]</anchor-end> Note that if there are more than one IndexIndexMappingSegments whose first
CharacterIndexes are equal, the earlier IndexIndexMappingSegment is ignored.</comment-p></section><section><h1>IndexLCMappingSegment</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="36" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[36]</anchor-end> An IndexLCMappingSegment is an array reference whose items are
a CharacterIndex, a LineNumber, and a ColumnNumber.</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="37" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[37]</anchor-end> It represents that the character at the CharacterIndex has
LineNumber and ColumnNumber.</p></section><section><h1>IndexLCMapping</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="38" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[38]</anchor-end> An IndexLCMapping is an array reference whose items are zero or more
IndexLCMappingSegments.</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="39" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[39]</anchor-end> The CharacterIndex in an earlier IndexLCMappingSegment in the IndexLCMapping
must be less than or equal to the CharacterIndex of a later IndexLCMappingSegment.</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="40" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[40]</anchor-end> It defines a mapping from the CharacterIndex of a character to
a pair of LineNumber and ColumnNumber.</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="41" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[41]</anchor-end> The <dfn>mapped (LineNumber, ColumnNumber) pair</dfn> of a character obtained by an
IndexLCMapping is the pair of LineNumber and the ColumnNumber
of the relevant segment of the IndexLCMapping for the CharacterIndex identifying the character.</p><comment-p xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="42" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[42]</anchor-end> Note that if there are more than one IndexLCMappingSegments whose first
CharacterIndexes are equal, the earlier IndexLCMappingSegment is ignored.</comment-p></section><section><h1>DocumentIndexData</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="50" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[50]</anchor-end> A DocumentIndexData is a hash reference.  It contains properties of a document.</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="51" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[51]</anchor-end> If there is key <code>map</code>, its value must be an IndexIndexMapping.
Its IndexIndexMappingSegments' first CharacterIndexes are considered as
indexes in this document.</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="52" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[52]</anchor-end> If there is key <code>lc_map</code>, its value must be an IndexLCMapping.
Its IndexLCMappingSegments' first CharacterIndexes are considered as
indexes in this document.</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="27" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[27]</anchor-end> If there is key <code>url</code>, its value must be a character string.
It is the URL of the document, if known.  It must be an absolute URL.
However, the consumer of the value must not assume that it is an absolute URL.</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="55" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[55]</anchor-end> Applications can use other keys for their own purposes.  They should
perform their best effort to avoid conflicting of keys with future addition
and of another applications. </p></section><section><h1>DocumentIndexDataSet</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="53" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[53]</anchor-end> A DocumentIndexDataSet is an array reference whose items are DocumentIndexData
or undef.</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="54" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[54]</anchor-end> If the <var>i</var>-th item in the array reference is a DocumentIndexData,
it is the DocumentIndexData for the document whose DocumentIndex is <var>i</var>.
If the <var>i</var>-th item in the array reference is undef, or there is no
<var>i</var>-th item in the array reference, DocumentIndex <var>i</var> is not
assigned to any document.</p></section><section><h1>Web IDL Perl binding extensions</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="9" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[9]</anchor-end> If the type of an argument is IndexedStringSegment, run these steps:<figure class="steps"><ol><li>Let <var>value</var> be the specified value.</li><li>If <var>value</var> is not an array reference, throw an <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">TypeError</anchor> and abort these steps.</li><li>Let <var>new value</var> be a new array reference.</li><li>Push ToString(<var>value</var>-&gt;[0]) to <var>new value</var>.</li><li>Push ToNumber(<var>value</var>-&gt;[1]) to <var>new value</var>.</li><li>Push ToNumber(<var>value</var>-&gt;[2]) to <var>new value</var>.</li><li>Return <var>new value</var>.</li></ol></figure></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="10" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[10]</anchor-end> If the type of an argument is IndexedString, run these steps:<figure class="steps"><ol><li>Let <var>value</var> be the specified value.</li><li>If <var>value</var> is not an array reference, throw an <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">TypeError</anchor> and abort these steps.</li><li>If there is an item in <var>value</var> which is not an array reference, throw an <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">TypeError</anchor> and abort these steps.</li><li>Let <var>new value</var> be a new array reference.</li><li>For each item in <var>value</var>, in order,<ol><li>Apply <anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="9" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;9</anchor-internal> to the item and push the result into <var>new value</var>.</li></ol></li><li>Return <var>new value</var>.</li></ol></figure></p></section><section><h1>DOM <code class="DOMi" xml:lang="en">Node</code> extensions</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="11" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[11]</anchor-end> Each <code class="DOMi" xml:lang="en">Node</code> and <code class="DOMi" xml:lang="en">Attr</code> has associated
source document index and source character index.  Initially, they are unset.</p><figure><pre class="IDL code">partial interface Node {
  IndexedStringSegment manakaiGetSourceLocation;
  void manakaiSetSourceLocation (IndexedStringSegment? new);
};
partial interface Attr {
  IndexedStringSegment manakaiGetSourceLocation;
  void manakaiSetSourceLocation (IndexedStringSegment? new);
};</pre></figure><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="12" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[12]</anchor-end> The <code class="DOMm" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">manakaiGetSourceLocation</anchor></code> method <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:"><strong xmlns="http://www.w3.org/1999/xhtml">MUST</strong></anchor>
run these steps:<figure class="steps"><ol><li>If the source document index of the <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">context object</anchor> is set,<ol><li>Return a new IndexedStringSegment whose character string is the empty string,
DocumentIndex is the source document index of the <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">context object</anchor>, and
CharacterIndex is the source character index of the <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">context object</anchor>.</li></ol></li><li>Otherwise, if the <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">context object</anchor> is a <code class="DOMi" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">CharacterData</anchor></code>,
<code class="DOMi" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Attr</anchor></code>, or <code class="DOMi" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">AttributeDefinition</anchor></code>
and its data or value consist of one or more
IndexedStringSegment, <ol><li>Let <var>segment</var> be the first IndexedStringSegment of the data or value
of the <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">context object</anchor>.</li><li>Return a new IndexedStringSegment whose character string is the empty string,
DocumentIndex is the DocumentIndex of <var>segment</var>,
and CharacterIndex is the CharacterIndex of <var>segment</var>.</li></ol></li><li>Otherwise, return a new IndexedStringSegment whose character string is the empty string,
DocumentIndex is -1, and CharacterIndex is 0.</li></ol></figure></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="13" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[13]</anchor-end> The <code class="DOMm" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">manakaiSetSourceLocation</anchor></code> method <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:"><strong xmlns="http://www.w3.org/1999/xhtml">MUST</strong></anchor>
run these steps:<figure class="steps"><ol><li>If the argument is <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">null</anchor>, unset the source document index 
and the source character index of the <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">context object</anchor>.</li><li>Otherwise, set the source document index of the <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">context object</anchor>
to the DocumentIndex of the argument and the source character index of the 
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">context object</anchor> to the CharacterIndex of the argument.</li></ol></figure></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="14" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[14]</anchor-end> The data of a <code class="DOMi" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">CharacterData</anchor></code> node,
the value of an <code class="DOMi" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">AttributeDefinition</anchor></code> node, and
the value of an <code class="DOMi" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Attr</anchor></code> object are internally stored
as IndexedString (or equivalent).</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="15" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[15]</anchor-end> When they are to be modified by a method that does not aware of IndexedString,
it <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:"><strong xmlns="http://www.w3.org/1999/xhtml">MUST</strong></anchor> be performed in a way that does not make DocumentIndex and CharactrIndex
contained in the IndexedString incorrect.  When it is not desired to preserve
DocumentIndex and CharacterIndex of affected IndexedStringSegments
or when a <code class="DOMi" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">DOMString</anchor></code> is inserted, their DocumentIndex
and CharacterIndex <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:"><strong xmlns="http://www.w3.org/1999/xhtml">MUST</strong></anchor> be set to -1 and 0, respectively.</p><figure><pre class="IDL code">partial interface Node {
  IndexedString? manakaiGetIndexedString ();
  void manakaiAppendIndexedString (IndexedString s);
};
partial interface Attr {
  IndexedString? manakaiGetIndexedString ();
  void manakaiAppendIndexedString (IndexedString s);
};</pre></figure><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="16" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[16]</anchor-end> The <code class="DOMm" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">manakaiGetIndexedString</anchor></code> method
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:"><strong xmlns="http://www.w3.org/1999/xhtml">MUST</strong></anchor> return a new IndexedString which represents the same
string as the <code class="DOMa" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">textContent</anchor></code> attribute
of the <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">context object</anchor>.  DocumentIndex and CharacterIndex contained
in it <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:"><strong xmlns="http://www.w3.org/1999/xhtml">MUST</strong></anchor> be set to appropriate values.</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="17" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[17]</anchor-end> The <code class="DOMm" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">manakaiAppendIndexedString</anchor></code> method
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:"><strong xmlns="http://www.w3.org/1999/xhtml">MUST</strong></anchor> act as if the <code class="DOMm" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">manakaiAppendText</anchor></code>
method is invoked with the character string of the IndexedString argument.
In addition, DocumentIndex and CharacterIndex contained in the IndexedString
argument <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:"><strong xmlns="http://www.w3.org/1999/xhtml">MUST</strong></anchor> be used to update the data or value of relevant
objects.</p><figure><pre class="IDL code">partial interface Element {
  IndexedString? manakaiGetAttributeIndexedStringNS (DOMString? namespace, DOMString localName);
  void manakaiSetAttributeIndexedStringNS (DOMString? namespace, DOMString name, IndexedString value);
};</pre></figure><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="20" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[20]</anchor-end> The <code class="DOMm" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">manakaiGetAttributeIndexedStringNS</anchor></code> method <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:"><strong xmlns="http://www.w3.org/1999/xhtml">MUST</strong></anchor>
act as if the <code class="DOMm" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">getAttributeNS</anchor></code> method is invoked, except
the method <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:"><strong xmlns="http://www.w3.org/1999/xhtml">MUST</strong></anchor> return a new <code class="DOMi" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">IndexedString</anchor></code>
instead of a <code class="DOMi" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">DOMString</anchor></code>.</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="21" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[21]</anchor-end> The <code class="DOMm" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">manakaiSetAttributeIndexedStringNS</anchor></code> method <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:"><strong xmlns="http://www.w3.org/1999/xhtml">MUST</strong></anchor>
act as if the <code class="DOMm" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">setAttributeNS</anchor></code> method is invoked
with same <var>namespace</var> and <var>name</var> arguments,
and <var>value</var> argument which is a <code class="DOMi" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">DOMString</anchor></code> equivalent to
the character string of the IndexedString argument.
In addition, DocumentIndex and CharacterIndex contained in the IndexedString
argument <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:"><strong xmlns="http://www.w3.org/1999/xhtml">MUST</strong></anchor> be used to set the value of the attribute.</p><comment-p xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="18" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[18]</anchor-end> Exactly how DocumentIndex and CharacterIndex is handled by various
methods defined here or by DOM Standard is a quality of implementation issue.</comment-p></section></body></html>