Qyoto  4.0.5
Qyoto is a C# language binding for Qt
 All Classes Namespaces Functions Variables Typedefs Enumerations Properties
QtXml.QDomDocument Class Reference

The QDomDocument class represents an XML document. More...

Inheritance diagram for QtXml.QDomDocument:
Collaboration diagram for QtXml.QDomDocument:

Public Member Functions

 QDomDocument ()
 
 
 QDomDocument (QDomDocumentType doctype)
 
 
 QDomDocument (QDomDocument x)
 
 
 QDomDocument (string name)
 
 
override void CreateProxy ()
 
new QDomAttr CreateAttribute (string name)
 
 
new QDomAttr CreateAttributeNS (string nsURI, string qName)
 
 
new QDomCDATASection CreateCDATASection (string data)
 
 
new QDomComment CreateComment (string data)
 
 
new QDomDocumentFragment CreateDocumentFragment ()
 
 
new QDomElement CreateElement (string tagName)
 
 
new QDomElement CreateElementNS (string nsURI, string qName)
 
 
new QDomEntityReference CreateEntityReference (string name)
 
 
new QDomProcessingInstruction CreateProcessingInstruction (string target, string data)
 
 
new QDomText CreateTextNode (string data)
 
 
new QDomDocumentType Doctype ()
 
 
new QDomElement DocumentElement ()
 
 
new QDomElement ElementById (string elementId)
 
 
new QDomNodeList ElementsByTagName (string tagname)
 
 
new QDomNodeList ElementsByTagNameNS (string nsURI, string localName)
 
 
new QDomImplementation Implementation ()
 
 
new QDomNode ImportNode (QDomNode importedNode, bool deep)
 
 
new QDomNode.NodeType nodeType ()
 
 
new bool SetContent (QXmlInputSource source, QXmlReader reader, System.Text.StringBuilder errorMsg=null)
 
 
new bool SetContent (QXmlInputSource source, QXmlReader reader, System.Text.StringBuilder errorMsg, ref int errorLine)
 
 
new bool SetContent (QXmlInputSource source, QXmlReader reader, System.Text.StringBuilder errorMsg, ref int errorLine, ref int errorColumn)
 
 
new bool SetContent (QByteArray text, System.Text.StringBuilder errorMsg=null)
 
 
new bool SetContent (QIODevice dev, System.Text.StringBuilder errorMsg=null)
 
 
new bool SetContent (QByteArray text, bool namespaceProcessing, System.Text.StringBuilder errorMsg=null)
 
 
new bool SetContent (QIODevice dev, bool namespaceProcessing, System.Text.StringBuilder errorMsg=null)
 
 
new bool SetContent (QXmlInputSource source, bool namespaceProcessing, System.Text.StringBuilder errorMsg=null)
 
 
new bool SetContent (QByteArray text, System.Text.StringBuilder errorMsg, ref int errorLine)
 
 
new bool SetContent (QIODevice dev, System.Text.StringBuilder errorMsg, ref int errorLine)
 
 
new bool SetContent (QByteArray text, System.Text.StringBuilder errorMsg, ref int errorLine, ref int errorColumn)
 
 
new bool SetContent (QIODevice dev, System.Text.StringBuilder errorMsg, ref int errorLine, ref int errorColumn)
 
 
new bool SetContent (QByteArray text, bool namespaceProcessing, System.Text.StringBuilder errorMsg, ref int errorLine)
 
 
new bool SetContent (QIODevice dev, bool namespaceProcessing, System.Text.StringBuilder errorMsg, ref int errorLine)
 
 
new bool SetContent (QXmlInputSource source, bool namespaceProcessing, System.Text.StringBuilder errorMsg, ref int errorLine)
 
 
new bool SetContent (QByteArray text, bool namespaceProcessing, System.Text.StringBuilder errorMsg, ref int errorLine, ref int errorColumn)
 
 
new bool SetContent (QIODevice dev, bool namespaceProcessing, System.Text.StringBuilder errorMsg, ref int errorLine, ref int errorColumn)
 
 
new bool SetContent (QXmlInputSource source, bool namespaceProcessing, System.Text.StringBuilder errorMsg, ref int errorLine, ref int errorColumn)
 
 
new bool SetContent (string text, System.Text.StringBuilder errorMsg=null)
 
 
new bool SetContent (string text, bool namespaceProcessing, System.Text.StringBuilder errorMsg=null)
 
 
new bool SetContent (string text, System.Text.StringBuilder errorMsg, ref int errorLine)
 
 
new bool SetContent (string text, System.Text.StringBuilder errorMsg, ref int errorLine, ref int errorColumn)
 
 
new bool SetContent (string text, bool namespaceProcessing, System.Text.StringBuilder errorMsg, ref int errorLine)
 
 
new bool SetContent (string text, bool namespaceProcessing, System.Text.StringBuilder errorMsg, ref int errorLine, ref int errorColumn)
 
 
new QByteArray ToByteArray (int arg1=1)
 
 
override string ToString ()
 
 
new string ToString (int arg1=1)
 
 
new void Dispose ()
 
- Public Member Functions inherited from QtXml.QDomNode
override bool Equals (object o)
 
override int GetHashCode ()
 
 QDomNode ()
 
 
 QDomNode (QDomNode arg1)
 
 
new QDomNode AppendChild (QDomNode newChild)
 
 
new QDomNamedNodeMap Attributes ()
 
 
new QDomNodeList ChildNodes ()
 
 
new void Clear ()
 
 
new QDomNode CloneNode (bool deep=true)
 
 
new int ColumnNumber ()
 
 
new QDomNode FirstChild ()
 
 
new QDomElement FirstChildElement (string tagName="")
 
 
new bool HasAttributes ()
 
 
new bool HasChildNodes ()
 
 
new QDomNode InsertAfter (QDomNode newChild, QDomNode refChild)
 
 
new QDomNode InsertBefore (QDomNode newChild, QDomNode refChild)
 
 
new bool IsAttr ()
 
 
new bool IsCDATASection ()
 
 
new bool IsCharacterData ()
 
 
new bool IsComment ()
 
 
new bool IsDocument ()
 
 
new bool IsDocumentFragment ()
 
 
new bool IsDocumentType ()
 
 
new bool IsElement ()
 
 
new bool IsEntity ()
 
 
new bool IsEntityReference ()
 
 
new bool IsNotation ()
 
 
new bool IsNull ()
 
 
new bool IsProcessingInstruction ()
 
 
new bool IsSupported (string feature, string version)
 
 
new bool IsText ()
 
 
new QDomNode LastChild ()
 
 
new QDomElement LastChildElement (string tagName="")
 
 
new int LineNumber ()
 
 
new string LocalName ()
 
 
new QDomNode NamedItem (string name)
 
 
new string NamespaceURI ()
 
 
new QDomNode NextSibling ()
 
 
new QDomElement NextSiblingElement (string taName="")
 
 
new string NodeName ()
 
 
new QDomNode.NodeType nodeType ()
 
 
new void Normalize ()
 
 
new QDomDocument OwnerDocument ()
 
 
new QDomNode ParentNode ()
 
 
new QDomNode PreviousSibling ()
 
 
new QDomElement PreviousSiblingElement (string tagName="")
 
 
new QDomNode RemoveChild (QDomNode oldChild)
 
 
new QDomNode ReplaceChild (QDomNode newChild, QDomNode oldChild)
 
 
new void Save (QTextStream arg1, int arg2)
 
 
new void Save (QTextStream arg1, int arg2, QDomNode.EncodingPolicy arg3)
 
 
new QDomAttr ToAttr ()
 
 
new QDomCDATASection ToCDATASection ()
 
 
new QDomCharacterData ToCharacterData ()
 
 
new QDomComment ToComment ()
 
 
new QDomDocument ToDocument ()
 
 
new QDomDocumentFragment ToDocumentFragment ()
 
 
new QDomDocumentType ToDocumentType ()
 
 
new QDomElement ToElement ()
 
 
new QDomEntity ToEntity ()
 
 
new QDomEntityReference ToEntityReference ()
 
 
new QDomNotation ToNotation ()
 
 
new QDomProcessingInstruction ToProcessingInstruction ()
 
 
new QDomText ToText ()
 
 
new void Dispose ()
 

