Sophie

Sophie

distrib > Mandriva > 8.2 > i586 > media > contrib > by-pkgid > 112b0974ad288f6cd55bf971ee6026a9 > files > 1212

libqt3-devel-3.0.2-2mdk.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- /tmp/qt-3.0-reggie-28534/qt-x11-free-3.0.2/src/xml/qdom.cpp:5797 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>QDomDocument Class</title>
<style type="text/css"><!--
h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
body { background: #ffffff; color: black; }
--></style>
</head>
<body>

<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr bgcolor="#E5E5E5">
<td valign=center>
 <a href="index.html">
<font color="#004faf">Home</font></a>
 | <a href="classes.html">
<font color="#004faf">All&nbsp;Classes</font></a>
 | <a href="mainclasses.html">
<font color="#004faf">Main&nbsp;Classes</font></a>
 | <a href="annotated.html">
<font color="#004faf">Annotated</font></a>
 | <a href="groups.html">
<font color="#004faf">Grouped&nbsp;Classes</font></a>
 | <a href="functions.html">
<font color="#004faf">Functions</font></a>
</td>
<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QDomDocument Class Reference<br><small>[<a href="xml.html">XML module</a>]</small></h1>

<p>The QDomDocument class represents an XML document.
<a href="#details">More...</a>
<p><tt>#include &lt;<a href="qdom-h.html">qdom.h</a>&gt;</tt>
<p>Inherits <a href="qdomnode.html">QDomNode</a>.
<p><a href="qdomdocument-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li><div class=fn><a href="#QDomDocument"><b>QDomDocument</b></a> ()</div></li>
<li><div class=fn><a href="#QDomDocument-2"><b>QDomDocument</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;name )</div></li>
<li><div class=fn><a href="#QDomDocument-3"><b>QDomDocument</b></a> ( const&nbsp;QDomDocumentType&nbsp;&amp;&nbsp;doctype )</div></li>
<li><div class=fn><a href="#QDomDocument-4"><b>QDomDocument</b></a> ( const&nbsp;QDomDocument&nbsp;&amp;&nbsp;x )</div></li>
<li><div class=fn>QDomDocument &amp; <a href="#operator-eq"><b>operator=</b></a> ( const&nbsp;QDomDocument&nbsp;&amp;&nbsp;x )</div></li>
<li><div class=fn><a href="#~QDomDocument"><b>~QDomDocument</b></a> ()</div></li>
<li><div class=fn>QDomElement <a href="#createElement"><b>createElement</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;tagName )</div></li>
<li><div class=fn>QDomDocumentFragment <a href="#createDocumentFragment"><b>createDocumentFragment</b></a> ()</div></li>
<li><div class=fn>QDomText <a href="#createTextNode"><b>createTextNode</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;value )</div></li>
<li><div class=fn>QDomComment <a href="#createComment"><b>createComment</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;value )</div></li>
<li><div class=fn>QDomCDATASection <a href="#createCDATASection"><b>createCDATASection</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;value )</div></li>
<li><div class=fn>QDomProcessingInstruction <a href="#createProcessingInstruction"><b>createProcessingInstruction</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;target, const&nbsp;QString&nbsp;&amp;&nbsp;data )</div></li>
<li><div class=fn>QDomAttr <a href="#createAttribute"><b>createAttribute</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;name )</div></li>
<li><div class=fn>QDomEntityReference <a href="#createEntityReference"><b>createEntityReference</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;name )</div></li>
<li><div class=fn>QDomNodeList <a href="#elementsByTagName"><b>elementsByTagName</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;tagname ) const</div></li>
<li><div class=fn>QDomNode <a href="#importNode"><b>importNode</b></a> ( const&nbsp;QDomNode&nbsp;&amp;&nbsp;importedNode, bool&nbsp;deep )</div></li>
<li><div class=fn>QDomElement <a href="#createElementNS"><b>createElementNS</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;nsURI, const&nbsp;QString&nbsp;&amp;&nbsp;qName )</div></li>
<li><div class=fn>QDomAttr <a href="#createAttributeNS"><b>createAttributeNS</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;nsURI, const&nbsp;QString&nbsp;&amp;&nbsp;qName )</div></li>
<li><div class=fn>QDomNodeList <a href="#elementsByTagNameNS"><b>elementsByTagNameNS</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;nsURI, const&nbsp;QString&nbsp;&amp;&nbsp;localName )</div></li>
<li><div class=fn>QDomElement <a href="#elementById"><b>elementById</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;elementId )</div></li>
<li><div class=fn>QDomDocumentType <a href="#doctype"><b>doctype</b></a> () const</div></li>
<li><div class=fn>QDomImplementation <a href="#implementation"><b>implementation</b></a> () const</div></li>
<li><div class=fn>QDomElement <a href="#documentElement"><b>documentElement</b></a> () const</div></li>
<li><div class=fn>bool <a href="#setContent-2"><b>setContent</b></a> ( const&nbsp;QCString&nbsp;&amp;&nbsp;buffer, bool&nbsp;namespaceProcessing, QString&nbsp;*&nbsp;errorMsg = 0, int&nbsp;*&nbsp;errorLine = 0, int&nbsp;*&nbsp;errorColumn = 0 )</div></li>
<li><div class=fn>bool <a href="#setContent-3"><b>setContent</b></a> ( const&nbsp;QByteArray&nbsp;&amp;&nbsp;buffer, bool&nbsp;namespaceProcessing, QString&nbsp;*&nbsp;errorMsg = 0, int&nbsp;*&nbsp;errorLine = 0, int&nbsp;*&nbsp;errorColumn = 0 )</div></li>
<li><div class=fn>bool <a href="#setContent"><b>setContent</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;text, bool&nbsp;namespaceProcessing, QString&nbsp;*&nbsp;errorMsg = 0, int&nbsp;*&nbsp;errorLine = 0, int&nbsp;*&nbsp;errorColumn = 0 )</div></li>
<li><div class=fn>bool <a href="#setContent-4"><b>setContent</b></a> ( QIODevice&nbsp;*&nbsp;dev, bool&nbsp;namespaceProcessing, QString&nbsp;*&nbsp;errorMsg = 0, int&nbsp;*&nbsp;errorLine = 0, int&nbsp;*&nbsp;errorColumn = 0 )</div></li>
<li><div class=fn>bool <a href="#setContent-5"><b>setContent</b></a> ( const&nbsp;QCString&nbsp;&amp;&nbsp;buffer, QString&nbsp;*&nbsp;errorMsg = 0, int&nbsp;*&nbsp;errorLine = 0, int&nbsp;*&nbsp;errorColumn = 0 )</div></li>
<li><div class=fn>bool <a href="#setContent-6"><b>setContent</b></a> ( const&nbsp;QByteArray&nbsp;&amp;&nbsp;buffer, QString&nbsp;*&nbsp;errorMsg = 0, int&nbsp;*&nbsp;errorLine = 0, int&nbsp;*&nbsp;errorColumn = 0 )</div></li>
<li><div class=fn>bool <a href="#setContent-7"><b>setContent</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;text, QString&nbsp;*&nbsp;errorMsg = 0, int&nbsp;*&nbsp;errorLine = 0, int&nbsp;*&nbsp;errorColumn = 0 )</div></li>
<li><div class=fn>bool <a href="#setContent-8"><b>setContent</b></a> ( QIODevice&nbsp;*&nbsp;dev, QString&nbsp;*&nbsp;errorMsg = 0, int&nbsp;*&nbsp;errorLine = 0, int&nbsp;*&nbsp;errorColumn = 0 )</div></li>
<li><div class=fn>virtual QDomNode::NodeType <a href="#nodeType"><b>nodeType</b></a> () const</div></li>
<li><div class=fn>virtual bool <a href="#isDocument"><b>isDocument</b></a> () const</div></li>
<li><div class=fn>QString <a href="#toString"><b>toString</b></a> () const</div></li>
<li><div class=fn>QCString <a href="#toCString"><b>toCString</b></a> () const</div></li>
</ul>
<hr><a name="details"></a><h2>Detailed Description</h2>



