Artifact 6332872254ffbc696d2b385938cff866b8f3760518005a7a27aba5dce32bb84f:

  • File doc/domNode.html — part of check-in [7ec866b33f] at 2019-08-16 13:04:51 on branch trunk — Corrected speeling and better wording. (user: rolf size: 31716) [more...]

<html>
<head>
<link rel="stylesheet" href="manpage.css"><title>tDOM manual: domNode</title><meta name="xsl-processor" content="Jochen Loewer (loewerj@hotmail.com), Rolf Ade (rolf@pointsman.de) et. al."><meta name="generator" content="$RCSfile: tmml-html.xsl,v $ $Revision: 1.11 $"><meta charset="utf-8">
</head><body>
<div class="header">
<div class="navbar" align="center">
<a href="#SECTid0x561e82e6b640">NAME</a> · <a href="#SECTid0x561e82d945a0">SYNOPSIS</a> · <a href="#SECTid0x561e82e49c80"> DESCRIPTION </a> · <a href="#SECTid0x561e82ebbf40">SEE ALSO</a> · <a href="#SECTid0x561e82ebc2d0">KEYWORDS</a>
</div><hr class="navsep">
</div><div class="body">
  <h2><a name="SECTid0x561e82e6b640">NAME</a></h2><p class="namesection">
<b class="names">domNode - </b><br>Manipulates an instance of a DOM node object</p>



  <h2><a name="SECTid0x561e82d945a0">SYNOPSIS</a></h2><pre class="syntax">$nodeObject <i class="m">method</i> <i class="m">arg arg ...</i>
</pre><pre class="syntax">domNode <i class="m">nodeToken</i> <i class="m">method</i> <i class="m">arg arg ...</i>
</pre>
  <h2><a name="SECTid0x561e82e49c80"> DESCRIPTION </a></h2><p>This command manipulates one particular instance of a DOM node object.
<i class="m">method</i> indicates a specific method of the node class. These methods
should closely conform to the W3C recommendation "Document Object Model
(Core) Level 1" (<a href="http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html">http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html</a>)
as well to parts of the W3C draft "XML Pointer Language (XPointer)"
(<a href="http://www.w3.org/TR/1998/WD-xptr-19980303">http://www.w3.org/TR/1998/WD-xptr-19980303</a>).
Please note, that the XPointer methods are deprecated. Use DOM methods
or XPath expressions instead of them.</p><p>The selectNodes method implements the "XML Path
Language (XPath) Version 1.0" W3C recommendation 16 November 1999 (<a href="http://www.w3.org/TR/1999/REC-xpath-19991116">http://www.w3.org/TR/1999/REC-xpath-19991116</a>). Look
at these documents for a deeper understanding of the functionality.</p><p>The valid methods are:</p><dl class="commandlist">
      
        <dt><b class="method">nodeType</b></dt>
        <dd>Returns the node type of that node object. This can be:
ELEMENT_NODE, TEXT_NODE, CDATA_SECTION_NODE, COMMENT_NODE or
PROCESSING_INSTRUCTION_NODE.</dd>
      

      
        <dt><b class="method">nodeName</b></dt>
        <dd>Returns the node name of that node object. This is the element
(tag) name for element nodes (type ELEMENT_NODE), the processing-instruction
target for processing-instructions, "#text" for text node,
"#comment" for comment nodes or "#cdata" for cdata section
nodes.</dd>
      

      
        <dt>
<b class="method">nodeValue</b> <i class="m">?newValue?</i>
</dt>
        <dd>Returns the value of that node object. This is the text or
the data for element nodes of type TEXT_NODE, COMMENT_NODE,
PROCESSING_INSTRUCTION_NODE or CDATA_SECTION_NODE). Otherwise it is empty. If
the node is a TEXT_NODE, COMMENT_NODE or PROCESSING_INSTRUCTION_NODE and the
optional argument <i class="m">newValue</i> is given, the node is set to that
value.</dd>

      

      
        <dt><b class="method">hasChildNodes</b></dt>
        <dd>Returns 1 if the node has children. Otherwise 0 is returned.</dd>
      

      
        <dt>
<b class="method">parentNode</b> <b class="variable">?objVar?</b>
</dt>
        <dd>Returns the parent node.</dd>
      

      
        <dt><b class="method">childNodes</b></dt>
        <dd>Returns a list of direct children node objects.</dd>
      

      
        <dt><b class="method">childNodesLive</b></dt>
        <dd>Returns a "live" nodeList object of the child nodes of