Protected Member Functions

 QDomDocument (System.Type dummy)
 
- Protected Member Functions inherited from QtXml.QDomNode
 QDomNode (System.Type dummy)
 

Additional Inherited Members

- Public Types inherited from QtXml.QDomNode
enum  EncodingPolicy { EncodingFromDocument = 1, EncodingFromTextStream = 2 }
  More...
 
enum  NodeType {
  AttributeNode = 2, BaseNode = 21, CDATASectionNode = 4, CharacterDataNode = 22,
  CommentNode = 8, DocumentFragmentNode = 11, DocumentNode = 9, DocumentTypeNode = 10,
  ElementNode = 1, EntityNode = 6, EntityReferenceNode = 5, NotationNode = 12,
  ProcessingInstructionNode = 7, TextNode = 3
}
  More...
 
- Static Public Member Functions inherited from QtXml.QDomNode
static bool operator!= (QDomNode arg1, QDomNode arg2)
 
 
static bool operator== (QDomNode arg1, QDomNode arg2)
 
 
- Protected Attributes inherited from QtXml.QDomNode
SmokeInvocation interceptor
 
- Properties inherited from QtXml.QDomNode
new string NodeValue [get, set]
 
 
new string Prefix [get, set]
 
 
virtual System.IntPtr SmokeObject [get, set]
 

Detailed Description

The QDomDocument class represents an XML document.

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.

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 ownerDocument() function which associates them with the document within whose context they were created. The DOM classes that will be used most often are QDomNode, QDomDocument, QDomElement and QDomText.

The parsed XML is represented internally by a tree of objects that can be accessed using the various QDom classes. All QDom classes only reference 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.

Creation of elements, text nodes, etc. is done using 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.

The QDomDocument class has several functions for creating document data, for example, createElement(), createTextNode(), createComment(), createCDATASection(), createProcessingInstruction(), createAttribute() and createEntityReference(). Some of these functions have versions that support namespaces, i.e. createElementNS() and createAttributeNS(). The createDocumentFragment() function is used to hold parts of the document; this is useful for manipulating for complex documents.

The entire content of the document is set with setContent(). 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 documentElement(). The textual representation of the document can be obtained using toString().

Note: The DOM tree might end up reserving a lot of memory if the XML document is big. For big XML documents, the QXmlStreamReader or the QXmlQuery classes might be better solutions.

It is possible to insert a node from another document into the document using importNode().

You can obtain a list of all the elements that have a particular tag with elementsByTagName() or with elementsByTagNameNS().

The QDom classes are typically used as follows:

QDomDocument doc("mydocument");

QFile file("mydocument.xml");

if (!file.open(QIODevice::ReadOnly))

return;

if (!doc.setContent(&file)) {

file.close();

return;

}

file.close();

// print out the element names of all elements that are direct children

// of the outermost element.

QDomElement docElem = doc.documentElement();

QDomNode n = docElem.firstChild();

while(!n.isNull()) {

QDomElement e = n.toElement(); // try to convert the node to an element.

if(!e.isNull()) {

cout << qPrintable(e.tagName()) << endl; // the node really is an element.

}

n = n.nextSibling();

}

// Here we append a new element to the end of the document

QDomElement elem = doc.createElement("img");

elem.setAttribute("src", "myimage.png");

docElem.appendChild(elem);

Once doc and elem go out of scope, the whole internal tree representing the XML document is deleted.

To create a document using DOM use code like this:

QDomDocument doc("MyML");

QDomElement root = doc.createElement("MyML");

doc.appendChild(root);

QDomElement tag = doc.createElement("Greeting");

root.appendChild(tag);

QDomText t = doc.createTextNode("Hello World");

tag.appendChild(t);

QString xml = doc.toString();

For further information about the Document Object Model see the Document Object Model (DOM) Level 1 and Level 2 Core Specifications.

See also DOM Bookmarks Example and Simple DOM Model Example.

Constructor & Destructor Documentation

QtXml.QDomDocument.QDomDocument ( System.Type  dummy)
protected
QtXml.QDomDocument.QDomDocument ( )

Constructs an empty document.

QtXml.QDomDocument.QDomDocument ( QDomDocumentType  doctype)

Creates a document with the document type doctype.

See also QDomImplementation::createDocumentType().

QtXml.QDomDocument.QDomDocument ( QDomDocument  x)

Constructs a copy of x.

The data of the copy is shared (shallow copy): modifying one node will also change the other. If you want to make a deep copy, use cloneNode().

QtXml.QDomDocument.QDomDocument ( string  name)

Creates a document and sets the name of the document type to name.

Member Function Documentation

new QDomAttr QtXml.QDomDocument.CreateAttribute ( string  name)

Creates a new attribute called name that can be inserted into an element, e.g. using QDomElement::setAttributeNode().

If name is not a valid XML name, the behavior of this function is governed by QDomImplementation::InvalidDataPolicy.

See also createAttributeNS().

new QDomAttr QtXml.QDomDocument.CreateAttributeNS ( string  nsURI,
string  qName 
)

Creates a new attribute with namespace support that can be inserted into an element. The name of the attribute is qName and the namespace URI is nsURI. This function also sets QDomNode::prefix() and QDomNode::localName() to appropriate values (depending on qName).

If qName is not a valid XML name, the behavior of this function is governed by QDomImplementation::InvalidDataPolicy.

See also createAttribute().

new QDomCDATASection QtXml.QDomDocument.CreateCDATASection ( string  data)

Creates a new CDATA section for the string value that can be inserted into the document, e.g. using QDomNode::appendChild().

If value contains characters which cannot be stored in a CDATA section, the behavior of this function is governed by QDomImplementation::InvalidDataPolicy.

See also QDomNode::appendChild(), QDomNode::insertBefore(), and QDomNode::insertAfter().

new QDomComment QtXml.QDomDocument.CreateComment ( string  data)

Creates a new comment for the string value that can be inserted into the document, e.g. using QDomNode::appendChild().

If value contains characters which cannot be stored in an XML comment, the behavior of this function is governed by QDomImplementation::InvalidDataPolicy.

See also QDomNode::appendChild(), QDomNode::insertBefore(), and QDomNode::insertAfter().