The QDomDocument class represents an XML document.
<p> 
<p> The QDomDocument class represents the entire XML document.
Conceptually, it is the root of the document tree, and provides the
primary access to the document's data.
<p> Since elements, text nodes, comments, processing instructions, etc.
cannot exist outside the context of a document, the document class
also contains the factory functions needed to create these objects.
The node objects created have an  <a href="qdomnode.html#ownerDocument">ownerDocument</a>() function which
associates them with the document within whose context they were
created. The DOM classes that will be used most often are <a href="qdomnode.html">QDomNode</a>,
QDomDocument, <a href="qdomelement.html">QDomElement</a> and <a href="qdomtext.html">QDomText</a>.
<p> The parsed XML is represented internally by a tree of objects that can
be accessed using the various QDom classes. All QDom classes only <em>reference</em> objects in the internal tree. The internal objects in the
DOM tree will get deleted, once the last QDom object referencing them
and the QDomDocument itself are deleted.
<p> Creation of elements, text nodes, etc. is done via the various factory
functions provided in this class. Using the default constructors of
the QDom classes will only result in empty objects, that cannot be
manipulated or inserted into the Document.
<p> The QDomDocument class has several functions for creating document
data, for example, <a href="#createElement">createElement</a>(), <a href="#createTextNode">createTextNode</a>(), <a href="#createComment">createComment</a>(),
<a href="#createCDATASection">createCDATASection</a>(), <a href="#createProcessingInstruction">createProcessingInstruction</a>(), <a href="#createAttribute">createAttribute</a>()
and <a href="#createEntityReference">createEntityReference</a>(). Some of these functions have versions
that support namespaces, i.e. <a href="#createElementNS">createElementNS</a>() and
<a href="#createAttributeNS">createAttributeNS</a>(). The <a href="#createDocumentFragment">createDocumentFragment</a>() function is used to
hold parts of the document, e.g. for complex documents.
<p> The entire content of the document is set with <a href="#setContent">setContent</a>(). This
function parses the string it is passed as an XML document and creates
the DOM tree that represents the document. The root element is
available using <a href="#documentElement">documentElement</a>(). The textual representation of the
document can be obtained using <a href="#toString">toString</a>().
<p> It is possible to insert a node from another document into the
document using <a href="#importNode">importNode</a>().
<p> You can obtain a list of all the elements that have a particular tag
with <a href="#elementsByTagName">elementsByTagName</a>() or with <a href="#elementsByTagNameNS">elementsByTagNameNS</a>().
<p> The QDom classes are typically used as follows:
<pre>
  QDomDocument doc( "mydocument" );
  <a href="qfile.html">QFile</a> f( "mydocument.xml" );
  if ( !f.<a href="qfile.html#open">open</a>( <a href="qfile.html#open">IO_ReadOnly</a> ) )
      return;
  if ( !doc.<a href="#setContent">setContent</a>( &amp;f ) ) {
      f.<a href="qfile.html#close">close</a>();
      return;
  }
  f.<a href="qfile.html#close">close</a>();

  // print out the element names of all elements that are direct children
  // of the outermost element.
  <a href="qdomelement.html">QDomElement</a> docElem = doc.<a href="#documentElement">documentElement</a>();

  <a href="qdomnode.html">QDomNode</a> n = docElem.<a href="qdomnode.html#firstChild">firstChild</a>();
  while( !n.<a href="qdomnode.html#isNull">isNull</a>() ) {
      <a href="qdomelement.html">QDomElement</a> e = n.<a href="qdomnode.html#toElement">toElement</a>(); // try to convert the node to an element.
      if( !e.<a href="qdomnode.html#isNull">isNull</a>() ) {
          cout &lt;&lt; e.<a href="qdomelement.html#tagName">tagName</a>() &lt;&lt; endl; // the node really is an element.
      }
      n = n.<a href="qdomnode.html#nextSibling">nextSibling</a>();
  }

  // Here we append a new element to the end of the document
  <a href="qdomelement.html">QDomElement</a> elem = doc.<a href="#createElement">createElement</a>( "img" );
  elem.<a href="qdomelement.html#setAttribute">setAttribute</a>( "src", "myimage.png" );
  docElem.<a href="qdomnode.html#appendChild">appendChild</a>( elem );
  </pre>
 