the node in the sense of the DOM recommendation. This nodeList object is
"live" in the sense that, for instance, changes to the children of
the node object that it was created from are immediately reflected in the nodes
returned by the NodeList accessors; it is not a static snapshot of the content
of the node. The two accessors known by the nodeList object are "item
&lt;index&gt;", which returns the indexth item in the collection, and
"length", which returns the number of nodes in the list.</dd>
      

      
        <dt>
<b class="method">firstChild</b> <b class="variable">?objVar?</b>
</dt>
        <dd>Returns the first child as a node object.</dd>
      

      
        <dt>
<b class="method">lastChild</b> <b class="variable">?objVar?</b>
</dt>
        <dd>Returns the last child as a node object.</dd>
      
      
      
        <dt>
<b class="method">nextSibling</b>  <b class="variable">?objVar?</b>
</dt>
        <dd>Returns the next sibling relative to the current node as a node
object.</dd>
      

      
        <dt>
<b class="method">previousSibling</b> <b class="variable">?objVar?</b>
</dt>
        <dd>Returns the next sibling relative to the current node as a node
object.</dd>
      

      
        <dt>
<b class="method">getElementsByTagName</b> <i class="m">name</i>
</dt>
        <dd>Returns a list of all elements in the subtree matching (glob
style) <i class="m">name</i>.</dd>
      

      
        <dt>
<b class="method">getElementsByTagNameNS</b> <i class="m">uri</i> <i class="m">localname</i>
</dt>
        <dd>Returns a list of all elements in the subtree
matching (glob style) <i class="m">localname</i> and having the given namespace
<i class="m">uri</i>.</dd>
      

      
        <dt>
<b class="method">getElementById</b> <i class="m">id</i>
</dt>
        <dd>Returns the node having an id attribute with value
<i class="m">id</i> or the empty string if no node has an id attribute with that value.</dd>
      

      
        <dt>
<b class="method">hasAttribute</b> <i class="m">attributeName</i>
</dt>
        <dd>Returns 1 if the object node contains an attribute with name
<i class="m">attributeName</i> . Otherwise 0 is returned.</dd>
      

      
        <dt>
<b class="method">getAttribute</b> <i class="m">attributeName  ?defaultValue?</i>
</dt>
        <dd>Returns the value of the attribute <i class="m">attributeName</i>. If the
attribute is not available <i class="m">defaultValue</i> is returned.</dd>
      

      
        <dt>
<b class="method">setAttribute</b> <i class="m">attributeName newValue 
?attributeName newValue ...?</i>
</dt>
        <dd>Sets the value for one or more attributes. Every
        <i class="m">attributeName</i> is set to the corresponding
        <i class="m">newValue</i>. If there isn't an attribute for one or more
        of the <i class="m">attributeName</i>, this will create that attribute.
        It is not recommended to set attributes that look like xml
        namespace declarations.</dd>
      

      
        <dt>
<b class="method">removeAttribute</b> <i class="m">attributeName</i>
</dt>
        <dd>Removes the attribute <i class="m">attributeName</i>.</dd>
      

      
        <dt>
<b class="method">hasAttributeNS</b> <i class="m">uri</i> <i class="m">localName</i>
</dt>
        <dd>Returns 1 if the object node contains an attribute with the
local name <i class="m">localName</i> within the namespace <i class="m">uri</i>.  Otherwise 0 is
returned.</dd>
      

      
        <dt>
<b class="method">getAttributeNS</b> <i class="m">uri</i> <i class="m">localName
?defaultValue?</i>
</dt>
        <dd>Returns the value of the attribute with the local name
<i class="m">localName</i> within the namespace URI <i class="m">uri</i>. If the node dosn't have
that attribute the <i class="m">defaultValue</i> is returned.</dd>
      

      
        <dt>
<b class="method">setAttributeNS</b> <i class="m">uri qualifiedName newValue
?uri qualifiedName newValue ...?</i> </dt>
        <dd>
<p>Sets the value for one or more full qualified
attributes. Every attribute <i class="m">qualifiedName</i> with the namespace URI
<i class="m">uri</i> will be set to <i class="m">newValue</i>. This will create a new attribute, if
it wasn't available before. If you want to set an attribute within a namespace
you must specify the attribute name with prefix, even if you want to set an
already existing attribute to a new value. While searching, if the attribute
already exists, only the given <i class="m">uri</i> and the localname of the
<i class="m">qualifiedName</i> is used.</p>

        <pre class="example">$node setAttributeNS "http://some.uri.com/wow" prefix:attr1 attrValue</pre>