new QDomDocumentFragment QtXml.QDomDocument.CreateDocumentFragment ( )

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.

new QDomElement QtXml.QDomDocument.CreateElement ( string  tagName)

Creates a new element called tagName that can be inserted into the DOM tree, e.g. using QDomNode::appendChild().

If tagName is not a valid XML name, the behavior of this function is governed by QDomImplementation::InvalidDataPolicy.

QDomNode::insertAfter()

See also createElementNS(), QDomNode::appendChild(), and QDomNode::insertBefore().

new QDomElement QtXml.QDomDocument.CreateElementNS ( string  nsURI,
string  qName 
)

Creates a new element with namespace support that can be inserted into the DOM tree. The name of the element is qName and the namespace URI is nsURI. This function also sets QDomNode::prefix() and QDomNode::localName() to appropriate values (depending on qName).

If qName is an empty string, returns a null element regardless of whether the invalid data policy is set.

See also createElement().

new QDomEntityReference QtXml.QDomDocument.CreateEntityReference ( string  name)

Creates a new entity reference called name that can be inserted into the document, e.g. using QDomNode::appendChild().

If name is not a valid XML name, the behavior of this function is governed by QDomImplementation::InvalidDataPolicy.

See also QDomNode::appendChild(), QDomNode::insertBefore(), and QDomNode::insertAfter().

new QDomProcessingInstruction QtXml.QDomDocument.CreateProcessingInstruction ( string  target,
string  data 
)

Creates a new processing instruction that can be inserted into the document, e.g. using QDomNode::appendChild(). This function sets the target for the processing instruction to target and the data to data.

If target is not a valid XML name, or data if contains characters which cannot appear in a processing instruction, the behavior of this function is governed by QDomImplementation::InvalidDataPolicy.

See also QDomNode::appendChild(), QDomNode::insertBefore(), and QDomNode::insertAfter().

override void QtXml.QDomDocument.CreateProxy ( )
virtual

Reimplemented from QtXml.QDomNode.

new QDomText QtXml.QDomDocument.CreateTextNode ( string  data)

Creates a text node for the string value that can be inserted into the document tree, e.g. using QDomNode::appendChild().

If value contains characters which cannot be stored as character data of an XML document (even in the form of character references), the behavior of this function is governed by QDomImplementation::InvalidDataPolicy.

See also QDomNode::appendChild(), QDomNode::insertBefore(), and QDomNode::insertAfter().

new void QtXml.QDomDocument.Dispose ( )
new QDomDocumentType QtXml.QDomDocument.Doctype ( )

Returns the document type of this document.

new QDomElement QtXml.QDomDocument.DocumentElement ( )

Returns the root element of the document.

new QDomElement QtXml.QDomDocument.ElementById ( string  elementId)

Returns the element whose ID is equal to elementId. If no element with the ID was found, this function returns a null element.

Since the QDomClasses do not know which attributes are element IDs, this function returns always a null element. This may change in a future version.

new QDomNodeList QtXml.QDomDocument.ElementsByTagName ( string  tagname)

Returns a QDomNodeList, that contains all the elements in the document with the name tagname. The order of the node list is the order they are encountered in a preorder traversal of the element tree.

See also elementsByTagNameNS() and QDomElement::elementsByTagName().

new QDomNodeList QtXml.QDomDocument.ElementsByTagNameNS ( string  nsURI,
string  localName 
)

Returns a QDomNodeList that contains all the elements in the document with the local name localName and a namespace URI of nsURI. The order of the node list is the order they are encountered in a preorder traversal of the element tree.

See also elementsByTagName() and QDomElement::elementsByTagNameNS().

new QDomImplementation QtXml.QDomDocument.Implementation ( )

Returns a QDomImplementation object.

new QDomNode QtXml.QDomDocument.ImportNode ( QDomNode  importedNode,
bool  deep 
)

Imports the node importedNode from another document to this document. importedNode remains in the original document; this function creates a copy that can be used within this document.

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 QDomDocumentType nodes. In those cases this function returns a null node.

If deep is true, this function imports not only the node importedNode but its whole subtree; if it is false, only the importedNode is imported. The argument deep has no effect on QDomAttr and QDomEntityReference nodes, since the descendants of QDomAttr nodes are always imported and those of QDomEntityReference nodes are never imported.

The behavior of this function is slightly different depending on the node types:

Node TypeBehavior

QDomAttr The owner element is set to 0 and the specified flag is set to true in the generated attribute. The whole subtree of importedNode is always imported for attribute nodes: deep has no effect.

QDomDocument Document nodes cannot be imported.

QDomDocumentFragment If deep is true, this function imports the whole document fragment; otherwise it only generates an empty document fragment.

QDomDocumentType Document type nodes cannot be imported.

QDomElement Attributes for which QDomAttr::specified() is true are also imported, other attributes are not imported. If deep is true, this function also imports the subtree of importedNode; otherwise it imports only the element node (and some attributes, see above).

QDomEntity Entity nodes can be imported, but at the moment there is no way to use them since the document type is read-only in DOM level 2.

QDomEntityReference Descendants of entity reference nodes are never imported: deep has no effect.

QDomNotation Notation nodes can be imported, but at the moment there is no way to use them since the document type is read-only in DOM level 2.

QDomProcessingInstruction The target and value of the processing instruction is copied to the new node.

QDomText The text is copied to the new node.

QDomCDATASection The text is copied to the new node.

QDomComment The text is copied to the new node.

QDomNode::insertAfter() QDomNode::replaceChild() QDomNode::removeChild() QDomNode::appendChild()

See also QDomElement::setAttribute() and QDomNode::insertBefore().

new QDomNode.NodeType QtXml.QDomDocument.nodeType ( )

Returns DocumentNode.

new bool QtXml.QDomDocument.SetContent ( QXmlInputSource  source,
QXmlReader  reader,
System.Text.StringBuilder  errorMsg = null 
)

This function parses the XML document from the byte array data and sets it as the content of the document. It tries to detect the encoding of the document as required by the XML specification.

If namespaceProcessing is true, the parser recognizes namespaces in the XML file and sets the prefix name, local name and namespace URI to appropriate values. If namespaceProcessing is false, the parser does no namespace processing when it reads the XML file.

If a parse error occurs, this function returns false and the error message is placed in *errorMsg, the line number in *errorLine and the column number in *errorColumn (unless the associated pointer is set to 0); otherwise this function returns true. The various error messages are described in the QXmlParseException class documentation. Note that, if you want to display these error messages to your application's users, they will be displayed in English unless they are explicitly translated.

If namespaceProcessing is true, the function QDomNode::prefix() returns a string for all elements and attributes. It returns an empty string if the element or attribute has no prefix.

Text nodes consisting only of whitespace are stripped and won't appear in the QDomDocument. If this behavior is not desired, one can use the setContent() overload that allows a QXmlReader to be supplied.

If namespaceProcessing is false, the functions QDomNode::prefix(), QDomNode::localName() and QDomNode::namespaceURI() return an empty string.

Entity references are handled as follows:

References to internal general entities and character entities occurring in the content are included. The result is a QDomText node with the references replaced by their corresponding entity values.