<p> Once <tt>doc</tt> and <tt>elem</tt> go out of scode, the whole internal tree representing
the XML document will get deleted.
<p> To create a document using DOM use code like this:
<pre>
    QDomDocument doc( "MyML" );
    <a href="qdomelement.html">QDomElement</a> root = doc.<a href="#createElement">createElement</a>( "MyML" );
    doc.<a href="qdomnode.html#appendChild">appendChild</a>( root );

    <a href="qdomelement.html">QDomElement</a> tag = doc.<a href="#createElement">createElement</a>( "Greeting" );
    root.<a href="qdomnode.html#appendChild">appendChild</a>( tag );

    <a href="qdomtext.html">QDomText</a> t = doc.<a href="#createTextNode">createTextNode</a>( "Hello World" );
    tag.<a href="qdomnode.html#appendChild">appendChild</a>( t );

    <a href="qstring.html">QString</a> xml = doc.<a href="#toString">toString</a>();
    </pre>
 
<p> For further information about the Document Object Model see
<a href="http://www.w3.org/TR/REC-DOM-Level-1/">http://www.w3.org/TR/REC-DOM-Level-1/</a> and
<a href="http://www.w3.org/TR/DOM-Level-2-Core/">http://www.w3.org/TR/DOM-Level-2-Core/</a>.
For a more general introduction of the DOM implementation see the
QDomDocument documentation.
<p>See also <a href="xml-tools.html">XML</a>.