<p>If the uri is the empty string and the attribute name doesn't have
a prefix, this method has the same effect as the method
<b>setAttribute</b>.</p>

        <pre class="example">$node setAttributeNS "" attri "some Value"</pre>

<p>With the exceptions of the special prefixes "xmlns" and "xml" you
always must provide a non empty <i class="m">uri</i> if your <i class="m">qualifiedName</i> has a
prefix. It is not recommended to set xml namespace declarations. The effects are complicated and not always obvious up to resulting a not well-formed serializations after further processing.</p>
</dd>
      

      
        <dt>
<b class="method">removeAttributeNS</b> <i class="m">uri</i> <i class="m">localName</i>
</dt>
        <dd>Removes the attribute with the local name <i class="m">localName</i> within
 the namespace <i class="m">uri</i>.</dd>
      

      
        <dt>
<b class="method">attributes</b> <b class="option">?attributeNamePattern?</b>
</dt>
        <dd>Returns information about the attriubtes matching the
        <i class="m">attributeNamePattern</i>. If <i class="m">attributeNamePattern</i>
        isn't given, information about all attributes are returned.
        The return value is a Tcl list, the elements just the
        attriubute name in case of non namespaced attriubtes and three
        element sublists for namespaced attributes. n case of an
        "ordinary" namespaced attribute, the sublist elements are
        {&lt;localname&gt; &lt;prefix&gt; &lt;namespace_uri&gt;}. In the special case of
        an xml namespace declaration it is {&lt;the prefix defined&gt;
        &lt;localname&gt; ""}.
        </dd>
      

      
        <dt>
<b class="method">attributeNames</b> <b class="option">?attributeNamePattern?</b>
</dt>
        <dd>Returns a flat list of all attributes names (as found in
        the XML source) matching the <i class="m">attributeNamePattern</i>. If
        <i class="m">attributeNamePattern</i> isn't given, all attribute names
        are returned as a Tcl list.</dd>
      
      
      
        <dt>
<b class="method">appendChild</b> <i class="m">newChild</i>
</dt>
        <dd>Appends <i class="m">newChild</i> to the end of the child list of the
node.</dd>
      

      
        <dt>
<b class="method">insertBefore</b> <i class="m">newChild</i>  <i class="m">refChild</i>
</dt>
        <dd>Inserts <i class="m">newChild</i> before the <i class="m">refChild</i> into the list of
children of node. If <i class="m">refChild</i> is the empty string, insert
<i class="m">newChild</i> at the end of the child nodes list of that node.</dd>
      

      
        <dt>
<b class="method">replaceChild</b> <i class="m">newChild</i>  <i class="m">oldChild</i>
</dt>
        <dd>Replaces <i class="m">oldChild</i> with <i class="m">newChild</i> in the list of
children of that node. The <i class="m">oldChild</i> node will be part of the
document fragment list after this operation.</dd>
      

      
        <dt>
<b class="method">removeChild</b> <i class="m">child</i>
</dt>
        <dd>Removes <i class="m">child</i> from the list of children of that node.
<i class="m">child</i> will be part of the document fragment list after this
operation.</dd>
      

      
        <dt><b class="method">delete</b></dt>
        <dd>Deletes the given node and its complete child tree
and frees the complete internal memory. The affected nodes are not accessible
through the document fragment list.</dd>
      

      
        <dt>
<b class="method">cloneNode</b> <b class="option">?-deep?</b>
</dt>
        <dd>Clones this node and adds the new create node into the document
fragment list. If the <i class="m">-deep</i> option is specified, all descendant nodes
are also cloned.</dd>
      

      
        <dt>
<b class="method">ownerDocument</b> <b class="variable">?domObjVar?</b>
</dt>
        <dd>Returns the document object of the document this node belongs
to.</dd>
      

      
        <dt>
<b class="method">find</b> <i class="m">attrName</i> <i class="m">attrVal</i>
<b class="option">?objVar?</b>
</dt>
        <dd>Finds the node with the attribute name <i class="m">attrName</i>, and
attribute value <i class="m">attrVal</i> in the subtree starting the current node.</dd>
      

      
        <dt>
