0001 
0002 /*
0003  *  JScripter Standard 1.0 - To Script In Java
0004  *  Copyright (C) 2008-2011  J.J.Liu<jianjunliu@126.com> <http://www.jscripter.org>
0005  *  
0006  *  This program is free software: you can redistribute it and/or modify
0007  *  it under the terms of the GNU Affero General Public License as published by
0008  *  the Free Software Foundation, either version 3 of the License, or
0009  *  (at your option) any later version.
0010  *  
0011  *  This program is distributed in the hope that it will be useful,
0012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
0013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0014  *  GNU Affero General Public License for more details.
0015  *  
0016  *  You should have received a copy of the GNU Affero General Public License
0017  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
0018  */
0019 
0020 package js.user;
0021 
0022 import js.*;
0023 import js.core.*;
0024 
0025 /**
0026  * <p>An <b>opaque</b> class representing JavaScript client-side objects of the global 
0027  * {@link JsClient#Node} class.</p>
0028  * {@link JsWindow#document} object 
0029  * itself) implement this class, which provides the fundamental properties and methods 
0030  * for traversing and manipulating the tree. For Internet Explorer, this class also 
0031  * defines some IE-specific properties and methods for working with XML documents, 
0032  * XPath expressions, and XSLT transforms.</p>
0033  * <p>The {@link #parentNode} property and {@link #childNodes} array allow you to move 
0034  * up and down the document tree. You can enumerate the children of a given node by 
0035  * looping through the elements of {@link #childNodes} array or by using the {@link #firstChild} 
0036  * and {@link #nextSibling} properties, or the {@link #lastChild} and {@link #previousSibling} 
0037  * properties to loop backward. The {@link #appendChild(JsNode)}, {@link #insertBefore(JsNode, JsNode)}, 
0038  * {@link #removeChild(JsNode)}, and {@link #replaceChild(JsNode, JsNode)} methods allow 
0039  * you to modify the document tree by altering the children of a node.</p>
0040  * <p>Every object in a document tree implements both the class and a more specialized 
0041  * subclass, such as {@link JsElement} or {@link JsText}. The {@link #nodeType} property 
0042  * specifies which subclass a node implements. You can use this property to test the 
0043  * type of a node before using properties or methods of the more specialized subclass.</p>
0044  * <p>The {@link #nodeName} and {@link #nodeValue} properties specify additional 
0045  * information about a node, but their value depends on {@link #nodeType}. Note that 
0046  * subclasses typically define specialized properties, such as the {@link JsElement#tagName} 
0047  * property of {@link JsElement} nodes and the {@link JsCharacterData#data} property of 
0048  * {@link JsText} nodes, for obtaining this information.</p>
0049  *
0050  * @author <a href="mailto:jianjunliu@126.com">J.J.Liu (Jianjun Liu)</a> at <a href="http://www.jscripter.org" target="_blank">http://www.jscripter.org</a>
0051  *
0052  * @javascript <b>Opaque</b> types can be resolved but no class objects for them can be
0053  * generated into the target codes. Re-compilers must exit with error on the operations of
0054  * accessing that kind of class objects.
0055  * The <tt>checkcast</tt> operation to the class literal of this interface must be ignored
0056  * and <tt>instanceof</tt> to it always <tt>true</tt>.
0057  */
0058 public class JsNode extends JsClient.Node.Prototype
0059 {
0060     /**
0061      * A legal value for the {@link #nodeType} property of a {@link JsNode} object 
0062      * indicating the type of the node. For the compatibility with IE, you must use 
0063      * this numeric literal directly instead of {@link js.dom.DOM2Core.Node#ELEMENT_NODE}.
0064      * @since 1.0
0065      * @see js.dom.DOM2Core.Node#ELEMENT_NODE
0066      * @see js.dom.DOM2Core.Node.Member#ELEMENT_NODE
0067      */
0068     public static final int ELEMENT_NODE                = 1;
0069     /**
0070      * A legal value for the {@link #nodeType} property of a {@link JsNode} object 
0071      * indicating the type of the node. For the compatibility with IE, you must use 
0072      * this numeric literal directly instead of {@link js.dom.DOM2Core.Node#ATTRIBUTE_NODE}.
0073      * @since 1.0
0074      * @see js.dom.DOM2Core.Node#ATTRIBUTE_NODE
0075      * @see js.dom.DOM2Core.Node.Member#ATTRIBUTE_NODE
0076      */
0077     public static final int ATTRIBUTE_NODE              = 2;
0078     /**
0079      * A legal value for the {@link #nodeType} property of a {@link JsNode} object 
0080      * indicating the type of the node. For the compatibility with IE, you must use 
0081      * this numeric literal directly instead of {@link js.dom.DOM2Core.Node#TEXT_NODE}.
0082      * @since 1.0
0083      * @see js.dom.DOM2Core.Node#TEXT_NODE
0084      * @see js.dom.DOM2Core.Node.Member#TEXT_NODE
0085      */
0086     public static final int TEXT_NODE                   = 3;
0087     /**
0088      * A legal value for the {@link #nodeType} property of a {@link JsNode} object 
0089      * indicating the type of the node. For the compatibility with IE, you must use 
0090      * this numeric literal directly instead of {@link js.dom.DOM2Core.Node#CDATA_SECTION_NODE}.
0091      * @since 1.0
0092      * @see js.dom.DOM2Core.Node#CDATA_SECTION_NODE
0093      * @see js.dom.DOM2Core.Node.Member#CDATA_SECTION_NODE
0094      */
0095     public static final int CDATA_SECTION_NODE          = 4;
0096     /**
0097      * A legal value for the {@link #nodeType} property of a {@link JsNode} object 
0098      * indicating the type of the node. This constant is only defined by DOM specification 
0099      * but not supported in main stream web browsers. It's here for documentation 
0100      * purpose only.
0101      * @since 1.0
0102      */
0103     public static final int ENTITY_REFERENCE_NODE       = 5;
0104     /**
0105      * A legal value for the {@link #nodeType} property of a {@link JsNode} object 
0106      * indicating the type of the node. This constant is only defined by DOM specification 
0107      * but not supported in main stream web browsers. It's here for documentation 
0108      * purpose only.
0109      * @since 1.0
0110      */
0111     public static final int ENTITY_NODE                 = 6;
0112     /**
0113      * A legal value for the {@link #nodeType} property of a {@link JsNode} object 
0114      * indicating the type of the node. For the compatibility with IE, you must use 
0115      * this numeric literal directly instead of {@link js.dom.DOM2Core.Node#PROCESSING_INSTRUCTION_NODE}.
0116      * @since 1.0
0117      * @see js.dom.DOM2Core.Node#PROCESSING_INSTRUCTION_NODE
0118      * @see js.dom.DOM2Core.Node.Member#PROCESSING_INSTRUCTION_NODE
0119      */
0120     public static final int PROCESSING_INSTRUCTION_NODE = 7;
0121     /**
0122      * A legal value for the {@link #nodeType} property of a {@link JsNode} object 
0123      * indicating the type of the node. For the compatibility with IE, you must use 
0124      * this numeric literal directly instead of {@link js.dom.DOM2Core.Node#COMMENT_NODE}.
0125      * @since 1.0
0126      * @see js.dom.DOM2Core.Node#COMMENT_NODE
0127      * @see js.dom.DOM2Core.Node.Member#COMMENT_NODE
0128      */
0129     public static final int COMMENT_NODE                = 8;
0130     /**
0131      * A legal value for the {@link #nodeType} property of a {@link JsNode} object 
0132      * indicating the type of the node. For the compatibility with IE, you must use 
0133      * this numeric literal directly instead of {@link js.dom.DOM2Core.Node#DOCUMENT_NODE}.
0134      * @since 1.0
0135      * @see js.dom.DOM2Core.Node#DOCUMENT_NODE
0136      * @see js.dom.DOM2Core.Node.Member#DOCUMENT_NODE
0137      */
0138     public static final int DOCUMENT_NODE               = 9;
0139     /**
0140      * A legal value for the {@link #nodeType} property of a {@link JsNode} object 
0141      * indicating the type of the node. For the compatibility with IE, you must use 
0142      * this numeric literal directly instead of {@link js.dom.DOM2Core.Node#DOCUMENT_TYPE_NODE}.
0143      * @since 1.0
0144      * @see js.dom.DOM2Core.Node#DOCUMENT_TYPE_NODE
0145      * @see js.dom.DOM2Core.Node.Member#DOCUMENT_TYPE_NODE
0146      */
0147     public static final int DOCUMENT_TYPE_NODE          = 10;
0148     /**
0149      * A legal value for the {@link #nodeType} property of a {@link JsNode} object 
0150      * indicating the type of the node. For the compatibility with IE, you must use 
0151      * this numeric literal directly instead of {@link js.dom.DOM2Core.Node#DOCUMENT_FRAGMENT_NODE}.
0152      * @since 1.0
0153      * @see js.dom.DOM2Core.Node#DOCUMENT_FRAGMENT_NODE
0154      * @see js.dom.DOM2Core.Node.Member#DOCUMENT_FRAGMENT_NODE
0155      */
0156     public static final int DOCUMENT_FRAGMENT_NODE      = 11;
0157     /**
0158      * A legal value for the {@link #nodeType} property of a {@link JsNode} object 
0159      * indicating the type of the node. This constant is only defined by DOM specification 
0160      * but not supported in main stream web browsers. It's here for documentation 
0161      * purpose only.
0162      * @since 1.0
0163      */
0164     public static final int NOTATION_NODE               = 12;
0165 
0166     /**
0167      * <p>An <b>internal</b> class containing membership data for its enclosing
0168      * opaque class.</p>
0169      * <p>This class is only used inside of <b>opaque</b> or <b>internal</b> classes or
0170      * class members.</p>
0171      *
0172      * @author <a href="mailto:jianjunliu@126.com">J.J.Liu (Jianjun Liu)</a> at <a href="http://www.jscripter.org" target="_blank">http://www.jscripter.org</a>
0173      * 
0174      * @javascript Re-compilers must report error on resolving an <b>internal</b> class.
0175      */
0176     protected static abstract class Members extends JsClient.Node.Prototype.Members
0177     {
0178         /**
0179          * <p>An <b>internal</b> static field defining a member ID of the field name and
0180          * used internally to define a member of the same name.</p>
0181          * @since 1.0
0182          * @see JsNode#attributes
0183          * @see JsNode.Member#attributes
0184          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
0185          */
0186         public final static Mid attributes      = id("attributes"     );
0187         /**
0188          * <p>An <b>internal</b> static field defining a member ID of the field name and
0189          * used internally to define a member of the same name.</p>
0190          * @since 1.0
0191          * @see JsNode#childNodes
0192          * @see JsNode.Member#childNodes
0193          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
0194          */
0195         public final static Mid childNodes      = id("childNodes"     );
0196         /**
0197          * <p>An <b>internal</b> static field defining a member ID of the field name and
0198          * used internally to define a member of the same name.</p>
0199          * @since 1.0
0200          * @see JsNode#firstChild
0201          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
0202          */
0203         public final static Mid firstChild      = id("firstChild"     );
0204         /**
0205          * <p>An <b>internal</b> static field defining a member ID of the field name and
0206          * used internally to define a member of the same name.</p>
0207          * @since 1.0
0208          * @see JsNode#lastChild
0209          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
0210          */
0211         public final static Mid lastChild       = id("lastChild"      );
0212         /**
0213          * <p>An <b>internal</b> static field defining a member ID of the field name and
0214          * used internally to define a member of the same name.</p>
0215          * @since 1.0
0216          * @see JsNode#localName
0217          * @see JsNode.Member#localName
0218          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
0219          */
0220         public final static Mid localName       = id("localName"      );
0221         /**
0222          * <p>An <b>internal</b> static field defining a member ID of the field name and
0223          * used internally to define a member of the same name.</p>
0224          * @since 1.0
0225          * @see JsNode#namespaceURI
0226          * @see JsNode.Member#namespaceURI
0227          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
0228          */
0229         public final static Mid namespaceURI    = id("namespaceURI"   );
0230         /**
0231          * <p>An <b>internal</b> static field defining a member ID of the field name and
0232          * used internally to define a member of the same name.</p>
0233          * @since 1.0
0234          * @see JsNode#nextSibling
0235          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
0236          */
0237         public final static Mid nextSibling     = id("nextSibling"    );
0238         /**
0239          * <p>An <b>internal</b> static field defining a member ID of the field name and
0240          * used internally to define a member of the same name.</p>
0241          * @since 1.0
0242          * @see JsNode#nodeName
0243          * @see JsNode.Member#nodeName
0244          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
0245          */
0246         public final static Mid nodeName        = id("nodeName"       );
0247         /**
0248          * <p>An <b>internal</b> static field defining a member ID of the field name and
0249          * used internally to define a member of the same name.</p>
0250          * @since 1.0
0251          * @see JsNode#nodeType
0252          * @see JsNode.Member#nodeType
0253          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
0254          */
0255         public final static Mid nodeType        = id("nodeType"       );
0256         /**
0257          * <p>An <b>internal</b> static field defining a member ID of the field name and
0258          * used internally to define a member of the same name.</p>
0259          * @since 1.0
0260          * @see JsNode#nodeValue
0261          * @see JsNode.Member#nodeValue
0262          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
0263          */
0264         public final static Mid nodeValue       = id("nodeValue"      );
0265         /**
0266          * <p>An <b>internal</b> static field defining a member ID of the field name and
0267          * used internally to define a member of the same name.</p>
0268          * @since 1.0
0269          * @see JsNode#ownerDocument
0270          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
0271          */
0272         public final static Mid ownerDocument   = id("ownerDocument"  );
0273         /**
0274          * <p>An <b>internal</b> static field defining a member ID of the field name and
0275          * used internally to define a member of the same name.</p>
0276          * @since 1.0
0277          * @see JsNode#parentNode
0278          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
0279          */
0280         public final static Mid parentNode      = id("parentNode"     );
0281         /**
0282          * <p>An <b>internal</b> static field defining a member ID of the field name and
0283          * used internally to define a member of the same name.</p>
0284          * @since 1.0
0285          * @see JsNode#prefix
0286          * @see JsNode.Member#prefix
0287          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
0288          */
0289         public final static Mid prefix          = id("prefix"         );
0290         /**
0291          * <p>An <b>internal</b> static field defining a member ID of the field name and
0292          * used internally to define a member of the same name.</p>
0293          * @since 1.0
0294          * @see JsNode#previousSibling
0295          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
0296          */
0297         public final static Mid previousSibling = id("previousSibling");
0298         /**
0299          * <p>An <b>internal</b> static field defining a member ID of the field name and
0300          * used internally to define a member of the same name.</p>
0301          * @since 1.0
0302          * @see JsNode#xml
0303          * @see JsNode.Member#xml
0304          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
0305          */
0306         public final static Mid xml             = id("xml"            );
0307     }
0308     /**
0309      * <p>An <b>opaque</b> class representing members of its enclosing <b>opaque</b> type.</p>
0310      * <p>Note that, this class is <b>opaque</b> but its constructors are all <b>internal</b>. 
0311      * This class and the subclasses of this class are used to declare either <b>opaque</b> 
0312      * <tt>public</tt> instance fields of the opaque type {@link js.Var.Member} or the 
0313      * <b>opaque</b> <tt>public</tt> static fields of other <b>opaque</b> types while their 
0314      * constructors are used to define the fields inside <b>opaque</b> classes. Under 
0315      * either circumstance, the field names must be exactly same as the member names, as 
0316      * the <b>opaque</b> fields of <b>opaque</b> types are resolved by re-compilers directly 
0317      * based on the field names.</p>
0318      *
0319      * @author <a href="mailto:jianjunliu@126.com">J.J.Liu (Jianjun Liu)</a> at <a href="http://www.jscripter.org" target="_blank">http://www.jscripter.org</a>
0320      * 
0321      * @javascript <b>Opaque</b> types can be resolved but no class objects for them can be created
0322      * in the target codes. Re-compilers must exit with error on operations accessing that kind 
0323      * of class objects.
0324      * Re-compilers must resolve an <b>opaque</b> instance field declared by this class in
0325      * {@link js.Var.Member} or its subclasses to the JavaScript identifier: 
0326      * <pre>q.m</pre>
0327      * where <tt>m</tt> is the identifier of the field name and <tt>q</tt> is the identifier
0328      * resolved from the instance of the enclosing member. Re-compilers must resolve an 
0329      * <b>opaque</b> static field declared by this class in <b>opaque</b> types other than 
0330      * {@link js.Var.Member} and its subclasses to the JavaScript identifier: 
0331      * <pre>m</pre>
0332      * where <tt>m</tt> is the identifier of the field name. And re-compilers must report
0333      * error on the access to <b>opaque</b> fields declared by this class under any other 
0334      * circumstances.
0335      */
0336     public static class Member extends JsClient.Node.Prototype.Member
0337     {
0338         /**
0339          * <p>Internally constructs a member based on a qualifying member.</p>
0340          * <p>This constructor is <b>internal</b> and only called inside of <b>opaque</b>
0341          * or <b>internal</b> classes or class members.</p>
0342          * <p>Note that, this constructor is <b>internal</b> but its declaring class is
0343          * <b>opaque</b>. This constructor is used to define <b>opaque</b> instance fields 
0344          * declared in the declaring class of this constructor itself or its subclasses. 
0345          * Under this circumstance, the field names must be exactly same as the member 
0346          * names, as the <b>opaque</b> instance fields of the <b>opaque</b> type 
0347          * {@link js.Var.Member} or its subclasses are resolved by re-compilers directly
0348          * to their names appending to the name resolved from the specified qualifying 
0349          * member with a dot in between.</p>
0350          * @param q A qualifying member
0351          * @param mid The ID of the member to construct
0352          * @since 1.0
0353          * @javascript Re-compilers must report error on the invocation to an <b>internal</b> constructor.
0354          */
0355         public Member(JsObject.Member q, Mid mid) {
0356             super(q, mid);
0357         }
0358         /**
0359          * <p>Internally constructs a member without a qualifying member.</p>
0360          * <p>This constructor is <b>internal</b> and only called inside of <b>opaque</b>
0361          * or <b>internal</b> classes or class members.</p>
0362          * <p>Note that, this constructor is <b>internal</b> but its declaring class is
0363          * <b>opaque</b>. This constructor is used to define <b>opaque</b> static fields, 
0364          * declared in <b>opaque</b> types other than the declaring class of this constructor 
0365          * itself and its subclasses. Under this circumstance, the field names must be
0366          * exactly same as the member names, as the <b>opaque</b> static fields of <b>opaque</b>
0367          * types are generally resolved by re-compilers directly to identifiers of their names.</p>
0368          * @param mid The ID of the member to construct
0369          * @since 1.0
0370          * @javascript Re-compilers must report error on the invocation to an <b>internal</b> constructor.
0371          */
0372         public Member(Mid mid) {
0373             super(mid);
0374         }
0375         @Override
0376         /**
0377          * <p>Evaluates the property, represented by the current member instance, of the
0378          * argument object.</p>
0379          * @param o The argument object
0380          * @return The value of the current member based on the object argument.
0381          * @since 1.0
0382          * @javascript Re-compilers must convert the instance invocation of this method into
0383          * the JavaScript expression: 
0384          * <pre>o.m</pre>
0385          * where <tt>m</tt> is the identifier name resolved from the current member
0386          * instance of the invocation.
0387          */
0388         public JsNode with(ObjectLike o) {
0389             return new JsNode(super.with(o));
0390         }
0391 
0392         /**
0393          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
0394          * name of this field, qualified by the current member instance of the field, and 
0395          * to access the property of the name on an object.</p>
0396          * <p>The property, identified by this member, of a {@link JsElement} object 
0397          * refers to a read-only array of {@link JsAttr} nodes that represent the 
0398          * attributes of that element. Note that this array is live: any changes to the 
0399          * attributes of the element are immediately visible through it.</p>
0400          * <p>Technically, the array is of <tt>NamedNodeMap</tt> interface which is 
0401          * specified by the Level 1 DOM standard and defines a number of methods for 
0402          * querying, setting, and removing elements. {@link JsElement} defines better 
0403          * methods for setting and querying element attributes, and there are no other 
0404          * uses of <tt>NamedNodeMap</tt> that are relevant to client-side JavaScript. 
0405          * Treat the {@link #attributes} property as a read-only array of {@link JsAttr} 
0406          * objects, or use the methods defined by {@link JsElement} to query, set, and 
0407          * delete attributes.</p>
0408          * @since 1.0
0409          * @javascript Re-compilers must resolve the member of this instance field to the
0410          * identifier of the field name appending to the identifier resolved from its 
0411          * qualifying member with a dot in between.
0412          */
0413         public final JsArray.Member attributes = new JsArray.Member(this, Members.attributes);
0414         /**
0415          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
0416          * name of this field, qualified by the current member instance of the field, and 
0417          * to access the property of the name on an object.</p>
0418          * <p>The property, identified by this member, of a {@link JsNode} object 
0419          * refers to a read-only array containing the child nodes of the current node. 
0420          * This property should never be <tt>null</tt> and for nodes with no children, 
0421          * the length of the array is zero. The property is actually a {@link JsNodeList} 
0422          * object, but it behaves just like a read-only array of {@link JsNode} objects. 
0423          * Note that the {@link JsNodeList} object is live: any changes to this element's 
0424          * list of children are immediately visible through the {@link JsNodeList} object.</p>
0425          * @since 1.0
0426          * @javascript Re-compilers must resolve the member of this instance field to the
0427          * identifier of the field name appending to the identifier resolved from its 
0428          * qualifying member with a dot in between.
0429          */
0430         public final JsNodeList.Member<?> childNodes = new JsNodeList.Member<JsNode>(this, Members.childNodes);
0431         /**
0432          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
0433          * name of this field, qualified by the current member instance of the field, and 
0434          * to access the property of the name on an object.</p>
0435          * <p>The property, identified by this member, of a {@link JsNode} object 
0436          * refers to a read-only string specifying the local part of the element or 
0437          * attribute name for XML documents that use name spaces. The property is never 
0438          * used with HTML documents.</p>
0439          * @since 1.0
0440          * @see #namespaceURI
0441          * @see #prefix
0442          * @javascript Re-compilers must resolve the member of this instance field to the
0443          * identifier of the field name appending to the identifier resolved from its 
0444          * qualifying member with a dot in between.
0445          */
0446         public final Value.String.Member localName      = new Value.String.Member(this, Members.localName   );
0447         /**
0448          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
0449          * name of this field, qualified by the current member instance of the field, and 
0450          * to access the property of the name on an object.</p>
0451          * <p>The property, identified by this member, of a {@link JsElement} or {@link JsAttr} object 
0452          * refers to a read-only string specifying URI of the name space of the node for 
0453          * XML documents that use name spaces. The property is never used with HTML 
0454          * documents.</p>
0455          * @since 1.0
0456          * @see #localName
0457          * @see #prefix
0458          * @javascript Re-compilers must resolve the member of this instance field to the
0459          * identifier of the field name appending to the identifier resolved from its 
0460          * qualifying member with a dot in between.
0461          */
0462         public final Value.String.Member namespaceURI   = new Value.String.Member(this, Members.namespaceURI);
0463         /**
0464          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
0465          * name of this field, qualified by the current member instance of the field, and 
0466          * to access the property of the name on an object.</p>
0467          * <p>The property, identified by this member, of a {@link JsNode} object 
0468          * refers to a read-only string specifying the name of the node. For {@link JsElement} 
0469          * nodes, it specifies the tag name of the element, which can also be retrieved 
0470          * with the {@link JsElement#tagName} property. For other types of nodes, the 
0471          * value of {@link #nodeName} depends on the node type:
0472          * <ul>
0473          * <li>{@link JsNode#ELEMENT_NODE}: The element's tag name.</li>
0474          * <li>{@link JsNode#ATTRIBUTE_NODE}: The attribute name.</li>
0475          * <li>{@link JsNode#TEXT_NODE}: "#text"</li>
0476          * <li>{@link JsNode#CDATA_SECTION_NODE}: "#cdata-section"</li>
0477          * <li>{@link JsNode#PROCESSING_INSTRUCTION_NODE}: The target of the PI.</li>
0478          * <li>{@link JsNode#COMMENT_NODE}: "#comment"</li>
0479          * <li>{@link JsNode#DOCUMENT_NODE}: "#document"</li>
0480          * <li>{@link JsNode#DOCUMENT_TYPE_NODE}: The document type name.</li>
0481          * <li>{@link JsNode#DOCUMENT_FRAGMENT_NODE}: "#document-fragment"</li>
0482          * </ul></p>
0483          * @since 1.0
0484          * @javascript Re-compilers must resolve the member of this instance field to the
0485          * identifier of the field name appending to the identifier resolved from its 
0486          * qualifying member with a dot in between.
0487          */
0488         public final Value.String.Member nodeName       = new Value.String.Member(this, Members.nodeName    );
0489         /**
0490          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
0491          * name of this field, qualified by the current member instance of the field, and 
0492          * to access the property of the name on an object.</p>
0493          * <p>The property, identified by this member, of a {@link JsNode} object 
0494          * refers to a read-only integer value represents the type of the node specifying which 
0495          * sub-interface the node implements. The legal values are:
0496          * <ul>
0497          * <li>{@link js.dom.DOM2Core.Node#ELEMENT_NODE} or {@link JsNode#ELEMENT_NODE} for {@link JsElement} nodes</li>
0498          * <li>{@link js.dom.DOM2Core.Node#ATTRIBUTE_NODE} or {@link JsNode#ATTRIBUTE_NODE} for {@link JsAttr} nodes</li>
0499          * <li>{@link js.dom.DOM2Core.Node#TEXT_NODE} or {@link JsNode#TEXT_NODE} for {@link JsText} nodes</li>
0500          * <li>{@link js.dom.DOM2Core.Node#CDATA_SECTION_NODE} or {@link JsNode#CDATA_SECTION_NODE} for {@link JsCDATASection} nodes</li>
0501          * <li>{@link js.dom.DOM2Core.Node#PROCESSING_INSTRUCTION_NODE} or {@link JsNode#PROCESSING_INSTRUCTION_NODE} for {@link JsProcessingInstruction} nodes</li>
0502          * <li>{@link js.dom.DOM2Core.Node#COMMENT_NODE} or {@link JsNode#COMMENT_NODE} for {@link JsComment} nodes</li>
0503          * <li>{@link js.dom.DOM2Core.Node#DOCUMENT_NODE} or {@link JsNode#DOCUMENT_NODE} for {@link JsDocument} nodes</li>
0504          * <li>{@link js.dom.DOM2Core.Node#DOCUMENT_TYPE_NODE} or {@link JsNode#DOCUMENT_TYPE_NODE} for {@link JsDocumentType} nodes</li>
0505          * <li>{@link js.dom.DOM2Core.Node#DOCUMENT_FRAGMENT_NODE} or {@link JsNode#DOCUMENT_FRAGMENT_NODE} for {@link JsDocumentFragment} nodes</li>
0506          * </ul>
0507          * For the compatibility with IE, you must use the static numeric literals 
0508          * {@link JsClient#Node}.</p>
0509          * @since 1.0
0510          * @javascript Re-compilers must resolve the member of this instance field to the
0511          * identifier of the field name appending to the identifier resolved from its 
0512          * qualifying member with a dot in between.
0513          */
0514         public final Value.Number.Member nodeType       = new Value.Number.Member(this, Members.nodeType    );
0515         /**
0516          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
0517          * name of this field, qualified by the current member instance of the field, and 
0518          * to access the property of the name on an object.</p>
0519          * <p>The property, identified by this member, of a {@link JsNode} object 
0520          * refers to a read-only string specifying the value of the node. For {@link JsText} 
0521          * nodes, it holds the text content. For other types of nodes, the value depends 
0522          * on the value of {@link #nodeType}:
0523          * <ul>
0524          * <li>{@link JsNode#ELEMENT_NODE}: <tt>null</tt></li>
0525          * <li>{@link JsNode#ATTRIBUTE_NODE}: The attribute value.</li>
0526          * <li>{@link JsNode#TEXT_NODE}: The text of the node.</li>
0527          * <li>{@link JsNode#CDATA_SECTION_NODE}: The text of the node.</li>
0528          * <li>{@link JsNode#PROCESSING_INSTRUCTION_NODE}: The remainder of the PI.</li>
0529          * <li>{@link JsNode#COMMENT_NODE}: The text of the comment.</li>
0530          * <li>{@link JsNode#DOCUMENT_NODE}: <tt>null</tt></li>
0531          * <li>{@link JsNode#DOCUMENT_TYPE_NODE}: <tt>null</tt></li>
0532          * <li>{@link JsNode#DOCUMENT_FRAGMENT_NODE}: <tt>null</tt></li>
0533          * </ul></p>
0534          * @since 1.0
0535          * @javascript Re-compilers must resolve the member of this instance field to the
0536          * identifier of the field name appending to the identifier resolved from its 
0537          * qualifying member with a dot in between.
0538          */
0539         public final Value.String.Member nodeValue      = new Value.String.Member(this, Members.nodeValue   );
0540         /**
0541          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
0542          * name of this field, qualified by the current member instance of the field, and 
0543          * to access the property of the name on an object.</p>
0544          * <p>The property, identified by this member, of a {@link JsElement} or {@link JsAttr} object 
0545          * refers to a read-only string specifying the name space prefix of the node for 
0546          * XML documents that use name spaces. The property is never used with HTML 
0547          * documents.</p>
0548          * @since 1.0
0549          * @javascript Re-compilers must resolve the member of this instance field to the
0550          * identifier of the field name appending to the identifier resolved from its 
0551          * qualifying member with a dot in between.
0552          */
0553         public final Value.String.Member prefix         = new Value.String.Member(this, Members.prefix      );
0554         /**
0555          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
0556          * name of this field, qualified by the current member instance of the field, and 
0557          * to access the property of the name on an object.</p>
0558          * <p>The property, identified by this member, of a {@link JsElement} or {@link JsAttr} object 
0559          * refers to a read-only string specifying the text of the XML document or an element within an 
0560          * XML document.</p> 
0561          * <p>Note that the property is IE-Specific. Compare this property to the {@link JsHTMLElement#innerHTML} 
0562          * property, and see {@link JsXMLSerializer} for a cross-platform alternative.</p>
0563          * @since 1.0
0564          * @see JsHTMLElement#innerHTML
0565          * @see JsXMLSerializer
0566          * @javascript Re-compilers must resolve the member of this instance field to the
0567          * identifier of the field name appending to the identifier resolved from its 
0568          * qualifying member with a dot in between.
0569          */
0570         public final Value.String.Member xml            = new Value.String.Member(this, Members.xml         );
0571     }
0572 
0573     /**
0574      * <p>Casts an <b>opaque</b> object to the current <b>opaque</b> type by wrapping it
0575      * with the wrapping constructor.</p>
0576      * @param var The argument of an <b>opaque</b> object.
0577      * @since 1.0
0578      * @javascript Re-compilers must ignore the construction operation of this constructor,
0579      * that is, replacing it with its only argument.
0580      */
0581     public JsNode(JsObject var) {
0582         super(var);
0583     }
0584 
0585     /**
0586      * <p>An <b>opaque</b> static field defining a member that is named by the field name
0587      * without a qualifying member and to access the property of the name on an object.</p>
0588      * <p>The property, identified by this member, of a {@link JsElement} object 
0589      * refers to a read-only array of {@link JsAttr} nodes that represent the 
0590      * attributes of that element. Note that this array is live: any changes to the 
0591      * attributes of the element are immediately visible through it.</p>
0592      * <p>Technically, the array is of <tt>NamedNodeMap</tt> interface which is 
0593      * specified by the Level 1 DOM standard and defines a number of methods for 
0594      * querying, setting, and removing elements. {@link JsElement} defines better 
0595      * methods for setting and querying element attributes, and there are no other 
0596      * uses of <tt>NamedNodeMap</tt> that are relevant to client-side JavaScript. 
0597      * Treat the {@link #attributes} property as a read-only array of {@link JsAttr} 
0598      * objects, or use the methods defined by {@link JsElement} to query, set, and 
0599      * delete attributes.</p>
0600      * @since 1.0
0601      * @javascript Re-compilers must resolve the member of this static field to the
0602      * identifier of the field name.
0603      */
0604     public static final JsArray.Member attributes = new JsArray.Member(Members.attributes);
0605     /**
0606      * <p>An <b>opaque</b> static field defining a member that is named by the field name
0607      * without a qualifying member and to access the property of the name on an object.</p>
0608      * <p>The property, identified by this member, of a {@link JsNode} object 
0609      * refers to a read-only array containing the child nodes of the current node. 
0610      * This property should never be <tt>null</tt> and for nodes with no children, 
0611      * the length of the array is zero. The property is actually a {@link JsNodeList} 
0612      * object, but it behaves just like a read-only array of {@link JsNode} objects. 
0613      * Note that the {@link JsNodeList} object is live: any changes to this element's 
0614      * list of children are immediately visible through the {@link JsNodeList} object.</p>
0615      * @since 1.0
0616      * @javascript Re-compilers must resolve the member of this static field to the
0617      * identifier of the field name.
0618      */
0619     public static final JsNodeList.Member<?> childNodes = new JsNodeList.Member<JsNode>(Members.childNodes);
0620     /**
0621      * <p>An <b>opaque</b> static field defining a member that is named by the field name
0622      * without a qualifying member and to access the property of the name on an object.</p>
0623      * <p>The property, identified by this member, of a {@link JsNode} object is a 
0624      * read-only reference to the first child of the node, or <tt>null</tt> if the node 
0625      * has no children.</p>
0626      * @since 1.0
0627      * @javascript Re-compilers must resolve the member of this static field to the
0628      * identifier of the field name.
0629      */
0630     public static final JsNode.Member firstChild      = new JsNode.Member(Members.firstChild     );
0631     /**
0632      * <p>An <b>opaque</b> static field defining a member that is named by the field name
0633      * without a qualifying member and to access the property of the name on an object.</p>
0634      * <p>The property, identified by this member, of a {@link JsNode} object is a 
0635      * read-only reference to the last child of the node, or <tt>null</tt> if the node 
0636      * has no children.</p>
0637      * @since 1.0
0638      * @javascript Re-compilers must resolve the member of this static field to the
0639      * identifier of the field name.
0640      */
0641     public static final JsNode.Member lastChild       = new JsNode.Member(Members.lastChild      );
0642     /**
0643      * <p>An <b>opaque</b> static field defining a member that is named by the field name
0644      * without a qualifying member and to access the property of the name on an object.</p>
0645      * <p>The property, identified by this member, of a {@link JsNode} object is a 
0646      * read-only reference to the sibling node that immediately follows the current node 
0647      * in the {@link JsNode#childNodes} array of the {@link #parentNode} of the current 
0648      * one, or <tt>null</tt> if there is no such node.</p>
0649      * @since 1.0
0650      * @javascript Re-compilers must resolve the member of this static field to the
0651      * identifier of the field name.
0652      */
0653     public static final JsNode.Member nextSibling     = new JsNode.Member(Members.nextSibling    );
0654     /**
0655      * <p>An <b>opaque</b> static field defining a member that is named by the field name
0656      * without a qualifying member and to access the property of the name on an object.</p>
0657      * <p>The property, identified by this member, of a {@link JsNode} object is a 
0658      * read-only reference to the parent or container node of that node, or <tt>null</tt> 
0659      * if there is no parent. Note that the {@link JsDocument}, {@link JsDocumentFragment}, 
0660      * and {@link JsAttr} nodes never have parent nodes. Also, nodes that have been 
0661      * removed from the document, or that are newly created and have not yet been 
0662      * inserted into the document tree, have a {@link #parentNode} of <tt>null</tt>.</p> 
0663      * @since 1.0
0664      * @javascript Re-compilers must resolve the member of this static field to the
0665      * identifier of the field name.
0666      */
0667     public static final JsNode.Member parentNode      = new JsNode.Member(Members.parentNode     );
0668     /**
0669      * <p>An <b>opaque</b> static field defining a member that is named by the field name
0670      * without a qualifying member and to access the property of the name on an object.</p>
0671      * <p>The property, identified by this member, of a {@link JsNode} object is a 
0672      * read-only reference to the sibling node that immediately precedes the current node 
0673      * in the {@link JsNode#childNodes} array of the {@link #parentNode} of the current 
0674      * one, or <tt>null</tt> if there is no such node.</p>
0675      * @since 1.0
0676      * @javascript Re-compilers must resolve the member of this static field to the
0677      * identifier of the field name.
0678      */
0679     public static final JsNode.Member previousSibling = new JsNode.Member(Members.previousSibling);
0680     /**
0681      * <p>An <b>opaque</b> static field defining a member that is named by the field name
0682      * without a qualifying member and to access the property of the name on an object.</p>
0683      * <p>The property, identified by this member, of a {@link JsNode} object is a 
0684      * read-only reference to the {@link JsDocument} object of which the node is a part. 
0685      * For {@link JsDocument} nodes, the property is <tt>null</tt>.</p>
0686      * @since 1.0
0687      * @javascript Re-compilers must resolve the member of this static field to the
0688      * identifier of the field name.
0689      */
0690     public static final JsDocument.Member ownerDocument = new JsDocument.Member(Members.ownerDocument);
0691     /**
0692      * <p>An <b>opaque</b> static field defining a member that is named by the field name
0693      * without a qualifying member and to access the property of the name on an object.</p>
0694      * <p>The property, identified by this member, of a {@link JsNode} object 
0695      * refers to a read-only string specifying the local part of the element or 
0696      * attribute name for XML documents that use name spaces. The property is never 
0697      * used with HTML documents.</p>
0698      * @since 1.0
0699      * @see #namespaceURI
0700      * @see #prefix
0701      * @javascript Re-compilers must resolve the member of this static field to the
0702      * identifier of the field name.
0703      */
0704     public static final Value.String.Member localName      = new Value.String.Member(Members.localName   );
0705     /**
0706      * <p>An <b>opaque</b> static field defining a member that is named by the field name
0707      * without a qualifying member and to access the property of the name on an object.</p>
0708      * <p>The property, identified by this member, of a {@link JsElement} or {@link JsAttr} object 
0709      * refers to a read-only string specifying URI of the name space of the node for 
0710      * XML documents that use name spaces. The property is never used with HTML 
0711      * documents.</p>
0712      * @since 1.0
0713      * @see #localName
0714      * @see #prefix
0715      * @javascript Re-compilers must resolve the member of this static field to the
0716      * identifier of the field name.
0717      */
0718     public static final Value.String.Member namespaceURI   = new Value.String.Member(Members.namespaceURI);
0719     /**
0720      * <p>An <b>opaque</b> static field defining a member that is named by the field name
0721      * without a qualifying member and to access the property of the name on an object.</p>
0722      * <p>The property, identified by this member, of a {@link JsNode} object 
0723      * refers to a read-only string specifying the name of the node. For {@link JsElement} 
0724      * nodes, it specifies the tag name of the element, which can also be retrieved 
0725      * with the {@link JsElement#tagName} property. For other types of nodes, the 
0726      * value of {@link #nodeName} depends on the node type:
0727      * <ul>
0728      * <li>{@link #ELEMENT_NODE}: The element's tag name.</li>
0729      * <li>{@link #ATTRIBUTE_NODE}: The attribute name.</li>
0730      * <li>{@link #TEXT_NODE}: "#text"</li>
0731      * <li>{@link #CDATA_SECTION_NODE}: "#cdata-section"</li>
0732      * <li>{@link #PROCESSING_INSTRUCTION_NODE}: The target of the PI.</li>
0733      * <li>{@link #COMMENT_NODE}: "#comment"</li>
0734      * <li>{@link #DOCUMENT_NODE}: "#document"</li>
0735      * <li>{@link #DOCUMENT_TYPE_NODE}: The document type name.</li>
0736      * <li>{@link #DOCUMENT_FRAGMENT_NODE}: "#document-fragment"</li>
0737      * </ul></p>
0738      * @since 1.0
0739      * @javascript Re-compilers must resolve the member of this static field to the
0740      * identifier of the field name.
0741      */
0742     public static final Value.String.Member nodeName       = new Value.String.Member(Members.nodeName    );
0743     /**
0744      * <p>An <b>opaque</b> static field defining a member that is named by the field name
0745      * without a qualifying member and to access the property of the name on an object.</p>
0746      * <p>The property, identified by this member, of a {@link JsNode} object 
0747      * refers to a read-only integer value represents the type of the node specifying which 
0748      * sub-interface the node implements. The legal values are:
0749      * <ul>
0750      * <li>{@link js.dom.DOM2Core.Node#ELEMENT_NODE} or {@link #ELEMENT_NODE} for {@link JsElement} nodes</li>
0751      * <li>{@link js.dom.DOM2Core.Node#ATTRIBUTE_NODE} or {@link #ATTRIBUTE_NODE} for {@link JsAttr} nodes</li>
0752      * <li>{@link js.dom.DOM2Core.Node#TEXT_NODE} or {@link #TEXT_NODE} for {@link JsText} nodes</li>
0753      * <li>{@link js.dom.DOM2Core.Node#CDATA_SECTION_NODE} or {@link #CDATA_SECTION_NODE} for {@link JsCDATASection} nodes</li>
0754      * <li>{@link js.dom.DOM2Core.Node#PROCESSING_INSTRUCTION_NODE} or {@link #PROCESSING_INSTRUCTION_NODE} for {@link JsProcessingInstruction} nodes</li>
0755      * <li>{@link js.dom.DOM2Core.Node#COMMENT_NODE} or {@link #COMMENT_NODE} for {@link JsComment} nodes</li>
0756      * <li>{@link js.dom.DOM2Core.Node#DOCUMENT_NODE} or {@link #DOCUMENT_NODE} for {@link JsDocument} nodes</li>
0757      * <li>{@link js.dom.DOM2Core.Node#DOCUMENT_TYPE_NODE} or {@link #DOCUMENT_TYPE_NODE} for {@link JsDocumentType} nodes</li>
0758      * <li>{@link js.dom.DOM2Core.Node#DOCUMENT_FRAGMENT_NODE} or {@link #DOCUMENT_FRAGMENT_NODE} for {@link JsDocumentFragment} nodes</li>
0759      * </ul>
0760      * For the compatibility with IE, you must use the static numeric literals 
0761      * {@link JsClient#Node}.</p>
0762      * @since 1.0
0763      * @javascript Re-compilers must resolve the member of this static field to the
0764      * identifier of the field name.
0765      */
0766     public static final Value.Number.Member nodeType       = new Value.Number.Member(Members.nodeType    );
0767     /**
0768      * <p>An <b>opaque</b> static field defining a member that is named by the field name
0769      * without a qualifying member and to access the property of the name on an object.</p>
0770      * <p>The property, identified by this member, of a {@link JsNode} object 
0771      * refers to a read-only string specifying the value of the node. For {@link JsText} 
0772      * nodes, it holds the text content. For other types of nodes, the value depends 
0773      * on the value of {@link #nodeType}:
0774      * <ul>
0775      * <li>{@link #ELEMENT_NODE}: <tt>null</tt></li>
0776      * <li>{@link #ATTRIBUTE_NODE}: The attribute value.</li>
0777      * <li>{@link #TEXT_NODE}: The text of the node.</li>
0778      * <li>{@link #CDATA_SECTION_NODE}: The text of the node.</li>
0779      * <li>{@link #PROCESSING_INSTRUCTION_NODE}: The remainder of the PI.</li>
0780      * <li>{@link #COMMENT_NODE}: The text of the comment.</li>
0781      * <li>{@link #DOCUMENT_NODE}: <tt>null</tt></li>
0782      * <li>{@link #DOCUMENT_TYPE_NODE}: <tt>null</tt></li>
0783      * <li>{@link #DOCUMENT_FRAGMENT_NODE}: <tt>null</tt></li>
0784      * </ul></p>
0785      * @since 1.0
0786      * @javascript Re-compilers must resolve the member of this static field to the
0787      * identifier of the field name.
0788      */
0789     public static final Value.String.Member nodeValue      = new Value.String.Member(Members.nodeValue   );
0790     /**
0791      * <p>An <b>opaque</b> static field defining a member that is named by the field name
0792      * without a qualifying member and to access the property of the name on an object.</p>
0793      * <p>The property, identified by this member, of a {@link JsElement} or {@link JsAttr} object 
0794      * refers to a read-only string specifying the name space prefix of the node for 
0795      * XML documents that use name spaces. The property is never used with HTML 
0796      * documents.</p>
0797      * @since 1.0
0798      * @javascript Re-compilers must resolve the member of this static field to the
0799      * identifier of the field name.
0800      */
0801     public static final Value.String.Member prefix         = new Value.String.Member(Members.prefix      );
0802     /**
0803      * <p>An <b>opaque</b> static field defining a member that is named by the field name
0804      * without a qualifying member and to access the property of the name on an object.</p>
0805      * <p>The property, identified by this member, of a {@link JsElement} or {@link JsAttr} object 
0806      * refers to a read-only string specifying the text of the XML document or an element within an 
0807      * XML document.</p> 
0808      * <p>Note that the property is IE-Specific. Compare this property to the {@link JsHTMLElement#innerHTML} 
0809      * property, and see {@link JsXMLSerializer} for a cross-platform alternative.</p>
0810      * @since 1.0
0811      * @see JsHTMLElement#innerHTML
0812      * @see JsXMLSerializer
0813      * @javascript Re-compilers must resolve the member of this static field to the
0814      * identifier of the field name.
0815      */
0816     public static final Value.String.Member xml            = new Value.String.Member(Members.xml         );
0817 
0818     @Override
0819     /**
0820      * <p>Returns the primitive value associated with the current instance, if there is one.
0821      * This invocation simply returns the instance itself for the current instance is an 
0822      * object and there is no primitive value for it.</p>
0823      * @return The current object itself or its copy.
0824      * @since 1.0
0825      * @javascript Re-compilers must convert the instance invocation of this method directly
0826      * into a JavaScript invocation on its current object instance without changing the 
0827      * method name, but expanding variable arguments, if any, into comma-separated values. 
0828      */
0829     public JsNode valueOf() {
0830         return new JsNode((JsObject)var().valueOf());
0831     }
0832     /**
0833      * <p>Gets a property of the current object instance by its opaque member.</p>
0834      * @param m The opaque member of the property to get.
0835      * @return The property of the current object instance specified by its opaque member.
0836      * @see #var(JsNode.Member)
0837      * @see #var(JsDocument.Member)
0838      * @since 1.0
0839      * @javascript Re-compilers must convert the interface invocation of this method into the 
0840      * JavaScript expression: 
0841      * <pre>o.m</pre>
0842      * where <tt>o</tt> is the current object instance of the invocation and <tt>m</tt> 
0843      * must be resolved to the property identifier at re-compile time.
0844      */
0845     public final JsNodeList<?> var(JsNodeList.Member<?> m) {
0846         return m.with(this);
0847     }
0848     /**
0849      * <p>Gets a property of the current object instance by its opaque member.</p>
0850      * @param m The opaque member of the property to get.
0851      * @return The property of the current object instance specified by its opaque member.
0852      * @see #var(JsNodeList.Member)
0853      * @see #var(JsDocument.Member)
0854      * @since 1.0
0855      * @javascript Re-compilers must convert the interface invocation of this method into the 
0856      * JavaScript expression: 
0857      * <pre>o.m</pre>
0858      * where <tt>o</tt> is the current object instance of the invocation and <tt>m</tt> 
0859      * must be resolved to the property identifier at re-compile time.
0860      */
0861     public final JsNode var(JsNode.Member m) {
0862         return m.with(this);
0863     }
0864     /**
0865      * <p>Gets a property of the current object instance by its opaque member.</p>
0866      * @param m The opaque member of the property to get.
0867      * @return The property of the current object instance specified by its opaque member.
0868      * @see #var(JsNodeList.Member)
0869      * @see #var(JsNode.Member)
0870      * @since 1.0
0871      * @javascript Re-compilers must convert the interface invocation of this method into the 
0872      * JavaScript expression: 
0873      * <pre>o.m</pre>
0874      * where <tt>o</tt> is the current object instance of the invocation and <tt>m</tt> 
0875      * must be resolved to the property identifier at re-compile time.
0876      */
0877     public final JsDocument var(JsDocument.Member m) {
0878         return m.with(this);
0879     }
0880 
0881     /**
0882      * <p>Adds a node to the document tree by appending it to the {@link #childNodes} 
0883      * array of this node.</p>
0884      * <p>This method adds the node <tt>newChild</tt> to the document, inserting it as 
0885      * the last child of this node. If <tt>newChild</tt> is already in the document tree, 
0886      * it is removed from the tree and then reinserted at its new location. If <tt>newChild</tt> 
0887      * is a {@link JsDocumentFragment} node, it is not inserted itself; instead, all its 
0888      * children are appended, in order, to the end of this node's {@link #childNodes} 
0889      * array. Note that a node from (or created by) one document cannot be inserted into 
0890      * a different document. That is, the {@link #ownerDocument} property of <tt>newChild</tt> 
0891      * must be the same as the {@link #ownerDocument} property of this node.</p>
0892      * @param newChild The node to be inserted into the document. If the node is of 
0893      * {@link JsDocumentFragment}, it is not directly inserted, but each of its children 
0894      * are.
0895      * @return The node that was added.
0896      * @throws RuntimeException JavaScript throws a {@link JsDOMException} object with 
0897      * the {@link JsDOMException#code} property of the value {@link JsDOMException#HIERARCHY_REQUEST_ERR} 
0898      * if the node does not allow children, it does not allow children of the specified 
0899      * type, or <tt>newChild</tt> is an ancestor of this node (or is this node itself), 
0900      * the value {@link JsDOMException#WRONG_DOCUMENT_ERR} if the {@link #ownerDocument} 
0901      * property of <tt>newChild</tt> is not the same as the {@link #ownerDocument} 
0902      * property of this node, or the value {@link JsDOMException#NO_MODIFICATION_ALLOWED_ERR} 
0903      * if the node is read-only and does not allow children to be appended, or the node 
0904      * being appended is already part of the document tree, and its parent is read-only 
0905      * and does not allow children to be removed. See {@link Js#err(Object)} for JS 
0906      * Simulation.
0907      * @since 1.0
0908      * @javascript Re-compilers must convert the instance invocation of this method directly
0909      * into a JavaScript invocation on its current object instance without changing the 
0910      * method name, but expanding variable arguments, if any, into comma-separated values. 
0911      */
0912     public JsNode appendChild(JsNode newChild) {
0913         return new JsNode(call(appendChild, newChild));
0914     }
0915     /**
0916      * <p>Makes a copy of this node, or of the node and all its descendants.</p>
0917      * <p>This method makes and returns a copy of the node on which it is called. If 
0918      * passed the argument <tt>true</tt>, it recursively clones all descendants of the 
0919      * node as well. Otherwise, it clones only the node and none of its children. The 
0920      * returned node is not part of the document tree, and its {@link #parentNode} 
0921      * property is <tt>null</tt>. When a {@link JsElement} node is cloned, all of its 
0922      * attributes are also cloned. Note, however, that event listener functions 
0923      * registered on a node are not cloned.</p>
0924      * @param deep <tt>true</tt> to clone recursively all descendants of the node; 
0925      * Otherwise, clone only this node.
0926      * @return A copy of this node.
0927      * @see #cloneNode(JsBoolean)
0928      * @see #cloneNode(Value)
0929      * @since 1.0
0930      * @javascript Re-compilers must convert the instance invocation of this method directly
0931      * into a JavaScript invocation on its current object instance without changing the 
0932      * method name, but expanding variable arguments, if any, into comma-separated values. 
0933      */
0934     public JsNode cloneNode(Boolean deep) {
0935         return new JsNode(call(cloneNode, deep));
0936     }
0937     /**
0938      * <p>Makes a copy of this node, or of the node and all its descendants.</p>
0939      * <p>This method makes and returns a copy of the node on which it is called. If 
0940      * passed the argument <tt>true</tt>, it recursively clones all descendants of the 
0941      * node as well. Otherwise, it clones only the node and none of its children. The 
0942      * returned node is not part of the document tree, and its {@link #parentNode} 
0943      * property is <tt>null</tt>. When a {@link JsElement} node is cloned, all of its 
0944      * attributes are also cloned. Note, however, that event listener functions 
0945      * registered on a node are not cloned.</p>
0946      * @param deep <tt>true</tt> to clone recursively all descendants of the node; 
0947      * Otherwise, clone only this node.
0948      * @return A copy of this node.
0949      * @see #cloneNode(Boolean)
0950      * @see #cloneNode(JsBoolean)
0951      * @since 1.0
0952      * @javascript Re-compilers must convert the instance invocation of this method directly
0953      * into a JavaScript invocation on its current object instance without changing the 
0954      * method name, but expanding variable arguments, if any, into comma-separated values. 
0955      */
0956     public JsNode cloneNode(Value<Boolean> deep) {
0957         return cloneNode(Js.valueOf(deep));
0958     }
0959     /**
0960      * <p>Makes a copy of this node, or of the node and all its descendants.</p>
0961      * <p>This method makes and returns a copy of the node on which it is called. If 
0962      * passed the argument <tt>true</tt>, it recursively clones all descendants of the 
0963      * node as well. Otherwise, it clones only the node and none of its children. The 
0964      * returned node is not part of the document tree, and its {@link #parentNode} 
0965      * property is <tt>null</tt>. When a {@link JsElement} node is cloned, all of its 
0966      * attributes are also cloned. Note, however, that event listener functions 
0967      * registered on a node are not cloned.</p>
0968      * @param deep <tt>true</tt> to clone recursively all descendants of the node; 
0969      * Otherwise, clone only this node.
0970      * @return A copy of this node.
0971      * @see #cloneNode(Boolean)
0972      * @see #cloneNode(Value)
0973      * @since 1.0
0974      * @javascript Re-compilers must convert the instance invocation of this method directly
0975      * into a JavaScript invocation on its current object instance without changing the 
0976      * method name, but expanding variable arguments, if any, into comma-separated values. 
0977      */
0978     public JsNode cloneNode(JsBoolean deep) {
0979         return cloneNode(Js.valueOf(deep));
0980     }
0981     /**
0982      * <p>Checks if this node is a {@link JsElement} and has any attributes.</p>
0983      * @return <tt>true</tt> if this node has one or more attributes; <tt>false</tt> if 
0984      * it has none. Note that only {@link JsElement} nodes can have attributes.
0985      * @since 1.0
0986      * @see JsElement#getAttribute(String)
0987      * @see JsElement#hasAttribute(String)
0988      * @javascript Re-compilers must convert the instance invocation of this method directly
0989      * into a JavaScript invocation on its current object instance without changing the 
0990      * method name, but expanding variable arguments, if any, into comma-separated values. 
0991      */
0992     public final Boolean hasAttributes() {
0993         return call(hasAttributes);
0994     }
0995     /**
0996      * <p>Checks if this node has any children.</p>
0997      * @return <tt>true</tt> if this node has one or more children; <tt>false</tt> if 
0998      * it has none.
0999      * @since 1.0
1000      * @javascript Re-compilers must convert the instance invocation of this method directly
1001      * into a JavaScript invocation on its current object instance without changing the 
1002      * method name, but expanding variable arguments, if any, into comma-separated values. 
1003      */
1004     public final Boolean hasChildNodes() {
1005         return call(hasChildNodes);
1006     }
1007     /**
1008      * <p>Inserts an element at the specified location.</p>
1009      * <p>This method is IE-specific.</p>
1010      * @param where A string that specifies where to insert the HTML element, using one of
1011      * the following values: 
1012      * <ul>
1013      * <li>"beforeBegin": Inserts <tt>node</tt> immediately before the object.</li>
1014      * <li>"afterBegin": Inserts <tt>node</tt> after the start of the object but before all other 
1015      * content in the object.</li>
1016      * <li>"beforeEnd": Inserts <tt>node</tt> immediately before the end of the object but after 
1017      * all other content in the object.</li>
1018      * <li>"afterEnd": Inserts <tt>node</tt> immediately after the end of the object.</li>
1019      * </ul>
1020      * @param node An object that specifies the element to be inserted adjacent to the 
1021      * object that invoked the method.
1022      * @return An element object.
1023      * @since 1.0
1024      * @javascript Re-compilers must convert the instance invocation of this method directly
1025      * into a JavaScript invocation on its current object instance without changing the 
1026      * method name, but expanding variable arguments, if any, into comma-separated values. 
1027      */
1028     public Object insertAdjacentElement(String where, JsNode node) {
1029         return call(insertAdjacentElement, new Vars<Object>().add(where).add(node));
1030     }
1031     /**
1032      * <p>Inserts the given HTML text into the element at the location.</p>
1033      * <p>This method is IE-specific.</p>
1034      * @param where A string that specifies where to insert the HTML text, using one of
1035      * the following values: 
1036      * <ul>
1037      * <li>"beforeBegin": Inserts <tt>html</tt> immediately before the object.</li>
1038      * <li>"afterBegin": Inserts <tt>html</tt> after the start of the object but before all other 
1039      * content in the object.</li>
1040      * <li>"beforeEnd": Inserts <tt>html</tt> immediately before the end of the object but after 
1041      * all other content in the object.</li>
1042      * <li>"afterEnd": Inserts <tt>html</tt> immediately after the end of the object.</li>
1043      * </ul>
1044      * @param html A string that specifies the HTML text to insert. The string can be a 
1045      * combination of text and HTML tags. This must be well-formed, valid HTML or this 
1046      * method will fail.
1047      * @since 1.0
1048      * @javascript Re-compilers must convert the instance invocation of this method directly
1049      * into a JavaScript invocation on its current object instance without changing the 
1050      * method name, but expanding variable arguments, if any, into comma-separated values. 
1051      */
1052     public void insertAdjacentHTML(String where, String html) {
1053         call(insertAdjacentHTML, new Vars<Object>().add(where).add(html));
1054     }
1055     /**
1056      * <p>Inserts the given text into the element at the location.</p>
1057      * <p>This method is IE-specific.</p>
1058      * @param where A string that specifies where to insert the text, using one of
1059      * the following values: 
1060      * <ul>
1061      * <li>"beforeBegin": Inserts <tt>text</tt> immediately before the object.</li>
1062      * <li>"afterBegin": Inserts <tt>text</tt> after the start of the object but before all other 
1063      * content in the object.</li>
1064      * <li>"beforeEnd": Inserts <tt>text</tt> immediately before the end of the object but after 
1065      * all other content in the object.</li>
1066      * <li>"afterEnd": Inserts <tt>text</tt> immediately after the end of the object.</li>
1067      * </ul>
1068      * @param text A string that specifies the text to insert. The text inserted into the element is 
1069      * plain text.
1070      * @since 1.0
1071      * @javascript Re-compilers must convert the instance invocation of this method directly
1072      * into a JavaScript invocation on its current object instance without changing the 
1073      * method name, but expanding variable arguments, if any, into comma-separated values. 
1074      */
1075     public void insertAdjacentText(String where, String text) {
1076         call(insertAdjacentText, new Vars<Object>().add(where).add(text));
1077     }
1078     /**
1079      * <p>Inserts a node into the document tree immediately before the specified child 
1080      * of this node.</p>
1081      * <p>This method inserts the node <tt>newChild</tt> into the document tree as a 
1082      * child of this node. The new node is positioned within this node's {@link #childNodes} 
1083      * array so that it comes immediately before the <tt>refChild</tt> node. If <tt>refChild</tt> 
1084      * is <tt>null</tt>, <tt>newChild</tt> is inserted at the end of {@link #childNodes}, 
1085      * just as with the {@link #appendChild(JsNode)} method. Note that it is illegal to 
1086      * call this method with a <tt>refChild</tt> that is not a child of this node.</p>
1087      * <p>If the node being inserted is already in the tree, it is removed and 
1088      * reinserted at its new location.</p>
1089      * <p>If <tt>newChild</tt> is a {@link JsDocumentFragment} node, it is not inserted 
1090      * itself; instead, each of its children is inserted, in order, at the specified 
1091      * location.</p>
1092      * @param newChild The node to be inserted into the document. If the node is of 
1093      * {@link JsDocumentFragment}, it is not directly inserted, but each of its children 
1094      * are.
1095      * @param refChild The child of this node before which <tt>newChild</tt> is to be 
1096      * inserted. If this argument is <tt>null</tt>, <tt>newChild</tt> is inserted as 
1097      * the last child of this node. 
1098      * @return The node that was inserted.
1099      * @throws RuntimeException JavaScript throws a {@link JsDOMException} object with 
1100      * the {@link JsDOMException#code} property of the value {@link JsDOMException#HIERARCHY_REQUEST_ERR} 
1101      * if the node does not allow children, it does not allow children of the specified 
1102      * type, or <tt>newChild</tt> is an ancestor of this node (or is this node itself), 
1103      * the value {@link JsDOMException#WRONG_DOCUMENT_ERR} if the {@link #ownerDocument} 
1104      * property of <tt>newChild</tt> is not the same as the {@link #ownerDocument} 
1105      * property of this node, the value {@link JsDOMException#NO_MODIFICATION_ALLOWED_ERR} 
1106      * if the node is read-only and does not allow insertion, or the parent of <tt>newChild</tt> 
1107      * is read-only and does not allow deletion, or the value {@link JsDOMException#NOT_FOUND_ERR} 
1108      * if <tt>refChild</tt> is not a child of this node. See {@link Js#err(Object)} for JS 
1109      * Simulation.
1110      * @since 1.0
1111      * @javascript Re-compilers must convert the instance invocation of this method directly
1112      * into a JavaScript invocation on its current object instance without changing the 
1113      * method name, but expanding variable arguments, if any, into comma-separated values. 
1114      */
1115     public JsNode insertBefore(JsNode newChild, JsNode refChild) {
1116         return new JsNode(call(insertBefore, new Vars<Object>().add(newChild).add(refChild)));
1117     }
1118     /**
1119      * <p>Determines if the specified version number of a named feature is supported 
1120      * by this node.</p>
1121      * <p>The W3C DOM standard is modular, and implementations are not required to 
1122      * implement all modules or features of the standard. This method tests whether the 
1123      * implementation of this node supports the specified version of the named feature.</p>
1124      * @param feature The name of the feature to test. 
1125      * The complete set of valid module names for the 
1126      * DOM Level 2 standard that may be used as this argument are listed as follows:
1127      * <ul>
1128      * <li>Core: Node, Element, Document, Text, and the other fundamental interfaces 
1129      * required by all DOM implementations are implemented. All conforming implementations 
1130      * must support this module.</li>
1131      * <li>HTML: HTMLElement, HTMLDocument, and the other HTML-specific interfaces are 
1132      * implemented.</li>
1133      * <li>XML: Entity, EntityReference, ProcessingInstruction, Notation, and the other 
1134      * node types that are useful only with XML documents are implemented.</li>
1135      * <li>StyleSheets: Simple interfaces describing generic style-sheets are implemented.</li>
1136      * <li>CSS: Interfaces that are specific to CSS style-sheets are implemented.</li>
1137      * <li>CSS2: The CSS2Properties interface is implemented.</li>
1138      * <li>Events: The basic event-handling interfaces are implemented.</li>
1139      * <li>UIEvents: The interfaces for user-interface events are implemented.</li>
1140      * <li>MouseEvents: The interfaces for mouse events are implemented.</li>
1141      * <li>HTMLEvents: The interfaces for HTML events are implemented.</li>
1142      * <li>MutationEvents: The interfaces for document mutation events are implemented.</li>
1143      * <li>Range: The interfaces for manipulating ranges of a document are implemented.</li>
1144      * <li>Traversal: The interfaces for advanced document traversal are implemented.</li>
1145      * <li>Views: The interfaces for document views are implemented.</li>
1146      * </ul>
1147      * @param version The version number of the feature to test, or the empty string to 
1148      * test for support of any version of the feature. In the Level 2 DOM specification, 
1149      * supported version numbers are 1.0 and 2.0.
1150      * @since 1.0
1151      * @see JsDOMImplementation#hasFeature(String, String)
1152      * @javascript Re-compilers must convert the instance invocation of this method directly
1153      * into a JavaScript invocation on its current object instance without changing the 
1154      * method name, but expanding variable arguments, if any, into comma-separated values. 
1155      */
1156     public final Boolean isSupported(Object feature, Object version) {
1157         return call(isSupported, new Vars<Object>().add(feature).add(version));
1158     }
1159     /**
1160      * <p>Normalizes all {@link JsText} node descendants of this node by deleting 
1161      * empty {@link JsText} nodes and merging adjacent {@link JsText} nodes.</p>
1162      * <p>This method traverses all descendants of this node and normalizes the document 
1163      * by removing any empty {@link JsText} nodes and merging all adjacent {@link JsText} 
1164      * nodes into a single node. This can simplify the tree structure after node 
1165      * insertions or deletions.</p>
1166      * @since 1.0
1167      * @see JsText
1168      * @javascript Re-compilers must convert the instance invocation of this method directly
1169      * into a JavaScript invocation on its current object instance without changing the 
1170      * method name, but expanding variable arguments, if any, into comma-separated values. 
1171      */
1172     public final void normalize() {
1173         call(normalize);
1174     }
1175     /**
1176      * <p>Removes mouse capture from the object in the current document.</p>
1177      * <p>This method is IE-specific.</p>
1178      * @see #setCapture()
1179      * @since 1.0
1180      * @javascript Re-compilers must convert the instance invocation of this method directly
1181      * into a JavaScript invocation on its current object instance without changing the 
1182      * method name, but expanding variable arguments, if any, into comma-separated values. 
1183      */
1184     public final void releaseCapture() {
1185         call(releaseCapture);
1186     }
1187     /**
1188      * <p>Removes and returns the specified child node from the document tree.</p>
1189      * <p>This method removes the specified child from the {@link #childNodes} array of 
1190      * this node. It is an error to call this method with a node that is not a child. 
1191      * This method returns the <tt>oldChild</tt> node after removing it. <tt>oldChild</tt> 
1192      * continues to be a valid node and may be reinserted into the document later.</p>
1193      * @param oldChild The child node to remove. 
1194      * @return The node that was removed.
1195      * @throws RuntimeException JavaScript throws a {@link JsDOMException} object with 
1196      * the {@link JsDOMException#code} property of the value {@link JsDOMException#NO_MODIFICATION_ALLOWED_ERR} 
1197      * if the node is read-only and does not allow children to be removed, or the value 
1198      * {@link JsDOMException#NOT_FOUND_ERR} if <tt>oldChild</tt> is not a child of this 
1199      * node. See {@link Js#err(Object)} for JS Simulation.
1200      * @since 1.0
1201      * @javascript Re-compilers must convert the instance invocation of this method directly
1202      * into a JavaScript invocation on its current object instance without changing the 
1203      * method name, but expanding variable arguments, if any, into comma-separated values. 
1204      */
1205     public JsNode removeChild(JsNode oldChild) {
1206         return new JsNode(call(removeChild, oldChild));
1207     }
1208     /**
1209      * <p>Removes and returns the specified child node from the document tree, replacing 
1210      * it with another node.</p>
1211      * <p>This method replaces one node of the document tree with another. <tt>oldChild</tt> 
1212      * is the node to be replaced and must be a child of this node. <tt>newChild</tt> is 
1213      * the node that takes its place in the {@link #childNodes} array of this node.</p>
1214      * <p>If <tt>newChild</tt> is already part of the document, it is first removed from 
1215      * the document before being reinserted at its new position.</p>
1216      * <p>If <tt>newChild</tt> is a {@link JsDocumentFragment} node, it is not inserted 
1217      * itself; instead, each of its children is inserted, in order, at the position 
1218      * formerly occupied by <tt>oldChild</tt>.</p>
1219      * @param newChild The replacement node. 
1220      * @param oldChild The node to be replaced. 
1221      * @return The node that was removed from the document and replaced.
1222      * @throws RuntimeException JavaScript throws a {@link JsDOMException} object with 
1223      * the {@link JsDOMException#code} property of the value {@link JsDOMException#HIERARCHY_REQUEST_ERR} 
1224      * if the node does not allow children, it does not allow children of the specified 
1225      * type, or <tt>newChild</tt> is an ancestor of this node (or is this node itself), 
1226      * the value {@link JsDOMException#WRONG_DOCUMENT_ERR} if <tt>newChild</tt> and this 
1227      * node have different values for {@link #ownerDocument} property, the value {@link JsDOMException#NO_MODIFICATION_ALLOWED_ERR} 
1228      * if the node is read-only and does not allow replacement, or <tt>newChild</tt> is 
1229      * the child of a node that does not allow removals, or the value {@link JsDOMException#NOT_FOUND_ERR} 
1230      * if <tt>oldChild</tt> is not a child of this node. See {@link Js#err(Object)} for JS 
1231      * Simulation.
1232      * @since 1.0
1233      * @javascript Re-compilers must convert the instance invocation of this method directly
1234      * into a JavaScript invocation on its current object instance without changing the 
1235      * method name, but expanding variable arguments, if any, into comma-separated values. 
1236      */
1237     public JsNode replaceChild(JsNode newChild, JsNode oldChild) {
1238         return new JsNode(call(replaceChild, new Vars<Object>().add(newChild).add(oldChild)));
1239     }
1240     /**
1241      * <p>Performs an XPath query using this node as the root and returns the result as a {@link JsNodeList}.</p>
1242      * @param query A string value of XPath query.
1243      * @return The query result as a {@link JsNodeList}.
1244      * @see #selectNodes(StringLike)
1245      * @since 1.0
1246      * @javascript Re-compilers must convert the instance invocation of this method directly
1247      * into a JavaScript invocation on its current object instance without changing the 
1248      * method name, but expanding variable arguments, if any, into comma-separated values. 
1249      */
1250     public final JsNodeList<?> selectNodes(String query) {
1251         return new JsNodeList<JsNode>(call(selectNodes, query));
1252     }
1253     /**
1254      * <p>Performs an XPath query using this node as the root and returns the result as a {@link JsNodeList}.</p>
1255      * @param query A string value of XPath query.
1256      * @return The query result as a {@link JsNodeList}.
1257      * @see #selectNodes(String)
1258      * @since 1.0
1259      * @javascript Re-compilers must convert the instance invocation of this method directly
1260      * into a JavaScript invocation on its current object instance without changing the 
1261      * method name, but expanding variable arguments, if any, into comma-separated values. 
1262      */
1263     public final JsNodeList<?> selectNodes(StringLike query) {
1264         return selectNodes(Js.valueOf(query));
1265     }
1266     /**
1267      * <p>Performs an XPath query using this node as the root and returns the result as a single node.</p>
1268      * @return The query result as a {@link JsNodeList}.
1269      * @see #selectSingleNode(StringLike)
1270      * @since 1.0
1271      * @javascript Re-compilers must convert the instance invocation of this method directly
1272      * into a JavaScript invocation on its current object instance without changing the 
1273      * method name, but expanding variable arguments, if any, into comma-separated values. 
1274      */
1275     public final JsNode selectSingleNode(String query) {
1276         return call(selectSingleNode, query);
1277     }
1278     /**
1279      * <p>Performs an XPath query using this node as the root and returns the result as a single node.</p>
1280      * @return The query result as a {@link JsNodeList}.
1281      * @see #selectSingleNode(String)
1282      * @since 1.0
1283      * @javascript Re-compilers must convert the instance invocation of this method directly
1284      * into a JavaScript invocation on its current object instance without changing the 
1285      * method name, but expanding variable arguments, if any, into comma-separated values. 
1286      */
1287     public final JsNode selectSingleNode(StringLike query) {
1288         return call(selectSingleNode, query);
1289     }
1290     /**
1291      * <p>Sets the mouse capture to the object belonging to the current document.</p>
1292      * <p>This method is IE-specific.</p>
1293      * @see #releaseCapture()
1294      * @since 1.0
1295      * @javascript Re-compilers must convert the instance invocation of this method directly
1296      * into a JavaScript invocation on its current object instance without changing the 
1297      * method name, but expanding variable arguments, if any, into comma-separated values. 
1298      */
1299     public final void setCapture() {
1300         call(setCapture);
1301     }
1302     /**
1303      * <p>Applies an XSLT stylesheet to this node and returns the results as a string.</p>
1304      * <p>This IE-specific method transforms a node and its descendants according to the 
1305      * rules specified in an XSLT stylesheet and returns the result as an unparsed 
1306      * string. The method exists only on the nodes of XML documents, not HTML documents. 
1307      * Note that since {@link JsDocument} objects are themselves nodes, this method can 
1308      * be applied to entire XML documents.</p>
1309      * <p>See {@link JsXSLTProcessor} for a cross-platform alternative.</p>
1310      * @param xslt An XSLT stylesheet, parsed to a {@link JsDocument} object. 
1311      * @return The text produced by applying the specified stylesheet to this node and 
1312      * its descendants.
1313      * @since 1.0
1314      * @javascript Re-compilers must convert the instance invocation of this method directly
1315      * into a JavaScript invocation on its current object instance without changing the 
1316      * method name, but expanding variable arguments, if any, into comma-separated values. 
1317      */
1318     public final String transformNode(JsDocument xslt) {
1319         return call(transformNode, xslt);
1320     }
1321     /**
1322      * <p>applies an XSLT stylesheet to this node and returns the results as a new 
1323      * {@link JsDocument} object.</p>
1324      * <p>This IE-specific method transforms a node and its descendants according to the 
1325      * rules specified in an XSLT stylesheet and returns the result as a {@link JsDocument} 
1326      * object. The method exists only on the nodes of XML documents, not HTML documents. 
1327      * Note that since {@link JsDocument} objects are themselves nodes, this method can 
1328      * be applied to entire XML documents.</p>
1329      * <p>See {@link JsXSLTProcessor} for a cross-platform alternative.</p>
1330      * @param xslt An XSLT stylesheet, parsed to a {@link JsDocument} object. 
1331      * @return The current object itself.
1332      * @since 1.0
1333      * @javascript Re-compilers must convert the instance invocation of this method directly
1334      * into a JavaScript invocation on its current object instance without changing the 
1335      * method name, but expanding variable arguments, if any, into comma-separated values. 
1336      */
1337     public final JsDocument transformNodeToObject(JsDocument xslt) {
1338         return new JsDocument(call(transformNodeToObject, xslt));
1339     }
1340     /**
1341      * <p>Checks whether the given element is contained within the object.</p>
1342      * <p>This method is IE specific.</p>
1343      * @return <tt>true</tt> if the element is contained within the object; <tt>false</tt>, otherwise.
1344      * @since 1.0
1345      * @javascript Re-compilers must convert the instance invocation of this method directly
1346      * into a JavaScript invocation on its current object instance without changing the 
1347      * method name, but expanding variable arguments, if any, into comma-separated values. 
1348      */
1349     public final Boolean contains(JsNode childNode) {
1350         return call(contains, childNode);
1351     }
1352     /**
1353      * <p>Compares document positions.</p>
1354      * <p>This method is specific.</p>
1355      * @param node A node to compare with the current one.
1356      * @return The number of the result of comparison.
1357      * @since 1.0
1358      * @javascript Re-compilers must convert the instance invocation of this method directly
1359      * into a JavaScript invocation on its current object instance without changing the 
1360      * method name, but expanding variable arguments, if any, into comma-separated values. 
1361      */
1362     public final Number compareDocumentPosition(JsNode node) {
1363         return call(compareDocumentPosition, node);
1364     }
1365 }