<hr><h2>Member Function Documentation</h2>
<h3 class=fn><a name="QDomDocument"></a>QDomDocument::QDomDocument ()
</h3>
Constructs an empty document.

<h3 class=fn><a name="QDomDocument-2"></a>QDomDocument::QDomDocument ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;name )
</h3>
Creates a document and sets the name of the document type to <em>name</em>.

<h3 class=fn><a name="QDomDocument-3"></a>QDomDocument::QDomDocument ( const&nbsp;<a href="qdomdocumenttype.html">QDomDocumentType</a>&nbsp;&amp;&nbsp;doctype )
</h3>
Creates a document with the document type <em>doctype</em>.
<p> <p>See also <a href="qdomimplementation.html#createDocumentType">QDomImplementation::createDocumentType</a>().

<h3 class=fn><a name="QDomDocument-4"></a>QDomDocument::QDomDocument ( const&nbsp;<a href="qdomdocument.html">QDomDocument</a>&nbsp;&amp;&nbsp;x )
</h3>
Constructs a copy of <em>x</em>.
<p> The data of the copy is shared (shallow copy): modifying one node will also
change the other. If you want to make a <a href="shclass.html#deep-copy">deep copy</a>, use <a href="qdomnode.html#cloneNode">cloneNode</a>().

<h3 class=fn><a name="~QDomDocument"></a>QDomDocument::~QDomDocument ()
</h3>
Destroys the object and frees its resources.

<h3 class=fn><a href="qdomattr.html">QDomAttr</a> <a name="createAttribute"></a>QDomDocument::createAttribute ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;name )
</h3>
Creates a new attribute called <em>name</em> that can be inserted into an
element, e.g. using <a href="qdomelement.html#setAttributeNode">QDomElement::setAttributeNode</a>().
<p> <p>See also <a href="#createAttributeNS">createAttributeNS</a>().

<h3 class=fn><a href="qdomattr.html">QDomAttr</a> <a name="createAttributeNS"></a>QDomDocument::createAttributeNS ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;nsURI, const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;qName )
</h3>
Creates a new attribute with namespace support that can be inserted into an
element. The name of the attribute is <em>qName</em> and the namespace URI
is <em>nsURI</em>. This function also sets <a href="qdomnode.html#prefix">QDomNode::prefix</a>() and
<a href="qdomnode.html#localName">QDomNode::localName</a>() to appropriate values (depending on <em>qName</em>).
<p> <p>See also <a href="#createAttribute">createAttribute</a>().

<h3 class=fn><a href="qdomcdatasection.html">QDomCDATASection</a> <a name="createCDATASection"></a>QDomDocument::createCDATASection ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;value )
</h3>
Creates a new CDATA section for the string <em>value</em> that can be inserted into
the document, e.g. using <a href="qdomnode.html#appendChild">QDomNode::appendChild</a>().
<p> <p>See also <a href="qdomnode.html#appendChild">QDomNode::appendChild</a>(), <a href="qdomnode.html#insertBefore">QDomNode::insertBefore</a>() and <a href="qdomnode.html#insertAfter">QDomNode::insertAfter</a>().