<b class="method">child</b> <i class="m">number|all</i> <b class="option">type</b>
<b class="option">attrName attrValue</b>
</dt>
        <dd>(XPointer) child</dd>
      
      
      
        <dt>
<b class="method">descendant</b> <i class="m">number|all</i> <b class="option">type</b>
<b class="option">attrName attrValue</b>
</dt>
        <dd>(XPointer) descendant</dd>
      

      
        <dt>
<b class="method">ancestor</b> <i class="m">number|all</i> <b class="option">type</b>
<b class="option">attrName attrValue</b>
</dt>
        <dd>(XPointer) ancestor</dd>
      

      
        <dt>
<b class="method">fsibling</b> <i class="m">number|all</i> <b class="option">type</b>
<b class="option">attrName attrValue</b>
</dt>
        <dd>(XPointer) fsibling</dd>
      

      
        <dt>
<b class="method">psibling</b> <i class="m">number|all</i> <b class="option">type</b>
<b class="option">attrName attrValue</b>
</dt>
        <dd>(XPointer) psibling</dd>
      

      
        <dt>
<b class="method">root</b>  <b class="option">objVar</b>
</dt>
        <dd>(XPointer) root</dd>
      

      
        <dt><b class="method">text</b></dt>
        <dd>Returns all text node children of that current node combined,
i.e. appended into one string.</dd>
      

      
        <dt><b class="method">target</b></dt>
        <dd>For a processing instruction node the target part is returned.
Otherwise an error is generated.</dd>
      

      
        <dt><b class="method">data</b></dt>
        <dd>For a processing instruction node the data part is returned. For
a text node, comment node or cdata section node the value is returned.
Otherwise an error is generated.</dd>
      

      
        <dt><b class="method">prefix</b></dt>
        <dd>Returns the namespace prefix.</dd>
      

      
        <dt><b class="method">namespaceURI</b></dt>
        <dd>Returns the namespace URI.</dd>
      

      
        <dt><b class="method">localName</b></dt>
        <dd>Returns the localName from the tag name of the given node.</dd>
      

      
          <dt>
<b class="method">selectNodes</b> <b class="option">?-namespaces prefixUriList?</b> <b class="option">?-cache &lt;boolean&gt;?</b> <i class="m">xpathQuery</i> <b class="option">?typeVar?</b>
</dt>
          <dd>
<p>Returns the result of applying the XPath query
<i class="m">xpathQuery</i> to the subtree. This can be a
string/value, a list of strings, a list of nodes or a list
of attribute name / value pairs. If <i class="m">typeVar</i> is given
the result type name is stored into that variable (empty,
bool, number, string, nodes, attrnodes or mixed).</p>

<p>The argument <i class="m">xpathQuery</i> has to be a valid XPath expression.
However there are a few exceptions to that rule. Tcl variable
references (in the usual tcl syntax: $varname) may appear in the XPath
statement at any position where it is legal according to the rules of
the XPath syntax to put an XPath variable. Ignoring the syntax rules of
XPath the Tcl variable name may be any legal Tcl var name: local
variables, global variables, array entries and so on. The value will
always be seen as string literal by the xpath engine. Cast the value
explicitly with the according xpath functions (number(), boolean()) to
another data type, if needed.</p>

<p>Similar to the way described above to inject literals in a secure
way into the XPath expression using tcl variable references there is a
syntax to inject element names from tcl variables. At every place
where the XPath syntax allows a node test there could be a tcl
variable reference (in any form), just the leading $ replaced with %.
This allows one to select nodes with 'strange' (invalid, according to the
appropriate XML production rule) node names which may be needed in
case of working with JSON data.</p>

<p>The option <i class="m">-namespaces</i> expects a tcl list with prefix /
namespace pairs as argument. If this option is not given, then any
namespace prefix within the xpath expression will be first resolved
against the list of prefix / namespace pairs set with the
selectNodesNamespaces method for the document, the node belongs to. If
this fails, then the namespace definitions in scope of the context
node will be used to resolve the prefix. If this option is given, any
namespace prefix within the xpath expression will be first resolved
against that given list (and ignoring the document global prefix /
namespace list). If the list binds the same prefix to different
namespaces, then the first binding will win.  If this fails, then the
namespace definitions in scope of the context node will be used to
resolve the prefix, as usual.</p>