References to parameter entities occurring in the internal subset are included. The result is a QDomDocumentType node which contains entity and notation declarations with the references replaced by their corresponding entity values.

Any general parsed entity reference which is not defined in the internal subset and which occurs in the content is represented as a QDomEntityReference node.

Any parsed entity reference which is not defined in the internal subset and which occurs outside of the content is replaced with an empty string.

Any unparsed entity reference is replaced with an empty string.

QDomNode::prefix() QString::isNull() QString::isEmpty()

Warning: This function is not reentrant.

See also QDomNode::namespaceURI() and QDomNode::localName().

new bool QtXml.QDomDocument.SetContent ( QXmlInputSource  source,
QXmlReader  reader,
System.Text.StringBuilder  errorMsg,
ref int  errorLine 
)

This function parses the XML document from the byte array data and sets it as the content of the document. It tries to detect the encoding of the document as required by the XML specification.

If namespaceProcessing is true, the parser recognizes namespaces in the XML file and sets the prefix name, local name and namespace URI to appropriate values. If namespaceProcessing is false, the parser does no namespace processing when it reads the XML file.

If a parse error occurs, this function returns false and the error message is placed in *errorMsg, the line number in *errorLine and the column number in *errorColumn (unless the associated pointer is set to 0); otherwise this function returns true. The various error messages are described in the QXmlParseException class documentation. Note that, if you want to display these error messages to your application's users, they will be displayed in English unless they are explicitly translated.

If namespaceProcessing is true, the function QDomNode::prefix() returns a string for all elements and attributes. It returns an empty string if the element or attribute has no prefix.

Text nodes consisting only of whitespace are stripped and won't appear in the QDomDocument. If this behavior is not desired, one can use the setContent() overload that allows a QXmlReader to be supplied.

If namespaceProcessing is false, the functions QDomNode::prefix(), QDomNode::localName() and QDomNode::namespaceURI() return an empty string.

Entity references are handled as follows:

References to internal general entities and character entities occurring in the content are included. The result is a QDomText node with the references replaced by their corresponding entity values.

References to parameter entities occurring in the internal subset are included. The result is a QDomDocumentType node which contains entity and notation declarations with the references replaced by their corresponding entity values.

Any general parsed entity reference which is not defined in the internal subset and which occurs in the content is represented as a QDomEntityReference node.

Any parsed entity reference which is not defined in the internal subset and which occurs outside of the content is replaced with an empty string.

Any unparsed entity reference is replaced with an empty string.

QDomNode::prefix() QString::isNull() QString::isEmpty()

Warning: This function is not reentrant.

See also QDomNode::namespaceURI() and QDomNode::localName().

new bool QtXml.QDomDocument.SetContent ( QXmlInputSource  source,
QXmlReader  reader,
System.Text.StringBuilder  errorMsg,
ref int  errorLine,
ref int  errorColumn 
)

This is an overloaded function.

This function reads the XML document from the QXmlInputSource source and parses it with the QXmlReader reader, returning true if the content was successfully parsed; otherwise returns false.

This function doesn't change the features of the reader. If you want to use certain features for parsing you can use this function to set up the reader appropriately.

See also QXmlSimpleReader.

new bool QtXml.QDomDocument.SetContent ( QByteArray  text,
System.Text.StringBuilder  errorMsg = null 
)

This function parses the XML document from the byte array data and sets it as the content of the document. It tries to detect the encoding of the document as required by the XML specification.

If namespaceProcessing is true, the parser recognizes namespaces in the XML file and sets the prefix name, local name and namespace URI to appropriate values. If namespaceProcessing is false, the parser does no namespace processing when it reads the XML file.

If a parse error occurs, this function returns false and the error message is placed in *errorMsg, the line number in *errorLine and the column number in *errorColumn (unless the associated pointer is set to 0); otherwise this function returns true. The various error messages are described in the QXmlParseException class documentation. Note that, if you want to display these error messages to your application's users, they will be displayed in English unless they are explicitly translated.

If namespaceProcessing is true, the function QDomNode::prefix() returns a string for all elements and attributes. It returns an empty string if the element or attribute has no prefix.

Text nodes consisting only of whitespace are stripped and won't appear in the QDomDocument. If this behavior is not desired, one can use the setContent() overload that allows a QXmlReader to be supplied.

If namespaceProcessing is false, the functions QDomNode::prefix(), QDomNode::localName() and QDomNode::namespaceURI() return an empty string.

Entity references are handled as follows:

References to internal general entities and character entities occurring in the content are included. The result is a QDomText node with the references replaced by their corresponding entity values.

References to parameter entities occurring in the internal subset are included. The result is a QDomDocumentType node which contains entity and notation declarations with the references replaced by their corresponding entity values.

Any general parsed entity reference which is not defined in the internal subset and which occurs in the content is represented as a QDomEntityReference node.

Any parsed entity reference which is not defined in the internal subset and which occurs outside of the content is replaced with an empty string.

Any unparsed entity reference is replaced with an empty string.

QDomNode::prefix() QString::isNull() QString::isEmpty()

Warning: This function is not reentrant.

See also QDomNode::namespaceURI() and QDomNode::localName().

new bool QtXml.QDomDocument.SetContent ( QIODevice  dev,
System.Text.StringBuilder  errorMsg = null 
)

This function parses the XML document from the byte array data and sets it as the content of the document. It tries to detect the encoding of the document as required by the XML specification.

If namespaceProcessing is true, the parser recognizes namespaces in the XML file and sets the prefix name, local name and namespace URI to appropriate values. If namespaceProcessing is false, the parser does no namespace processing when it reads the XML file.

If a parse error occurs, this function returns false and the error message is placed in *errorMsg, the line number in *errorLine and the column number in *errorColumn (unless the associated pointer is set to 0); otherwise this function returns true. The various error messages are described in the QXmlParseException class documentation. Note that, if you want to display these error messages to your application's users, they will be displayed in English unless they are explicitly translated.

If namespaceProcessing is true, the function QDomNode::prefix() returns a string for all elements and attributes. It returns an empty string if the element or attribute has no prefix.

Text nodes consisting only of whitespace are stripped and won't appear in the QDomDocument. If this behavior is not desired, one can use the setContent() overload that allows a QXmlReader to be supplied.

If namespaceProcessing is false, the functions QDomNode::prefix(), QDomNode::localName() and QDomNode::namespaceURI() return an empty string.

Entity references are handled as follows:

References to internal general entities and character entities occurring in the content are included. The result is a QDomText node with the references replaced by their corresponding entity values.

References to parameter entities occurring in the internal subset are included. The result is a QDomDocumentType node which contains entity and notation declarations with the references replaced by their corresponding entity values.

Any general parsed entity reference which is not defined in the internal subset and which occurs in the content is represented as a QDomEntityReference node.

Any parsed entity reference which is not defined in the internal subset and which occurs outside of the content is replaced with an empty string.

Any unparsed entity reference is replaced with an empty string.

QDomNode::prefix() QString::isNull() QString::isEmpty()

Warning: This function is not reentrant.

See also QDomNode::namespaceURI() and QDomNode::localName().

new bool QtXml.QDomDocument.SetContent ( QByteArray  text,
bool  namespaceProcessing,
System.Text.StringBuilder  errorMsg = null 
)