<h3 class=fn><a href="qdomcomment.html">QDomComment</a> <a name="createComment"></a>QDomDocument::createComment ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;value )
</h3>
Creates a new comment for the string <em>value</em> that can be inserted into the
document, e.g. using <a href="qdomnode.html#appendChild">QDomNode::appendChild</a>().
<p> <p>See also <a href="qdomnode.html#appendChild">QDomNode::appendChild</a>(), <a href="qdomnode.html#insertBefore">QDomNode::insertBefore</a>() and <a href="qdomnode.html#insertAfter">QDomNode::insertAfter</a>().

<h3 class=fn><a href="qdomdocumentfragment.html">QDomDocumentFragment</a> <a name="createDocumentFragment"></a>QDomDocument::createDocumentFragment ()
</h3>
Creates a new document fragment, that can be used to hold parts of the
document, e.g. when doing complex manipulations of the document tree.

<h3 class=fn><a href="qdomelement.html">QDomElement</a> <a name="createElement"></a>QDomDocument::createElement ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;tagName )
</h3>
Creates a new element called <em>tagName</em> that can be inserted into the
DOM tree, e.g. using <a href="qdomnode.html#appendChild">QDomNode::appendChild</a>().
<p> <p>See also <a href="#createElementNS">createElementNS</a>(), <a href="qdomnode.html#appendChild">QDomNode::appendChild</a>(), <a href="qdomnode.html#insertBefore">QDomNode::insertBefore</a>() and <a href="qdomnode.html#insertAfter">QDomNode::insertAfter</a>().

<h3 class=fn><a href="qdomelement.html">QDomElement</a> <a name="createElementNS"></a>QDomDocument::createElementNS ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;nsURI, const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;qName )
</h3>
Creates a new element with namespace support that can be inserted into the
DOM tree. The name of the element is <em>qName</em> and the namespace URI
is <em>nsURI</em>. This function also sets <a href="qdomnode.html#prefix">QDomNode::prefix</a>() and
<a href="qdomnode.html#localName">QDomNode::localName</a>() to appropriate values (depending on <em>qName</em>).
<p> <p>See also <a href="#createElement">createElement</a>().

<h3 class=fn><a href="qdomentityreference.html">QDomEntityReference</a> <a name="createEntityReference"></a>QDomDocument::createEntityReference ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;name )
</h3>
Creates a new entity reference called <em>name</em> that can be inserted
into the document, e.g. using <a href="qdomnode.html#appendChild">QDomNode::appendChild</a>().
<p> <p>See also <a href="qdomnode.html#appendChild">QDomNode::appendChild</a>(), <a href="qdomnode.html#insertBefore">QDomNode::insertBefore</a>() and <a href="qdomnode.html#insertAfter">QDomNode::insertAfter</a>().

<h3 class=fn><a href="qdomprocessinginstruction.html">QDomProcessingInstruction</a> <a name="createProcessingInstruction"></a>QDomDocument::createProcessingInstruction ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;target, const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;data )
</h3>
Creates a new processing instruction that can be inserted into the document,
e.g. using <a href="qdomnode.html#appendChild">QDomNode::appendChild</a>(). This function sets the target for the
processing instruction to <em>target</em> and the data to <em>data</em>.
<p> <p>See also <a href="qdomnode.html#appendChild">QDomNode::appendChild</a>(), <a href="qdomnode.html#insertBefore">QDomNode::insertBefore</a>() and <a href="qdomnode.html#insertAfter">QDomNode::insertAfter</a>().

<h3 class=fn><a href="qdomtext.html">QDomText</a> <a name="createTextNode"></a>QDomDocument::createTextNode ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;value )
</h3>
Creates a text node for the string <em>value</em> that can be inserted into the
document tree, e.g. using <a href="qdomnode.html#appendChild">QDomNode::appendChild</a>().
<p> <p>See also <a href="qdomnode.html#appendChild">QDomNode::appendChild</a>(), <a href="qdomnode.html#insertBefore">QDomNode::insertBefore</a>() and <a href="qdomnode.html#insertAfter">QDomNode::insertAfter</a>().

<h3 class=fn><a href="qdomdocumenttype.html">QDomDocumentType</a> <a name="doctype"></a>QDomDocument::doctype () const
</h3>
Returns the document type of this document.

<h3 class=fn><a href="qdomelement.html">QDomElement</a> <a name="documentElement"></a>QDomDocument::documentElement () const
</h3>
Returns the root element of the document.