<p>If the <i class="m">-cache</i> option is used with a true value, then the
<i class="m">xpathQuery</i> will be looked up in a document specific cache. If
the query is found, then the stored pre-compiled query will be used.
If the query isn't found, it will be compiled and stored in the cache,
for use in further calls. Please note that the <i class="m">xpathQuery</i> 
given as string is used as key for the cache. This means, that equal
XPath expressions, which differ only in white space are treated as
different cache entries. Special care is needed, if the XPath
expression includes namespace prefixes or references to tcl variables.
Both namespace prefixes and tcl variable references will be resolved
according to the XML prefix namespace mappings and tcl variable values
at expression compilation time. If the same XPath expression is used
later on in a context with other XML prefix namespace mappings or
values of the used tcl variables, make sure to first remove the
compiled expression from the cache with the help of the
<b class="method">deleteXPathCache</b> method, to force a recompilation.
Without using the <i class="m">-cache</i> option such consideration is never
needed.</p>

<p>Examples:</p>
          <pre class="example">set paragraphNodes [$node selectNodes {chapter[3]//para[@type='warning' or @type='error'} ]
foreach paragraph $paragraphNodes {
    lappend  values [$paragraph selectNodes attribute::type]
}

set doc [dom parse {&lt;doc xmlns="http://www.defaultnamespace.org"&gt;&lt;child/&gt;&lt;/doc&gt;}]
set root [$doc documentElement]
set childNodes [$root selectNodes -namespaces {default http://www.defaultnamespace.org} default:child]</pre>

          </dd>
      

      
        <dt><b class="method">getLine</b></dt>
        <dd>Returns the line number of that node in the originally parsed
XML.</dd>
      
      
      
        <dt><b class="method">getColumn</b></dt>
        <dd>Returns the column number of that node in the originally parsed
XML.</dd>
      

      
        <dt><b class="method">asList</b></dt>
        <dd>Returns the DOM substree starting form the current node as a
nested Tcl list.</dd>
      

      
        <dt>
<b class="method">asXML</b> <b class="option">?-indent none/1..8?</b> <b class="option">?-channel channelId?</b> <b class="option">?-escapeNonASCII?</b> <b class="option">-xmlDeclaration &lt;boolean&gt;?</b> <b class="option">-encString &lt;string&gt;</b> <b class="option">?-escapeAllQuot?</b> <b class="option">?-indentAttrs?</b> <b class="option">?-nogtescape?</b> <b class="option">?-noEmptyElementTag?</b>
</dt>
        <dd>
<p>Returns the DOM substree starting from the current
        node as the root node of the result as an (optional indented)
        XML string or sends the output directly to the given
        channelId.</p>

        <p>If the option <i class="m">-escapeNonASCII</i> is given,
        every non 7 bit ASCII character in attribute values or element
        PCDATA content will be escaped as character reference in
        decimal representation.</p>

        <p>The flag <i class="m">-xmlDeclaration</i> determines whether there
        will be an XML Declaration and a newline emitted before
        anything else. The default is, to do not. If this flag is
        given with a true argument then</p>

        <p>
<i class="m">-encString</i> sets the encoding value in the XML
        Declaration. Otherwise, this option is ignored. Please note,
        that this option just enhance the string representation of the
        generated XML Declaration with an encoding information string,
        nothing more. It's up to the user to handle encoding in case
        of writing to a channel or reparsing.</p>
            
        <p>If the option <i class="m">-escapeAllQuot</i> is given,
        quotation marks will be escaped with &amp;quot; even in text
        content of elements.</p>

        <p>If the option <i class="m">-indentAttrs</i> is
        given, then attributes will each be separated with newlines
        and indented to the same level as the parent node plus the
        value given as argument to <i class="m">-indentAttrs</i> (0..8).</p>

        <p>If the option <i class="m">-nogtescape</i> is given then the
        character '&gt;' won't get escaped in attribute values and text
        content of elements. The default is to escape this
        character.</p>

        <p>If the option <i class="m">-noEmptyElementTag</i> is given then no
        empty tag syntax will be used. Instead, if an element has
        empty content it will be serialized with an element start tag
        and an immediately following element end tag.</p>
</dd>

      

      
        <dt>
<b class="method">asHTML</b> <b class="option">?-channel channelId?</b>
<b class="option">?-escapeNonASCII?</b>  <b class="option">?-htmlEntities?</b>
</dt>
        <dd>Returns the DOM substree starting from the current node as the
root node of the result serialized according to HTML rules (HTML elements are
recognized regardless of case, without end tags for empty HTML elements etc.),
as string or sends the output directly to the given channelId. If the option
<i class="m">-escapeNonASCII</i> is given, every non 7 bit ASCII character in attribute
values or element PCDATA content will be escaped as character reference in
decimal representation. If the option <i class="m">-htmlEntities</i> is given, a
character is written using its HTML 4.01 character entity reference, if one is
defined for it.</dd>
      

      
        <dt><b class="method">asText</b></dt>
          <dd>For ELEMENT_NODEs, the asText method outputs 
the string-value of every text node descendant of node in document
order without any escaping. For every other node type, this method outputs the XPath string value of that node.</dd>
      

      
        <dt>
<b class="method">appendFromList</b> <i class="m">list</i>
</dt>
        <dd>Parses <i class="m">list</i> , creates an according DOM subtree and
appends this subtree to the current node.</dd>
      

      
        <dt>
<b class="method">appendFromScript</b> <i class="m">tclScript</i>
</dt>
        <dd>Appends the nodes created in the <i class="m">tclScript</i> by
Tcl functions, which have been built using <i class="m">dom createNodeCmd</i>, to the
given node.</dd>
      

      
        <dt>
<b class="method">insertBeforeFromScript</b> <i class="m">tclScript</i> <i class="m">refChild</i>
</dt>
        <dd>Inserts the nodes created in the <i class="m">tclScript</i> by
Tcl functions, which have been built using <i class="m">dom createNodeCmd</i>, before the
<i class="m">refChild</i> into the list of children of node. If <i class="m">refChild</i> is
the empty string, the new nodes will be appended.</dd>
      

      
        <dt>
<b class="method">appendXML</b> <i class="m">XMLstring</i>
</dt>
        <dd>Parses <i class="m">XMLstring</i>, creates an according DOM subtree and
appends this subtree to the current node.</dd>
      

      
        <dt>
<b class="method">simpleTranslate</b> <i class="m">outputVar</i>
<i class="m">specifications</i>
</dt>
        <dd>Translates the subtree starting at the object node according to
the specifications in <i class="m">specifications</i> and outputs the result in the
variable <i class="m">outputVar</i> . The translation is very similar to Cost Simple
mode.</dd>
      

      
        <dt>
<b class="method">toXPath</b> <i class="m">?-legacy?</i>
</dt>
        <dd>Returns an XPath, which exactly addresses the given
node in its document. This XPath is only valid as there are no changes to DOM
tree made later one. With the -legacy option, other XPath expressions
are returned, which doesn't work in all cases.</dd>
      

      
        <dt><b class="method">getBaseURI</b></dt>
        <dd>Returns the baseURI of the node. This method is deprecated in
          favor of the <i class="m">baseURI</i> method.</dd>
      

      
        <dt>
<b class="method">baseURI</b> <i class="m">?URI?</i>
</dt>
        <dd>Returns the present baseURI of the node. If the optional 
argument URI is given, it sets the base URI of the node and of all of its child
nodes out of the same entity as node to the given URI.</dd>
      

      
        <dt>
<b class="method">disableOutputEscaping</b> <i class="m">?boolean?</i>
</dt>
        <dd>This method works only for text nodes; for every other node it
returns error. Without the optional argument it returns, if disabling output
escaping is on. The return value 0 means, the characters of the text node will
be escaped, to generate valid XML, if serialized. This is the default for
every parsed or created text node (with the exception of that text nodes in a
result tree of an XSLT transformation, for which disabling output escaping was
requested explicitly in the stylesheet). The return value 1 means, that output
escaping is disabled for this text node. If such a text node is serialized
(with asXML or asHTML), it is literally written, without escaping of the
special XML characters. If the optional boolean value <i class="m">boolean</i> is given,
the flag is set accordingly. You should not set this flag to 1 until you
really know what you do.</dd>
      

      
        <dt>
<b class="method">precedes</b> <i class="m">refnode</i>
</dt>
        <dd>Compares the relative order of the node and <i class="m">refnode</i>. Both
nodes must be part of the same documents and not out of the fragment list of
the document. Returns true if node is in document order (in the sense of the
XPath 1.0 recommendation) before <i class="m">refnode</i>, and false otherwise.</dd>
      


      
        <dt>
<b class="method">normalize</b> <i class="m">?-forXPath?</i>
</dt>
        <dd>Puts all Text nodes in the full depth of the sub-tree underneath
this Node into a "normal" form where only structure (e.g., elements,
comments, processing instructions and CDATA
sections) separates Text nodes, i.e., there
are neither adjacent Text nodes nor empty Text nodes. If the option
<i class="m">-forXPath</i> is given, all CDATA sections in the nodes are
converted to text nodes, as a first step before the
normalization. </dd>
      

      
        <dt>
<b class="method">xslt</b> <b class="option">?-parameters
parameterList?</b> <b class="option">?-ignoreUndeclaredParameters?</b>
<b class="option">?-maxApplyDepth int?</b>
<b class="option">?-xsltmessagecmd script?</b> <i class="m">stylesheet</i> <i class="m">?outputVar?</i>
</dt>
        <dd>Applies an XSLT transformation on the document using the XSLT
<i class="m">stylesheet</i> (given as domDoc). Returns a document object containing the
result document of that transformation and stores it in the optional
<i class="m">outputVar</i>. 

<p>The optional <i class="m">-parameters</i> option sets top level
&lt;xsl:param&gt; to string values. The <i class="m">parameterList</i> has to be a tcl
list consisting of parameter name and value pairs.</p>

<p>If the option <i class="m">-ignoreUndeclaredParameters</i> is given, then parameter
names in the <i class="m">parameterList</i> given to the <i class="m">-parameters</i> options that
are not declared as top-level parameters in the stylesheet are silently
ignored. Without this option, an error is raised if the user tries to set a
top-level parameter which is not declared in the stylesheet.</p>

<p>The option <i class="m">-maxApplyDepth</i> expects a positive integer as
argument. By default, the xslt engine allows xslt templates to nest up
to 3000 levels (and raises error if they nest deeper). This limit can
be set by the <i class="m">-maxApplyDepth</i> option.</p>

<p>The <i class="m">-xsltmessagecmd</i> option sets a callback for xslt:message elements
in the stylesheet. The actual command consists of the script, given as argument
to the option, appended with the XML Fragment from instantiating the
xsl:message element content as string (as if the XPath string() function would
have been applied to the XML Fragment) and a flag, which indicates whether the
xsl:message has an attribute "terminate" with the value "yes". If the
called script returns anything else then TCL_OK then the xslt
transformation will be aborted, returning error. If the called script
returns -code break the error message is empty, otherwise the result
code is reported. In case of terminated transformation the outputVar,
if given, is set to the empty string.</p>
</dd>
      

      
        <dt><i class="m">@attrName</i></dt>
        <dd>Returns the value of the attribute <i class="m">attrName</i>.  Short cut
for <i class="m">getAttribute</i>.</dd>
      

      
        <dt>
<b class="method">jsonType</b> <i class="m">?OBJECT|ARRAY|NONE)|(STRING|NUMBER|TRUE|FALSE|NULL|NONE)?</i>
</dt>
        <dd>Only element and text nodes may have a JSON type and
        only this types of nodes support the <i class="m">jsonType</i> method;
        the other node types return error if called with this method.
        Returns the jsonType of the node. If the optional argument is
        given, the JSON type of the node is set to the given type and
        returned. Valid type arguments for element nodes are OBJECT,
        ARRAY and NONE. Valid type arguments for text nodes are
        STRING, NUMBER, TRUE, FALSE, NULL and NONE.</dd>
      

    </dl><p>Otherwise, if an unknown method name is given, the command with the same
name as the given method within the namespace <tt class="l">::dom::domNode</tt> is tried to
be executed. This allows quick method additions on Tcl level.</p>


  <h2><a name="SECTid0x561e82ebbf40">SEE ALSO</a></h2><p class="seealso">dom, domDoc</p>
  
  <h2><a name="SECTid0x561e82ebc2d0">KEYWORDS</a></h2><p class="keywords">
<a class="keyword" href="keyword-index.html#KW-XML">XML</a>, <a class="keyword" href="keyword-index.html#KW-DOM">DOM</a>, <a class="keyword" href="keyword-index.html#KW-document">document</a>, <a class="keyword" href="keyword-index.html#KW-node">node</a>, <a class="keyword" href="keyword-index.html#KW-parsing">parsing</a>
</p>
  
</div><hr class="navsep"><div class="navbar" align="center">
<a class="navaid" href="index.html">Contents</a> · <a class="navaid" href="category-index.html">Index</a> · <a class="navaid" href="keyword-index.html">Keywords</a> · <a class="navaid" href="http://tdom.org">Repository</a>
</div>
</body>
</html>