This function parses the XML document from the byte array data and sets it as the content of the document. It tries to detect the encoding of the document as required by the XML specification.

If namespaceProcessing is true, the parser recognizes namespaces in the XML file and sets the prefix name, local name and namespace URI to appropriate values. If namespaceProcessing is false, the parser does no namespace processing when it reads the XML file.

If a parse error occurs, this function returns false and the error message is placed in *errorMsg, the line number in *errorLine and the column number in *errorColumn (unless the associated pointer is set to 0); otherwise this function returns true. The various error messages are described in the QXmlParseException class documentation. Note that, if you want to display these error messages to your application's users, they will be displayed in English unless they are explicitly translated.

If namespaceProcessing is true, the function QDomNode::prefix() returns a string for all elements and attributes. It returns an empty string if the element or attribute has no prefix.

Text nodes consisting only of whitespace are stripped and won't appear in the QDomDocument. If this behavior is not desired, one can use the setContent() overload that allows a QXmlReader to be supplied.

If namespaceProcessing is false, the functions QDomNode::prefix(), QDomNode::localName() and QDomNode::namespaceURI() return an empty string.

Entity references are handled as follows:

References to internal general entities and character entities occurring in the content are included. The result is a QDomText node with the references replaced by their corresponding entity values.

References to parameter entities occurring in the internal subset are included. The result is a QDomDocumentType node which contains entity and notation declarations with the references replaced by their corresponding entity values.

Any general parsed entity reference which is not defined in the internal subset and which occurs in the content is represented as a QDomEntityReference node.

Any parsed entity reference which is not defined in the internal subset and which occurs outside of the content is replaced with an empty string.

Any unparsed entity reference is replaced with an empty string.

QDomNode::prefix() QString::isNull() QString::isEmpty()

Warning: This function is not reentrant.

See also QDomNode::namespaceURI() and QDomNode::localName().

new bool QtXml.QDomDocument.SetContent ( QIODevice  dev,
bool  namespaceProcessing,
System.Text.StringBuilder  errorMsg = null 
)

This function parses the XML document from the byte array data and sets it as the content of the document. It tries to detect the encoding of the document as required by the XML specification.

If namespaceProcessing is true, the parser recognizes namespaces in the XML file and sets the prefix name, local name and namespace URI to appropriate values. If namespaceProcessing is false, the parser does no namespace processing when it reads the XML file.

If a parse error occurs, this function returns false and the error message is placed in *errorMsg, the line number in *errorLine and the column number in *errorColumn (unless the associated pointer is set to 0); otherwise this function returns true. The various error messages are described in the QXmlParseException class documentation. Note that, if you want to display these error messages to your application's users, they will be displayed in English unless they are explicitly translated.

If namespaceProcessing is true, the function QDomNode::prefix() returns a string for all elements and attributes. It returns an empty string if the element or attribute has no prefix.

Text nodes consisting only of whitespace are stripped and won't appear in the QDomDocument. If this behavior is not desired, one can use the setContent() overload that allows a QXmlReader to be supplied.

If namespaceProcessing is false, the functions QDomNode::prefix(), QDomNode::localName() and QDomNode::namespaceURI() return an empty string.

Entity references are handled as follows:

References to internal general entities and character entities occurring in the content are included. The result is a QDomText node with the references replaced by their corresponding entity values.

References to parameter entities occurring in the internal subset are included. The result is a QDomDocumentType node which contains entity and notation declarations with the references replaced by their corresponding entity values.

Any general parsed entity reference which is not defined in the internal subset and which occurs in the content is represented as a QDomEntityReference node.

Any parsed entity reference which is not defined in the internal subset and which occurs outside of the content is replaced with an empty string.

Any unparsed entity reference is replaced with an empty string.

QDomNode::prefix() QString::isNull() QString::isEmpty()

Warning: This function is not reentrant.

See also QDomNode::namespaceURI() and QDomNode::localName().

new bool QtXml.QDomDocument.SetContent ( QXmlInputSource  source,
bool  namespaceProcessing,
System.Text.StringBuilder  errorMsg = null 
)

This function parses the XML document from the byte array data and sets it as the content of the document. It tries to detect the encoding of the document as required by the XML specification.

If namespaceProcessing is true, the parser recognizes namespaces in the XML file and sets the prefix name, local name and namespace URI to appropriate values. If namespaceProcessing is false, the parser does no namespace processing when it reads the XML file.

If a parse error occurs, this function returns false and the error message is placed in *errorMsg, the line number in *errorLine and the column number in *errorColumn (unless the associated pointer is set to 0); otherwise this function returns true. The various error messages are described in the QXmlParseException class documentation. Note that, if you want to display these error messages to your application's users, they will be displayed in English unless they are explicitly translated.

If namespaceProcessing is true, the function QDomNode::prefix() returns a string for all elements and attributes. It returns an empty string if the element or attribute has no prefix.

Text nodes consisting only of whitespace are stripped and won't appear in the QDomDocument. If this behavior is not desired, one can use the setContent() overload that allows a QXmlReader to be supplied.

If namespaceProcessing is false, the functions QDomNode::prefix(), QDomNode::localName() and QDomNode::namespaceURI() return an empty string.

Entity references are handled as follows:

References to internal general entities and character entities occurring in the content are included. The result is a QDomText node with the references replaced by their corresponding entity values.

References to parameter entities occurring in the internal subset are included. The result is a QDomDocumentType node which contains entity and notation declarations with the references replaced by their corresponding entity values.

Any general parsed entity reference which is not defined in the internal subset and which occurs in the content is represented as a QDomEntityReference node.

Any parsed entity reference which is not defined in the internal subset and which occurs outside of the content is replaced with an empty string.

Any unparsed entity reference is replaced with an empty string.

QDomNode::prefix() QString::isNull() QString::isEmpty()

Warning: This function is not reentrant.

See also QDomNode::namespaceURI() and QDomNode::localName().

new bool QtXml.QDomDocument.SetContent ( QByteArray  text,
System.Text.StringBuilder  errorMsg,
ref int  errorLine 
)

This function parses the XML document from the byte array data and sets it as the content of the document. It tries to detect the encoding of the document as required by the XML specification.

If namespaceProcessing is true, the parser recognizes namespaces in the XML file and sets the prefix name, local name and namespace URI to appropriate values. If namespaceProcessing is false, the parser does no namespace processing when it reads the XML file.

If a parse error occurs, this function returns false and the error message is placed in *errorMsg, the line number in *errorLine and the column number in *errorColumn (unless the associated pointer is set to 0); otherwise this function returns true. The various error messages are described in the QXmlParseException class documentation. Note that, if you want to display these error messages to your application's users, they will be displayed in English unless they are explicitly translated.

If namespaceProcessing is true, the function QDomNode::prefix() returns a string for all elements and attributes. It returns an empty string if the element or attribute has no prefix.

Text nodes consisting only of whitespace are stripped and won't appear in the QDomDocument. If this behavior is not desired, one can use the setContent() overload that allows a QXmlReader to be supplied.

If namespaceProcessing is false, the functions QDomNode::prefix(), QDomNode::localName() and QDomNode::namespaceURI() return an empty string.

Entity references are handled as follows:

References to internal general entities and character entities occurring in the content are included. The result is a QDomText node with the references replaced by their corresponding entity values.

References to parameter entities occurring in the internal subset are included. The result is a QDomDocumentType node which contains entity and notation declarations with the references replaced by their corresponding entity values.

Any general parsed entity reference which is not defined in the internal subset and which occurs in the content is represented as a QDomEntityReference node.

Any parsed entity reference which is not defined in the internal subset and which occurs outside of the content is replaced with an empty string.

Any unparsed entity reference is replaced with an empty string.

QDomNode::prefix() QString::isNull() QString::isEmpty()

Warning: This function is not reentrant.

See also QDomNode::namespaceURI() and QDomNode::localName().

new bool QtXml.QDomDocument.SetContent ( QIODevice  dev,
System.Text.StringBuilder  errorMsg,
ref int  errorLine 
)

This function parses the XML document from the byte array data and sets it as the content of the document. It tries to detect the encoding of the document as required by the XML specification.

If namespaceProcessing is true, the parser recognizes namespaces in the XML file and sets the prefix name, local name and namespace URI to appropriate values. If namespaceProcessing is false, the parser does no namespace processing when it reads the XML file.

If a parse error occurs, this function returns false and the error message is placed in *errorMsg, the line number in *errorLine and the column number in *errorColumn (unless the associated pointer is set to 0); otherwise this function returns true. The various error messages are described in the QXmlParseException class documentation. Note that, if you want to display these error messages to your application's users, they will be displayed in English unless they are explicitly translated.

If namespaceProcessing is true, the function QDomNode::prefix() returns a string for all elements and attributes. It returns an empty string if the element or attribute has no prefix.

Text nodes consisting only of whitespace are stripped and won't appear in the QDomDocument. If this behavior is not desired, one can use the setContent() overload that allows a QXmlReader to be supplied.

If namespaceProcessing is false, the functions QDomNode::prefix(), QDomNode::localName() and QDomNode::namespaceURI() return an empty string.

Entity references are handled as follows:

References to internal general entities and character entities occurring in the content are included. The result is a QDomText node with the references replaced by their corresponding entity values.

References to parameter entities occurring in the internal subset are included. The result is a QDomDocumentType node which contains entity and notation declarations with the references replaced by their corresponding entity values.

Any general parsed entity reference which is not defined in the internal subset and which occurs in the content is represented as a QDomEntityReference node.

Any parsed entity reference which is not defined in the internal subset and which occurs outside of the content is replaced with an empty string.

Any unparsed entity reference is replaced with an empty string.

QDomNode::prefix() QString::isNull() QString::isEmpty()

Warning: This function is not reentrant.

See also QDomNode::namespaceURI() and QDomNode::localName().

new bool QtXml.QDomDocument.SetContent ( QByteArray  text,
System.Text.StringBuilder  errorMsg,
ref int  errorLine,
ref int  errorColumn 
)

This is an overloaded function.

This function reads the XML document from the byte array buffer, returning true if the content was successfully parsed; otherwise returns false.

No namespace processing is performed.

new bool QtXml.QDomDocument.SetContent ( QIODevice  dev,
System.Text.StringBuilder  errorMsg,
ref int  errorLine,
ref int  errorColumn 
)

This is an overloaded function.

This function reads the XML document from the IO device dev, returning true if the content was successfully parsed; otherwise returns false.

No namespace processing is performed.

new bool QtXml.QDomDocument.SetContent ( QByteArray  text,
bool  namespaceProcessing,
System.Text.StringBuilder  errorMsg,
ref int  errorLine 
)

This function parses the XML document from the byte array data and sets it as the content of the document. It tries to detect the encoding of the document as required by the XML specification.

If namespaceProcessing is true, the parser recognizes namespaces in the XML file and sets the prefix name, local name and namespace URI to appropriate values. If namespaceProcessing is false, the parser does no namespace processing when it reads the XML file.

If a parse error occurs, this function returns false and the error message is placed in *errorMsg, the line number in *errorLine and the column number in *errorColumn (unless the associated pointer is set to 0); otherwise this function returns true. The various error messages are described in the QXmlParseException class documentation. Note that, if you want to display these error messages to your application's users, they will be displayed in English unless they are explicitly translated.

If namespaceProcessing is true, the function QDomNode::prefix() returns a string for all elements and attributes. It returns an empty string if the element or attribute has no prefix.

Text nodes consisting only of whitespace are stripped and won't appear in the QDomDocument. If this behavior is not desired, one can use the setContent() overload that allows a QXmlReader to be supplied.

If namespaceProcessing is false, the functions QDomNode::prefix(), QDomNode::localName() and QDomNode::namespaceURI() return an empty string.

Entity references are handled as follows:

References to internal general entities and character entities occurring in the content are included. The result is a QDomText node with the references replaced by their corresponding entity values.

References to parameter entities occurring in the internal subset are included. The result is a QDomDocumentType node which contains entity and notation declarations with the references replaced by their corresponding entity values.

Any general parsed entity reference which is not defined in the internal subset and which occurs in the content is represented as a QDomEntityReference node.

Any parsed entity reference which is not defined in the internal subset and which occurs outside of the content is replaced with an empty string.

Any unparsed entity reference is replaced with an empty string.

QDomNode::prefix() QString::isNull() QString::isEmpty()

Warning: This function is not reentrant.

See also QDomNode::namespaceURI() and QDomNode::localName().

new bool QtXml.QDomDocument.SetContent ( QIODevice  dev,
bool  namespaceProcessing,
System.Text.StringBuilder  errorMsg,
ref int  errorLine 
)

This function parses the XML document from the byte array data and sets it as the content of the document. It tries to detect the encoding of the document as required by the XML specification.

If namespaceProcessing is true, the parser recognizes namespaces in the XML file and sets the prefix name, local name and namespace URI to appropriate values. If namespaceProcessing is false, the parser does no namespace processing when it reads the XML file.

If a parse error occurs, this function returns false and the error message is placed in *errorMsg, the line number in *errorLine and the column number in *errorColumn (unless the associated pointer is set to 0); otherwise this function returns true. The various error messages are described in the QXmlParseException class documentation. Note that, if you want to display these error messages to your application's users, they will be displayed in English unless they are explicitly translated.

If namespaceProcessing is true, the function QDomNode::prefix() returns a string for all elements and attributes. It returns an empty string if the element or attribute has no prefix.

Text nodes consisting only of whitespace are stripped and won't appear in the QDomDocument. If this behavior is not desired, one can use the setContent() overload that allows a QXmlReader to be supplied.

If namespaceProcessing is false, the functions QDomNode::prefix(), QDomNode::localName() and QDomNode::namespaceURI() return an empty string.

Entity references are handled as follows:

References to internal general entities and character entities occurring in the content are included. The result is a QDomText node with the references replaced by their corresponding entity values.

References to parameter entities occurring in the internal subset are included. The result is a QDomDocumentType node which contains entity and notation declarations with the references replaced by their corresponding entity values.

Any general parsed entity reference which is not defined in the internal subset and which occurs in the content is represented as a QDomEntityReference node.

Any parsed entity reference which is not defined in the internal subset and which occurs outside of the content is replaced with an empty string.