<h3 class=fn><a href="qdomelement.html">QDomElement</a> <a name="elementById"></a>QDomDocument::elementById ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;elementId )
</h3>
Returns the element whose ID is equal to <em>elementId</em>. If no element with the
ID was found, this function returns a null element.
<p> Since the actual version of the QDomClasses does not know which attributes
are element IDs, this function returns always a null element. This may change
in a future version.

<h3 class=fn><a href="qdomnodelist.html">QDomNodeList</a> <a name="elementsByTagName"></a>QDomDocument::elementsByTagName ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;tagname ) const
</h3>
Returns a <a href="qdomnodelist.html">QDomNodeList</a>, that contains all the elements in the document
with the name <em>tagname</em>. The order of the node list is the order they are
encountered in a preorder traversal of the element tree.
<p> <p>See also <a href="#elementsByTagNameNS">elementsByTagNameNS</a>() and <a href="qdomelement.html#elementsByTagName">QDomElement::elementsByTagName</a>().

<h3 class=fn><a href="qdomnodelist.html">QDomNodeList</a> <a name="elementsByTagNameNS"></a>QDomDocument::elementsByTagNameNS ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;nsURI, const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;localName )
</h3>
Returns a <a href="qdomnodelist.html">QDomNodeList</a> that contains all the elements in the document
with the local name <em>localName</em> and a namespace URI of <em>nsURI</em>. The order
of the node list, is the order they are encountered in a preorder traversal
of the element tree.
<p> <p>See also <a href="#elementsByTagName">elementsByTagName</a>() and <a href="qdomelement.html#elementsByTagNameNS">QDomElement::elementsByTagNameNS</a>().

<h3 class=fn><a href="qdomimplementation.html">QDomImplementation</a> <a name="implementation"></a>QDomDocument::implementation () const
</h3>
Returns a <a href="qdomimplementation.html">QDomImplementation</a> object.

<h3 class=fn><a href="qdomnode.html">QDomNode</a> <a name="importNode"></a>QDomDocument::importNode ( const&nbsp;<a href="qdomnode.html">QDomNode</a>&nbsp;&amp;&nbsp;importedNode, bool&nbsp;deep )
</h3>
Imports the node <em>importedNode</em> from another document to this document. <em>importedNode</em> remains in the original document; this function creates a copy
of it that can be used within this document.
<p> This function returns the imported node that belongs to this document. The
returned node has no parent. It is not possible to import QDomDocument and
<a href="qdomdocumenttype.html">QDomDocumentType</a> nodes. In those cases this function returns a null node.
<p> If <em>deep</em> is TRUE, this function imports not only the node <em>importedNode</em>
but the whole subtree; if it is FALSE, only the <em>importedNode</em> is imported.
The argument <em>deep</em> has no effect on <a href="qdomattr.html">QDomAttr</a> and <a href="qdomentityreference.html">QDomEntityReference</a>
nodes, since the descendants of QDomAttr nodes are always imported and those
of QDomEntityReference nodes are never imported.
<p> The behavior of this function is slightly different depending on the node
types:
<ul>
<li> QDomAttr - The owner element is set to 0 and the specified flag is set
to TRUE on the generated attribute.  The whole subtree of <em>importedNode</em> is always imported for attribute nodes - <em>deep</em> has no
effect.
<li> QDomDocument - Document nodes cannot be imported.
<li> <a href="qdomdocumentfragment.html">QDomDocumentFragment</a> - If <em>deep</em> is TRUE, this function imports the
whole document fragment, otherwise it only generates an empty document
fragment.
<li> <a href="qdomdocumenttype.html">QDomDocumentType</a> - Document type nodes cannot be imported.
<li> <a href="qdomelement.html">QDomElement</a> - Attributes for which <a href="qdomattr.html#specified">QDomAttr::specified</a>() is TRUE are
also imported, other attributes are not imported.  If <em>deep</em> is TRUE,
this function also imports the subtree of <em>importedNode</em>, otherwise it
imports only the element node (and some attributes, see above).
<li> <a href="qdomentity.html">QDomEntity</a> - Entity nodes can be imported, but at the moment there is no
way to use them since the document type is readonly in DOM level 2.
<li> <a href="qdomentityreference.html">QDomEntityReference</a> - Descendants of entity reference nodes are never
imported - <em>deep</em> has no effect.
<li> <a href="qdomnotation.html">QDomNotation</a> - Notation nodes can be imported, but at the moment there
is no way to use them since the document type is readonly in DOM level 2.
<li> <a href="qdomprocessinginstruction.html">QDomProcessingInstruction</a> - The target and value of the processing
instruction is copied to the new node.
<li> <a href="qdomtext.html">QDomText</a>, <a href="qdomcdatasection.html">QDomCDATASection</a> and <a href="qdomcomment.html">QDomComment</a> - The text is copied to the
new node.
</ul>
<p> <p>See also <a href="qdomelement.html#setAttribute">QDomElement::setAttribute</a>(), <a href="qdomnode.html#insertBefore">QDomNode::insertBefore</a>(), <a href="qdomnode.html#insertAfter">QDomNode::insertAfter</a>(), <a href="qdomnode.html#replaceChild">QDomNode::replaceChild</a>(), <a href="qdomnode.html#removeChild">QDomNode::removeChild</a>() and <a href="qdomnode.html#appendChild">QDomNode::appendChild</a>().

