<html> <head> <title>Interface XDocument</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link rel="stylesheet" type="text/css" href="../../../../../idl.css"> </head> <body> <div id="adc-idlref"> <a name="_top_"> </a><table class="navimain" border="0" cellpadding="3"> <tr> <td class="navimain"><a href="../../module-ix.html" class="navimain">Overview</a></td> <td class="navimain"><a href="module-ix.html" class="navimain">Module</a></td> <td class="navimain"><a href="XDocument-xref.html" class="navimain">Use</a></td> <td class="navimainnone">Devguide</td> <td class="navimain"><a href="../../../../../index-files/index-1.html" class="navimain">Index</a></td> </tr> </table> <table class="navisub" border="0" cellpadding="0"> <tr> <td class="navisub"><a href="#MethodsSummary" class="navisub">Methods' Summary</a></td> <td class="navisub"><a href="#MethodsDetails" class="navisub">Methods' Details</a></td> <td class="navisub">Attributes' Summary</td> <td class="navisub">Attributes' Details</td> </tr> </table> <hr> <table border="0" width="100%" cellpadding="5" cellspacing="3" class="title-table" style="margin-bottom:6pt;"> <tr> <td><p class="namechain"><a href="../../../../../module-ix.html" class="namechain">::</a> <a href="../../../../module-ix.html" class="namechain">com</a> :: <a href="../../../module-ix.html" class="namechain">sun</a> :: <a href="../../module-ix.html" class="namechain">star</a> :: <a href="../module-ix.html" class="namechain">xml</a> :: <a href="module-ix.html" class="namechain">dom</a> :: </p> </td> </tr> <tr> <td class="title">interface XDocument</td> </tr> <tr> <td><dl> <dt><b>Base Interfaces</b></dt> <dd><pre style="font-family:monospace;"><strong>XDocument</strong> ┗ <a href="XNode.html">XNode</a> </pre></dd> <dd><a name/><table border="1" width="100%" cellpadding="5" cellspacing="0" class="crosstitle"> <tr> <td class="imsum_left"><a href="XNode.html">XNode</a></td> <td class="imsum_right"><dl> <dt>(referenced interface's summary:)</dt> <dd>The primary dom datatype </dd> </dl> </td> </tr> </table> </dd> </dl> </td> </tr> <tr> <td/></tr> </table> <hr> <a name="MethodsSummary"/><table border="1" width="100%" cellpadding="5" cellspacing="0" class="subtitle"> <tr> <td class="subtitle" colspan="2">Methods' Summary</td> </tr> <tr> <td class="imsum_left"><a href="#createAttribute">createAttribute</a></td> <td class="imsum_right">Creates an Attr of the given name. Throws: DOMException - INVALID_CHARACTER_ERR: Raised if the specified name contains an illegal character. </td> </tr> <tr> <td class="imsum_left"><a href="#createAttributeNS">createAttributeNS</a></td> <td class="imsum_right">Creates an attribute of the given qualified name and namespace URI. Throws: DOMException - INVALID_CHARACTER_ERR: Raised if the specified qualified name contains an illegal character, per the XML 1.0 specification . NAMESPACE_ERR: Raised if the qualifiedName is malformed per the Namespaces in XML specification, if the qualifiedName has a prefix and the namespaceURI is null, if the qualifiedName has a prefix that is "xml" and the namespaceURI is different from " http://www.w3.org/XML/1998/namespace", or if the qualifiedName, or its prefix, is "xmlns" and the namespaceURI is different from " http://www.w3.org/2000/xmlns/". NOT_SUPPORTED_ERR: Always thrown if the current document does not support the "XML" feature, since namespaces were defined by XML. </td> </tr> <tr> <td class="imsum_left"><a href="#createCDATASection">createCDATASection</a></td> <td class="imsum_right">Creates a CDATASection node whose value is the specified string. Throws: DOMException - NOT_SUPPORTED_ERR: Raised if this document is an HTML document. </td> </tr> <tr> <td class="imsum_left"><a href="#createComment">createComment</a></td> <td class="imsum_right">Creates a Comment node given the specified string. </td> </tr> <tr> <td class="imsum_left"><a href="#createDocumentFragment">createDocumentFragment</a></td> <td class="imsum_right">Creates an empty DocumentFragment object. </td> </tr> <tr> <td class="imsum_left"><a href="#createElement">createElement</a></td> <td class="imsum_right">Creates an element of the type specified. Throws: DOMException - INVALID_CHARACTER_ERR: Raised if the specified name contains an illegal character. </td> </tr> <tr> <td class="imsum_left"><a href="#createElementNS">createElementNS</a></td> <td class="imsum_right">Creates an element of the given qualified name and namespace URI. Throws: DOMException - INVALID_CHARACTER_ERR: Raised if the specified qualified name contains an illegal character, per the XML 1.0 specification . NAMESPACE_ERR: Raised if the qualifiedName is malformed per the Namespaces in XML specification, if the qualifiedName has a prefix and the namespaceURI is null, or if the qualifiedName has a prefix that is "xml" and the namespaceURI is different from " http://www.w3.org/XML/1998/namespace" . NOT_SUPPORTED_ERR: Always thrown if the current document does not support the "XML" feature, since namespaces were defined by XML. </td> </tr> <tr> <td class="imsum_left"><a href="#createEntityReference">createEntityReference</a></td> <td class="imsum_right">Throws: DOMException - NOT_SUPPORTED_ERR: Raised if the type of node being imported is not supported. Creates an EntityReference object. Throws: DOMException - INVALID_CHARACTER_ERR: Raised if the specified name contains an illegal character. NOT_SUPPORTED_ERR: Raised if this document is an HTML document. </td> </tr> <tr> <td class="imsum_left"><a href="#createProcessingInstruction">createProcessingInstruction</a></td> <td class="imsum_right">Creates a ProcessingInstruction node given the specified name and data strings. Throws: DOMException - INVALID_CHARACTER_ERR: Raised if the specified target contains an illegal character. NOT_SUPPORTED_ERR: Raised if this document is an HTML document. </td> </tr> <tr> <td class="imsum_left"><a href="#createTextNode">createTextNode</a></td> <td class="imsum_right">Creates a Text node given the specified string. </td> </tr> <tr> <td class="imsum_left"><a href="#getDoctype">getDoctype</a></td> <td class="imsum_right">The Document Type Declaration (see DocumentType) associated with this document. </td> </tr> <tr> <td class="imsum_left"><a href="#getDocumentElement">getDocumentElement</a></td> <td class="imsum_right">This is a convenience attribute that allows direct access to the child node that is the root element of the document. </td> </tr> <tr> <td class="imsum_left"><a href="#getElementById">getElementById</a></td> <td class="imsum_right">Returns the Element whose ID is given by elementId. </td> </tr> <tr> <td class="imsum_left"><a href="#getElementsByTagName">getElementsByTagName</a></td> <td class="imsum_right">Returns a NodeList of all the Elements with a given tag name in the order in which they are encountered in a preorder traversal of the Document tree. </td> </tr> <tr> <td class="imsum_left"><a href="#getElementsByTagNameNS">getElementsByTagNameNS</a></td> <td class="imsum_right">Returns a NodeList of all the Elements with a given local name and namespace URI in the order in which they are encountered in a preorder traversal of the Document tree. </td> </tr> <tr> <td class="imsum_left"><a href="#getImplementation">getImplementation</a></td> <td class="imsum_right">The DOMImplementation object that handles this document. </td> </tr> <tr> <td class="imsum_left"><a href="#importNode">importNode</a></td> <td class="imsum_right">Imports a node from another document to this document. Throws: DOMException - NOT_SUPPORTED_ERR: Raised if the type of node being imported is not supported. </td> </tr> </table> <a name="MethodsDetails"/><table border="1" width="100%" cellpadding="5" cellspacing="0" class="subtitle"> <tr> <td class="subtitle">Methods' Details</td> </tr> <tr> <td class="imdetail"><a name="createAttribute" class="membertitle">createAttribute</a><table border="0" width="96%" cellpadding="5" cellspacing="0" class="table-in-method" bgcolor="#ffffff" align="center"> <tr> <td><table class="table-in-method" border="0"> <tr> <td valign="top" colspan="3"><a href="XAttr.html">XAttr</a></td> </tr> <tr> <td valign="top"><b>createAttribute</b>(</td> <td valign="top">[in] string</td> <td valign="bottom"> name )</td> </tr> <tr> <td valign="top" align="right">raises( </td> <td valign="top" colspan="2"><a href="DOMException.html">DOMException</a> );</td> </tr> </table> <hr> <dl> <dt><b>Description</b></dt> <dd>Creates an Attr of the given name. Throws: DOMException - INVALID_CHARACTER_ERR: Raised if the specified name contains an illegal character. </dd> </dl> </td> </tr> </table> </td> </tr> <tr> <td class="imdetail"><a name="createAttributeNS" class="membertitle">createAttributeNS</a><table border="0" width="96%" cellpadding="5" cellspacing="0" class="table-in-method" bgcolor="#ffffff" align="center"> <tr> <td><table class="table-in-method" border="0"> <tr> <td valign="top" colspan="3"><a href="XAttr.html">XAttr</a></td> </tr> <tr> <td valign="top"><b>createAttributeNS</b>(</td> <td valign="top">[in] string</td> <td valign="bottom"> namespaceURI,</td> </tr> <tr> <td/><td valign="top">[in] string</td> <td valign="bottom"> qualifiedName )</td> </tr> <tr> <td valign="top" align="right">raises( </td> <td valign="top" colspan="2"><a href="DOMException.html">DOMException</a> );</td> </tr> </table> <hr> <dl> <dt><b>Description</b></dt> <dd>Creates an attribute of the given qualified name and namespace URI. Throws: DOMException - INVALID_CHARACTER_ERR: Raised if the specified qualified name contains an illegal character, per the XML 1.0 specification . NAMESPACE_ERR: Raised if the qualifiedName is malformed per the Namespaces in XML specification, if the qualifiedName has a prefix and the namespaceURI is null, if the qualifiedName has a prefix that is "xml" and the namespaceURI is different from " http://www.w3.org/XML/1998/namespace", or if the qualifiedName, or its prefix, is "xmlns" and the namespaceURI is different from " http://www.w3.org/2000/xmlns/". NOT_SUPPORTED_ERR: Always thrown if the current document does not support the "XML" feature, since namespaces were defined by XML. </dd> </dl> </td> </tr> </table> </td> </tr> <tr> <td class="imdetail"><a name="createCDATASection" class="membertitle">createCDATASection</a><table border="0" width="96%" cellpadding="5" cellspacing="0" class="table-in-method" bgcolor="#ffffff" align="center"> <tr> <td><table class="table-in-method" border="0"> <tr> <td valign="top" colspan="3"><a href="XCDATASection.html">XCDATASection</a></td> </tr> <tr> <td valign="top"><b>createCDATASection</b>(</td> <td valign="top">[in] string</td> <td valign="bottom"> data )</td> </tr> <tr> <td valign="top" align="right">raises( </td> <td valign="top" colspan="2"><a href="DOMException.html">DOMException</a> );</td> </tr> </table> <hr> <dl> <dt><b>Description</b></dt> <dd>Creates a CDATASection node whose value is the specified string. Throws: DOMException - NOT_SUPPORTED_ERR: Raised if this document is an HTML document. </dd> </dl> </td> </tr> </table> </td> </tr> <tr> <td class="imdetail"><a name="createComment" class="membertitle">createComment</a><table border="0" width="96%" cellpadding="5" cellspacing="0" class="table-in-method" bgcolor="#ffffff" align="center"> <tr> <td><table class="table-in-method" border="0"> <tr> <td valign="top" colspan="3"><a href="XComment.html">XComment</a></td> </tr> <tr> <td valign="top"><b>createComment</b>(</td> <td valign="top">[in] string</td> <td valign="bottom"> data );</td> </tr> </table> <hr> <dl> <dt><b>Description</b></dt> <dd>Creates a Comment node given the specified string. </dd> </dl> </td> </tr> </table> </td> </tr> <tr> <td class="imdetail"><a name="createDocumentFragment" class="membertitle">createDocumentFragment</a><table border="0" width="96%" cellpadding="5" cellspacing="0" class="table-in-method" bgcolor="#ffffff" align="center"> <tr> <td><table class="table-in-method" border="0"> <tr> <td valign="top" colspan="3"><a href="XDocumentFragment.html">XDocumentFragment</a></td> </tr> <tr> <td valign="top"><b>createDocumentFragment</b>();</td> </tr> </table> <hr> <dl> <dt><b>Description</b></dt> <dd>Creates an empty DocumentFragment object. </dd> </dl> </td> </tr> </table> </td> </tr> <tr> <td class="imdetail"><a name="createElement" class="membertitle">createElement</a><table border="0" width="96%" cellpadding="5" cellspacing="0" class="table-in-method" bgcolor="#ffffff" align="center"> <tr> <td><table class="table-in-method" border="0"> <tr> <td valign="top" colspan="3"><a href="XElement.html">XElement</a></td> </tr> <tr> <td valign="top"><b>createElement</b>(</td> <td valign="top">[in] string</td> <td valign="bottom"> tagName )</td> </tr> <tr> <td valign="top" align="right">raises( </td> <td valign="top" colspan="2"><a href="DOMException.html">DOMException</a> );</td> </tr> </table> <hr> <dl> <dt><b>Description</b></dt> <dd>Creates an element of the type specified. Throws: DOMException - INVALID_CHARACTER_ERR: Raised if the specified name contains an illegal character. </dd> </dl> </td> </tr> </table> </td> </tr> <tr> <td class="imdetail"><a name="createElementNS" class="membertitle">createElementNS</a><table border="0" width="96%" cellpadding="5" cellspacing="0" class="table-in-method" bgcolor="#ffffff" align="center"> <tr> <td><table class="table-in-method" border="0"> <tr> <td valign="top" colspan="3"><a href="XElement.html">XElement</a></td> </tr> <tr> <td valign="top"><b>createElementNS</b>(</td> <td valign="top">[in] string</td> <td valign="bottom"> namespaceURI,</td> </tr> <tr> <td/><td valign="top">[in] string</td> <td valign="bottom"> qualifiedName )</td> </tr> <tr> <td valign="top" align="right">raises( </td> <td valign="top" colspan="2"><a href="DOMException.html">DOMException</a> );</td> </tr> </table> <hr> <dl> <dt><b>Description</b></dt> <dd>Creates an element of the given qualified name and namespace URI. Throws: DOMException - INVALID_CHARACTER_ERR: Raised if the specified qualified name contains an illegal character, per the XML 1.0 specification . NAMESPACE_ERR: Raised if the qualifiedName is malformed per the Namespaces in XML specification, if the qualifiedName has a prefix and the namespaceURI is null, or if the qualifiedName has a prefix that is "xml" and the namespaceURI is different from " http://www.w3.org/XML/1998/namespace" . NOT_SUPPORTED_ERR: Always thrown if the current document does not support the "XML" feature, since namespaces were defined by XML. </dd> </dl> </td> </tr> </table> </td> </tr> <tr> <td class="imdetail"><a name="createEntityReference" class="membertitle">createEntityReference</a><table border="0" width="96%" cellpadding="5" cellspacing="0" class="table-in-method" bgcolor="#ffffff" align="center"> <tr> <td><table class="table-in-method" border="0"> <tr> <td valign="top" colspan="3"><a href="XEntityReference.html">XEntityReference</a></td> </tr> <tr> <td valign="top"><b>createEntityReference</b>(</td> <td valign="top">[in] string</td> <td valign="bottom"> name )</td> </tr> <tr> <td valign="top" align="right">raises( </td> <td valign="top" colspan="2"><a href="DOMException.html">DOMException</a> );</td> </tr> </table> <hr> <dl> <dt><b>Description</b></dt> <dd>Throws: DOMException - NOT_SUPPORTED_ERR: Raised if the type of node being imported is not supported. Creates an EntityReference object. Throws: DOMException - INVALID_CHARACTER_ERR: Raised if the specified name contains an illegal character. NOT_SUPPORTED_ERR: Raised if this document is an HTML document. </dd> </dl> </td> </tr> </table> </td> </tr> <tr> <td class="imdetail"><a name="createProcessingInstruction" class="membertitle">createProcessingInstruction</a><table border="0" width="96%" cellpadding="5" cellspacing="0" class="table-in-method" bgcolor="#ffffff" align="center"> <tr> <td><table class="table-in-method" border="0"> <tr> <td valign="top" colspan="3"><a href="XProcessingInstruction.html">XProcessingInstruction</a></td> </tr> <tr> <td valign="top"><b>createProcessingInstruction</b>(</td> <td valign="top">[in] string</td> <td valign="bottom"> target,</td> </tr> <tr> <td/><td valign="top">[in] string</td> <td valign="bottom"> data )</td> </tr> <tr> <td valign="top" align="right">raises( </td> <td valign="top" colspan="2"><a href="DOMException.html">DOMException</a> );</td> </tr> </table> <hr> <dl> <dt><b>Description</b></dt> <dd>Creates a ProcessingInstruction node given the specified name and data strings. Throws: DOMException - INVALID_CHARACTER_ERR: Raised if the specified target contains an illegal character. NOT_SUPPORTED_ERR: Raised if this document is an HTML document. </dd> </dl> </td> </tr> </table> </td> </tr> <tr> <td class="imdetail"><a name="createTextNode" class="membertitle">createTextNode</a><table border="0" width="96%" cellpadding="5" cellspacing="0" class="table-in-method" bgcolor="#ffffff" align="center"> <tr> <td><table class="table-in-method" border="0"> <tr> <td valign="top" colspan="3"><a href="XText.html">XText</a></td> </tr> <tr> <td valign="top"><b>createTextNode</b>(</td> <td valign="top">[in] string</td> <td valign="bottom"> data );</td> </tr> </table> <hr> <dl> <dt><b>Description</b></dt> <dd>Creates a Text node given the specified string. </dd> </dl> </td> </tr> </table> </td> </tr> <tr> <td class="imdetail"><a name="getDoctype" class="membertitle">getDoctype</a><table border="0" width="96%" cellpadding="5" cellspacing="0" class="table-in-method" bgcolor="#ffffff" align="center"> <tr> <td><table class="table-in-method" border="0"> <tr> <td valign="top" colspan="3"><a href="XDocumentType.html">XDocumentType</a></td> </tr> <tr> <td valign="top"><b>getDoctype</b>();</td> </tr> </table> <hr> <dl> <dt><b>Description</b></dt> <dd>The Document Type Declaration (see DocumentType) associated with this document. </dd> </dl> </td> </tr> </table> </td> </tr> <tr> <td class="imdetail"><a name="getDocumentElement" class="membertitle">getDocumentElement</a><table border="0" width="96%" cellpadding="5" cellspacing="0" class="table-in-method" bgcolor="#ffffff" align="center"> <tr> <td><table class="table-in-method" border="0"> <tr> <td valign="top" colspan="3"><a href="XElement.html">XElement</a></td> </tr> <tr> <td valign="top"><b>getDocumentElement</b>();</td> </tr> </table> <hr> <dl> <dt><b>Description</b></dt> <dd>This is a convenience attribute that allows direct access to the child node that is the root element of the document. </dd> </dl> </td> </tr> </table> </td> </tr> <tr> <td class="imdetail"><a name="getElementById" class="membertitle">getElementById</a><table border="0" width="96%" cellpadding="5" cellspacing="0" class="table-in-method" bgcolor="#ffffff" align="center"> <tr> <td><table class="table-in-method" border="0"> <tr> <td valign="top" colspan="3"><a href="XElement.html">XElement</a></td> </tr> <tr> <td valign="top"><b>getElementById</b>(</td> <td valign="top">[in] string</td> <td valign="bottom"> elementId );</td> </tr> </table> <hr> <dl> <dt><b>Description</b></dt> <dd>Returns the Element whose ID is given by elementId. </dd> </dl> </td> </tr> </table> </td> </tr> <tr> <td class="imdetail"><a name="getElementsByTagName" class="membertitle">getElementsByTagName</a><table border="0" width="96%" cellpadding="5" cellspacing="0" class="table-in-method" bgcolor="#ffffff" align="center"> <tr> <td><table class="table-in-method" border="0"> <tr> <td valign="top" colspan="3"><a href="XNodeList.html">XNodeList</a></td> </tr> <tr> <td valign="top"><b>getElementsByTagName</b>(</td> <td valign="top">[in] string</td> <td valign="bottom"> tagname );</td> </tr> </table> <hr> <dl> <dt><b>Description</b></dt> <dd>Returns a NodeList of all the Elements with a given tag name in the order in which they are encountered in a preorder traversal of the Document tree. </dd> </dl> </td> </tr> </table> </td> </tr> <tr> <td class="imdetail"><a name="getElementsByTagNameNS" class="membertitle">getElementsByTagNameNS</a><table border="0" width="96%" cellpadding="5" cellspacing="0" class="table-in-method" bgcolor="#ffffff" align="center"> <tr> <td><table class="table-in-method" border="0"> <tr> <td valign="top" colspan="3"><a href="XNodeList.html">XNodeList</a></td> </tr> <tr> <td valign="top"><b>getElementsByTagNameNS</b>(</td> <td valign="top">[in] string</td> <td valign="bottom"> namespaceURI,</td> </tr> <tr> <td/><td valign="top">[in] string</td> <td valign="bottom"> localName );</td> </tr> </table> <hr> <dl> <dt><b>Description</b></dt> <dd>Returns a NodeList of all the Elements with a given local name and namespace URI in the order in which they are encountered in a preorder traversal of the Document tree. </dd> </dl> </td> </tr> </table> </td> </tr> <tr> <td class="imdetail"><a name="getImplementation" class="membertitle">getImplementation</a><table border="0" width="96%" cellpadding="5" cellspacing="0" class="table-in-method" bgcolor="#ffffff" align="center"> <tr> <td><table class="table-in-method" border="0"> <tr> <td valign="top" colspan="3"><a href="XDOMImplementation.html">XDOMImplementation</a></td> </tr> <tr> <td valign="top"><b>getImplementation</b>();</td> </tr> </table> <hr> <dl> <dt><b>Description</b></dt> <dd>The DOMImplementation object that handles this document. </dd> </dl> </td> </tr> </table> </td> </tr> <tr> <td class="imdetail"><a name="importNode" class="membertitle">importNode</a><table border="0" width="96%" cellpadding="5" cellspacing="0" class="table-in-method" bgcolor="#ffffff" align="center"> <tr> <td><table class="table-in-method" border="0"> <tr> <td valign="top" colspan="3"><a href="XNode.html">XNode</a></td> </tr> <tr> <td valign="top"><b>importNode</b>(</td> <td valign="top">[in] <a href="XNode.html">XNode</a></td> <td valign="bottom"> importedNode,</td> </tr> <tr> <td/><td valign="top">[in] boolean</td> <td valign="bottom"> deep )</td> </tr> <tr> <td valign="top" align="right">raises( </td> <td valign="top" colspan="2"><a href="DOMException.html">DOMException</a> );</td> </tr> </table> <hr> <dl> <dt><b>Description</b></dt> <dd>Imports a node from another document to this document. Throws: DOMException - NOT_SUPPORTED_ERR: Raised if the type of node being imported is not supported. </dd> </dl> </td> </tr> </table> </td> </tr> </table> <a href="#_top_">Top of Page</a><hr size="3"><p class="copyright" align="center">Copyright © 2008 Sun Microsystems, Inc.</p> </div> <!-- id="adc-idlref" --> </body> </html>