Any unparsed entity reference is replaced with an empty string.

QDomNode::prefix() QString::isNull() QString::isEmpty()

Warning: This function is not reentrant.

See also QDomNode::namespaceURI() and QDomNode::localName().

new bool QtXml.QDomDocument.SetContent ( QXmlInputSource  source,
bool  namespaceProcessing,
System.Text.StringBuilder  errorMsg,
ref int  errorLine 
)

This function parses the XML document from the byte array data and sets it as the content of the document. It tries to detect the encoding of the document as required by the XML specification.

If namespaceProcessing is true, the parser recognizes namespaces in the XML file and sets the prefix name, local name and namespace URI to appropriate values. If namespaceProcessing is false, the parser does no namespace processing when it reads the XML file.

If a parse error occurs, this function returns false and the error message is placed in *errorMsg, the line number in *errorLine and the column number in *errorColumn (unless the associated pointer is set to 0); otherwise this function returns true. The various error messages are described in the QXmlParseException class documentation. Note that, if you want to display these error messages to your application's users, they will be displayed in English unless they are explicitly translated.

If namespaceProcessing is true, the function QDomNode::prefix() returns a string for all elements and attributes. It returns an empty string if the element or attribute has no prefix.

Text nodes consisting only of whitespace are stripped and won't appear in the QDomDocument. If this behavior is not desired, one can use the setContent() overload that allows a QXmlReader to be supplied.

If namespaceProcessing is false, the functions QDomNode::prefix(), QDomNode::localName() and QDomNode::namespaceURI() return an empty string.

Entity references are handled as follows:

References to internal general entities and character entities occurring in the content are included. The result is a QDomText node with the references replaced by their corresponding entity values.

References to parameter entities occurring in the internal subset are included. The result is a QDomDocumentType node which contains entity and notation declarations with the references replaced by their corresponding entity values.

Any general parsed entity reference which is not defined in the internal subset and which occurs in the content is represented as a QDomEntityReference node.

Any parsed entity reference which is not defined in the internal subset and which occurs outside of the content is replaced with an empty string.

Any unparsed entity reference is replaced with an empty string.

QDomNode::prefix() QString::isNull() QString::isEmpty()

Warning: This function is not reentrant.

See also QDomNode::namespaceURI() and QDomNode::localName().

new bool QtXml.QDomDocument.SetContent ( QByteArray  text,
bool  namespaceProcessing,
System.Text.StringBuilder  errorMsg,
ref int  errorLine,
ref int  errorColumn 
)

This function parses the XML document from the byte array data and sets it as the content of the document. It tries to detect the encoding of the document as required by the XML specification.

If namespaceProcessing is true, the parser recognizes namespaces in the XML file and sets the prefix name, local name and namespace URI to appropriate values. If namespaceProcessing is false, the parser does no namespace processing when it reads the XML file.

If a parse error occurs, this function returns false and the error message is placed in *errorMsg, the line number in *errorLine and the column number in *errorColumn (unless the associated pointer is set to 0); otherwise this function returns true. The various error messages are described in the QXmlParseException class documentation. Note that, if you want to display these error messages to your application's users, they will be displayed in English unless they are explicitly translated.

If namespaceProcessing is true, the function QDomNode::prefix() returns a string for all elements and attributes. It returns an empty string if the element or attribute has no prefix.

Text nodes consisting only of whitespace are stripped and won't appear in the QDomDocument. If this behavior is not desired, one can use the setContent() overload that allows a QXmlReader to be supplied.

If namespaceProcessing is false, the functions QDomNode::prefix(), QDomNode::localName() and QDomNode::namespaceURI() return an empty string.

Entity references are handled as follows:

References to internal general entities and character entities occurring in the content are included. The result is a QDomText node with the references replaced by their corresponding entity values.

References to parameter entities occurring in the internal subset are included. The result is a QDomDocumentType node which contains entity and notation declarations with the references replaced by their corresponding entity values.

Any general parsed entity reference which is not defined in the internal subset and which occurs in the content is represented as a QDomEntityReference node.

Any parsed entity reference which is not defined in the internal subset and which occurs outside of the content is replaced with an empty string.

Any unparsed entity reference is replaced with an empty string.

QDomNode::prefix() QString::isNull() QString::isEmpty()

Warning: This function is not reentrant.

See also QDomNode::namespaceURI() and QDomNode::localName().

new bool QtXml.QDomDocument.SetContent ( QIODevice  dev,
bool  namespaceProcessing,
System.Text.StringBuilder  errorMsg,
ref int  errorLine,
ref int  errorColumn 
)

This is an overloaded function.

This function reads the XML document from the IO device dev, returning true if the content was successfully parsed; otherwise returns false.

new bool QtXml.QDomDocument.SetContent ( QXmlInputSource  source,
bool  namespaceProcessing,
System.Text.StringBuilder  errorMsg,
ref int  errorLine,
ref int  errorColumn 
)

This is an overloaded function.

This function reads the XML document from the QXmlInputSource source, returning true if the content was successfully parsed; otherwise returns false.

This function was introduced in Qt 4.5.

new bool QtXml.QDomDocument.SetContent ( string  text,
System.Text.StringBuilder  errorMsg = null 
)

This function parses the XML document from the byte array data and sets it as the content of the document. It tries to detect the encoding of the document as required by the XML specification.

If namespaceProcessing is true, the parser recognizes namespaces in the XML file and sets the prefix name, local name and namespace URI to appropriate values. If namespaceProcessing is false, the parser does no namespace processing when it reads the XML file.

If a parse error occurs, this function returns false and the error message is placed in *errorMsg, the line number in *errorLine and the column number in *errorColumn (unless the associated pointer is set to 0); otherwise this function returns true. The various error messages are described in the QXmlParseException class documentation. Note that, if you want to display these error messages to your application's users, they will be displayed in English unless they are explicitly translated.

If namespaceProcessing is true, the function QDomNode::prefix() returns a string for all elements and attributes. It returns an empty string if the element or attribute has no prefix.

Text nodes consisting only of whitespace are stripped and won't appear in the QDomDocument. If this behavior is not desired, one can use the setContent() overload that allows a QXmlReader to be supplied.

If namespaceProcessing is false, the functions QDomNode::prefix(), QDomNode::localName() and QDomNode::namespaceURI() return an empty string.

Entity references are handled as follows:

References to internal general entities and character entities occurring in the content are included. The result is a QDomText node with the references replaced by their corresponding entity values.

References to parameter entities occurring in the internal subset are included. The result is a QDomDocumentType node which contains entity and notation declarations with the references replaced by their corresponding entity values.

Any general parsed entity reference which is not defined in the internal subset and which occurs in the content is represented as a QDomEntityReference node.

Any parsed entity reference which is not defined in the internal subset and which occurs outside of the content is replaced with an empty string.

Any unparsed entity reference is replaced with an empty string.

QDomNode::prefix() QString::isNull() QString::isEmpty()

Warning: This function is not reentrant.

See also QDomNode::namespaceURI() and QDomNode::localName().

new bool QtXml.QDomDocument.SetContent ( string  text,
bool  namespaceProcessing,
System.Text.StringBuilder  errorMsg = null 
)