<h3 class=fn>bool <a name="isDocument"></a>QDomDocument::isDocument () const<tt> [virtual]</tt>
</h3>
Returns TRUE.

<p>Reimplemented from <a href="qdomnode.html#isDocument">QDomNode</a>.
<h3 class=fn><a href="qdomnode.html#NodeType-enum">QDomNode::NodeType</a> <a name="nodeType"></a>QDomDocument::nodeType () const<tt> [virtual]</tt>
</h3>
Returns <a href="qdomnode.html#NodeType-enum">DocumentNode</a>.

<p>Reimplemented from <a href="qdomnode.html#nodeType">QDomNode</a>.
<h3 class=fn><a href="qdomdocument.html">QDomDocument</a>&nbsp;&amp; <a name="operator-eq"></a>QDomDocument::operator= ( const&nbsp;<a href="qdomdocument.html">QDomDocument</a>&nbsp;&amp;&nbsp;x )
</h3>
Assigns <em>x</em> to this DOM document.
<p> The data of the copy is shared (shallow copy): modifying one node will also
change the other. If you want to make a <a href="shclass.html#deep-copy">deep copy</a>, use <a href="qdomnode.html#cloneNode">cloneNode</a>().

<h3 class=fn>bool <a name="setContent"></a>QDomDocument::setContent ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;text, bool&nbsp;namespaceProcessing, <a href="qstring.html">QString</a>&nbsp;*&nbsp;errorMsg = 0, int&nbsp;*&nbsp;errorLine = 0, int&nbsp;*&nbsp;errorColumn = 0 )
</h3>
This function parses the string <em>text</em> and sets it as the content of the
document. If <em>namespaceProcessing</em> is TRUE, the parser recognizes namespaces
in the XML file and sets the prefix name, local name and namespace URI to
appropriate values. If <em>namespaceProcessing</em> is FALSE, the parser does no
namespace processing when it reads the XML file.
<p> If a parse error occurs, the function returns FALSE; otherwise TRUE. If a
parse error occurs the error message is placed in <em>*</em><em>errorMsg</em>, the line
number in <em>*</em><em>errorLine</em> and the column number in <em>*</em><em>errorColumn</em>. These
error variables will only be populated if they are non-null.
<p> If <em>namespaceProcessing</em> is TRUE, the function <a href="qdomnode.html#prefix">QDomNode::prefix</a>() returns
a string for all elements and attributes. It returns an empty string if the
element or attribute has no prefix.
<p> If <em>namespaceProcessing</em> is FALSE, the functions QDomNode::prefix(),
<a href="qdomnode.html#localName">QDomNode::localName</a>() and <a href="qdomnode.html#namespaceURI">QDomNode::namespaceURI</a>() return a null string.
<p> <p>See also <a href="qdomnode.html#namespaceURI">QDomNode::namespaceURI</a>(), <a href="qdomnode.html#localName">QDomNode::localName</a>(), <a href="qdomnode.html#prefix">QDomNode::prefix</a>(), <a href="qstring.html#isNull">QString::isNull</a>() and <a href="qstring.html#isEmpty">QString::isEmpty</a>().

<h3 class=fn>bool <a name="setContent-2"></a>QDomDocument::setContent ( const&nbsp;<a href="qcstring.html">QCString</a>&nbsp;&amp;&nbsp;buffer, bool&nbsp;namespaceProcessing, <a href="qstring.html">QString</a>&nbsp;*&nbsp;errorMsg = 0, int&nbsp;*&nbsp;errorLine = 0, int&nbsp;*&nbsp;errorColumn = 0 )
</h3>  This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> This function reads the XML document from the C string <em>buffer</em>.

<h3 class=fn>bool <a name="setContent-3"></a>QDomDocument::setContent ( const&nbsp;<a href="qbytearray.html">QByteArray</a>&nbsp;&amp;&nbsp;buffer, bool&nbsp;namespaceProcessing, <a href="qstring.html">QString</a>&nbsp;*&nbsp;errorMsg = 0, int&nbsp;*&nbsp;errorLine = 0, int&nbsp;*&nbsp;errorColumn = 0 )
</h3>  This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> This function reads the XML document from the byte array <em>buffer</em>.

<h3 class=fn>bool <a name="setContent-4"></a>QDomDocument::setContent ( <a href="qiodevice.html">QIODevice</a>&nbsp;*&nbsp;dev, bool&nbsp;namespaceProcessing, <a href="qstring.html">QString</a>&nbsp;*&nbsp;errorMsg = 0, int&nbsp;*&nbsp;errorLine = 0, int&nbsp;*&nbsp;errorColumn = 0 )
</h3>  This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> This function reads the XML document from the IO device <em>dev</em>.

<h3 class=fn>bool <a name="setContent-5"></a>QDomDocument::setContent ( const&nbsp;<a href="qcstring.html">QCString</a>&nbsp;&amp;&nbsp;buffer, <a href="qstring.html">QString</a>&nbsp;*&nbsp;errorMsg = 0, int&nbsp;*&nbsp;errorLine = 0, int&nbsp;*&nbsp;errorColumn = 0 )
</h3>  This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> This function reads the XML document from the C string <em>buffer</em>.
<p> No namespace processing is done.

<h3 class=fn>bool <a name="setContent-6"></a>QDomDocument::setContent ( const&nbsp;<a href="qbytearray.html">QByteArray</a>&nbsp;&amp;&nbsp;buffer, <a href="qstring.html">QString</a>&nbsp;*&nbsp;errorMsg = 0, int&nbsp;*&nbsp;errorLine = 0, int&nbsp;*&nbsp;errorColumn = 0 )
</h3>  This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> This function reads the XML document from the byte array <em>buffer</em>.
<p> No namespace processing is done.

<h3 class=fn>bool <a name="setContent-7"></a>QDomDocument::setContent ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;text, <a href="qstring.html">QString</a>&nbsp;*&nbsp;errorMsg = 0, int&nbsp;*&nbsp;errorLine = 0, int&nbsp;*&nbsp;errorColumn = 0 )
</h3> This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> This function reads the XML document from the string <em>text</em>.
<p> No namespace processing is done.

<h3 class=fn>bool <a name="setContent-8"></a>QDomDocument::setContent ( <a href="qiodevice.html">QIODevice</a>&nbsp;*&nbsp;dev, <a href="qstring.html">QString</a>&nbsp;*&nbsp;errorMsg = 0, int&nbsp;*&nbsp;errorLine = 0, int&nbsp;*&nbsp;errorColumn = 0 )
</h3>  This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> This function reads the XML document from the IO device <em>dev</em>.
<p> No namespace processing is done.

<h3 class=fn><a href="qcstring.html">QCString</a> <a name="toCString"></a>QDomDocument::toCString () const
</h3>
Converts the parsed document back to its textual representation and returns a
<a href="qcstring.html">QCString</a> for that is encoded in UTF-8.
<p> <p>See also <a href="#toString">toString</a>().

<h3 class=fn><a href="qstring.html">QString</a> <a name="toString"></a>QDomDocument::toString () const
</h3>
Converts the parsed document back to its textual representation.
<p> <p>See also <a href="#toCString">toCString</a>().

<!-- eof -->
<hr><p>
This file is part of the <a href="index.html">Qt toolkit</a>.
Copyright &copy; 1995-2001
<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
<table width=100% cellspacing=0 border=0><tr>
<td>Copyright &copy; 2001 
<a href="http://www.trolltech.com">Trolltech</a><td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a>
<td align=right><div align=right>Qt version 3.0.2</div>
</table></div></address></body>
</html>