This function parses the XML document from the byte array data and sets it as the content of the document. It tries to detect the encoding of the document as required by the XML specification.

If namespaceProcessing is true, the parser recognizes namespaces in the XML file and sets the prefix name, local name and namespace URI to appropriate values. If namespaceProcessing is false, the parser does no namespace processing when it reads the XML file.

If a parse error occurs, this function returns false and the error message is placed in *errorMsg, the line number in *errorLine and the column number in *errorColumn (unless the associated pointer is set to 0); otherwise this function returns true. The various error messages are described in the QXmlParseException class documentation. Note that, if you want to display these error messages to your application's users, they will be displayed in English unless they are explicitly translated.

If namespaceProcessing is true, the function QDomNode::prefix() returns a string for all elements and attributes. It returns an empty string if the element or attribute has no prefix.

Text nodes consisting only of whitespace are stripped and won't appear in the QDomDocument. If this behavior is not desired, one can use the setContent() overload that allows a QXmlReader to be supplied.

If namespaceProcessing is false, the functions QDomNode::prefix(), QDomNode::localName() and QDomNode::namespaceURI() return an empty string.

Entity references are handled as follows:

References to internal general entities and character entities occurring in the content are included. The result is a QDomText node with the references replaced by their corresponding entity values.

References to parameter entities occurring in the internal subset are included. The result is a QDomDocumentType node which contains entity and notation declarations with the references replaced by their corresponding entity values.

Any general parsed entity reference which is not defined in the internal subset and which occurs in the content is represented as a QDomEntityReference node.

Any parsed entity reference which is not defined in the internal subset and which occurs outside of the content is replaced with an empty string.

Any unparsed entity reference is replaced with an empty string.

QDomNode::prefix() QString::isNull() QString::isEmpty()

Warning: This function is not reentrant.

See also QDomNode::namespaceURI() and QDomNode::localName().

new bool QtXml.QDomDocument.SetContent ( string  text,
System.Text.StringBuilder  errorMsg,
ref int  errorLine 
)

This function parses the XML document from the byte array data and sets it as the content of the document. It tries to detect the encoding of the document as required by the XML specification.

If namespaceProcessing is true, the parser recognizes namespaces in the XML file and sets the prefix name, local name and namespace URI to appropriate values. If namespaceProcessing is false, the parser does no namespace processing when it reads the XML file.

If a parse error occurs, this function returns false and the error message is placed in *errorMsg, the line number in *errorLine and the column number in *errorColumn (unless the associated pointer is set to 0); otherwise this function returns true. The various error messages are described in the QXmlParseException class documentation. Note that, if you want to display these error messages to your application's users, they will be displayed in English unless they are explicitly translated.

If namespaceProcessing is true, the function QDomNode::prefix() returns a string for all elements and attributes. It returns an empty string if the element or attribute has no prefix.

Text nodes consisting only of whitespace are stripped and won't appear in the QDomDocument. If this behavior is not desired, one can use the setContent() overload that allows a QXmlReader to be supplied.

If namespaceProcessing is false, the functions QDomNode::prefix(), QDomNode::localName() and QDomNode::namespaceURI() return an empty string.

Entity references are handled as follows:

References to internal general entities and character entities occurring in the content are included. The result is a QDomText node with the references replaced by their corresponding entity values.

References to parameter entities occurring in the internal subset are included. The result is a QDomDocumentType node which contains entity and notation declarations with the references replaced by their corresponding entity values.

Any general parsed entity reference which is not defined in the internal subset and which occurs in the content is represented as a QDomEntityReference node.

Any parsed entity reference which is not defined in the internal subset and which occurs outside of the content is replaced with an empty string.

Any unparsed entity reference is replaced with an empty string.

QDomNode::prefix() QString::isNull() QString::isEmpty()

Warning: This function is not reentrant.

See also QDomNode::namespaceURI() and QDomNode::localName().

new bool QtXml.QDomDocument.SetContent ( string  text,
System.Text.StringBuilder  errorMsg,
ref int  errorLine,
ref int  errorColumn 
)

This is an overloaded function.

This function reads the XML document from the string text, returning true if the content was successfully parsed; otherwise returns false. Since text is already a Unicode string, no encoding detection is performed.

No namespace processing is performed either.

new bool QtXml.QDomDocument.SetContent ( string  text,
bool  namespaceProcessing,
System.Text.StringBuilder  errorMsg,
ref int  errorLine 
)

This function parses the XML document from the byte array data and sets it as the content of the document. It tries to detect the encoding of the document as required by the XML specification.

If namespaceProcessing is true, the parser recognizes namespaces in the XML file and sets the prefix name, local name and namespace URI to appropriate values. If namespaceProcessing is false, the parser does no namespace processing when it reads the XML file.

If a parse error occurs, this function returns false and the error message is placed in *errorMsg, the line number in *errorLine and the column number in *errorColumn (unless the associated pointer is set to 0); otherwise this function returns true. The various error messages are described in the QXmlParseException class documentation. Note that, if you want to display these error messages to your application's users, they will be displayed in English unless they are explicitly translated.

If namespaceProcessing is true, the function QDomNode::prefix() returns a string for all elements and attributes. It returns an empty string if the element or attribute has no prefix.

Text nodes consisting only of whitespace are stripped and won't appear in the QDomDocument. If this behavior is not desired, one can use the setContent() overload that allows a QXmlReader to be supplied.

If namespaceProcessing is false, the functions QDomNode::prefix(), QDomNode::localName() and QDomNode::namespaceURI() return an empty string.

Entity references are handled as follows:

References to internal general entities and character entities occurring in the content are included. The result is a QDomText node with the references replaced by their corresponding entity values.

References to parameter entities occurring in the internal subset are included. The result is a QDomDocumentType node which contains entity and notation declarations with the references replaced by their corresponding entity values.

Any general parsed entity reference which is not defined in the internal subset and which occurs in the content is represented as a QDomEntityReference node.

Any parsed entity reference which is not defined in the internal subset and which occurs outside of the content is replaced with an empty string.

Any unparsed entity reference is replaced with an empty string.

QDomNode::prefix() QString::isNull() QString::isEmpty()

Warning: This function is not reentrant.

See also QDomNode::namespaceURI() and QDomNode::localName().

new bool QtXml.QDomDocument.SetContent ( string  text,
bool  namespaceProcessing,
System.Text.StringBuilder  errorMsg,
ref int  errorLine,
ref int  errorColumn 
)

This is an overloaded function.

This function reads the XML document from the string text, returning true if the content was successfully parsed; otherwise returns false. Since text is already a Unicode string, no encoding detection is done.

new QByteArray QtXml.QDomDocument.ToByteArray ( int  arg1 = 1)

Converts the parsed document back to its textual representation and returns a QByteArray containing the data encoded as UTF-8.

This function uses indent as the amount of space to indent subelements.

See also toString().

override string QtXml.QDomDocument.ToString ( )

Converts the parsed document back to its textual representation.

This function uses indent as the amount of space to indent subelements.

If indent is -1, no whitespace at all is added.

new string QtXml.QDomDocument.ToString ( int  arg1 = 1)

Converts the parsed document back to its textual representation.

This function uses indent as the amount of space to indent subelements.

If indent is -1, no whitespace at all is added.