42 #include <qplatformdefs.h> 44 #include "private/qxmlutils_p.h" 114 prefix = qName.
left(i);
115 name = qName.
mid(i + 1);
159 virtual void clear();
170 virtual bool isAttr()
const {
return false; }
177 virtual bool isText()
const {
return false; }
188 void setLocation(
int lineNumber,
int columnNumber);
248 bool contains(
const QString& name)
const;
249 bool containsNS(
const QString& nsURI,
const QString & localName)
const;
330 uint dataLength()
const;
331 QString substringData(
unsigned long offset,
unsigned long count)
const;
332 void appendData(
const QString& arg);
333 void insertData(
unsigned long offset,
const QString& arg);
334 void deleteData(
unsigned long offset,
unsigned long count);
335 void replaceData(
unsigned long offset,
unsigned long count,
const QString& arg);
353 virtual bool isText()
const {
return true; }
365 bool specified()
const;
368 void setNodeValue(
const QString& v);
370 virtual bool isAttr()
const {
return true; }
390 void removeAttribute(
const QString& name);
396 bool hasAttribute(
const QString& name);
397 bool hasAttributeNS(
const QString& nsURI,
const QString& localName);
513 bool setContent(
QXmlInputSource *source,
bool namespaceProcessing,
QString *errorMsg,
int *errorLine,
int *errorColumn);
593 bool characters(
const QString& ch);
603 bool startEntity(
const QString &);
604 bool endEntity(
const QString &);
606 bool comment(
const QString& ch);
631 virtual void dummy() {}
664 bool firstChar =
true;
665 for (
int i = 0; i < name.
size(); ++i) {
691 if (namespaces && !prefix.
isEmpty())
707 for (
int i = 0; i < data.
size(); ++i) {
1054 dt->
name = fixedName;
1196 tagname = localName;
1203 if (node_impl && !node_impl->ref.deref())
1229 if (tagname.isNull()) {
1234 }
else if (nsURI.isNull()) {
1235 while (p && p != node_impl) {
1245 while (p && p != node_impl && !p->
next)
1247 if (p && p != node_impl)
1252 while (p && p != node_impl) {
1262 while (p && p != node_impl && !p->
next)
1264 if (p && p != node_impl)
1280 if (index >= list.size())
1283 return list.at(index);
1297 return list.count();
1425 return impl->length();
1488 setOwnerDocument(doc);
1493 createdWithDom1Interface =
true;
1519 appendChild(x->cloneNode(
true));
1573 if (newChild == refChild)
1577 if (refChild && refChild->
parent() !=
this)
1589 if (newChild->
first == 0)
1600 if (!refChild || refChild->
prev == 0) {
1605 last = newChild->
last;
1606 first = newChild->
first;
1619 newChild->
first = 0;
1635 first->prev = newChild;
1636 newChild->
next = first;
1643 if (refChild->
prev == 0) {
1645 first->
prev = newChild;
1646 newChild->
next = first;
1653 newChild->
next = refChild;
1656 refChild->
prev = newChild;
1668 if (newChild == refChild)
1672 if (refChild && refChild->
parent() !=
this)
1684 if (newChild->
first == 0)
1695 if (!refChild || refChild->
next == 0) {
1700 first = newChild->
first;
1701 last = newChild->
last;
1713 newChild->
first = 0;
1731 last->next = newChild;
1732 newChild->
prev = last;
1739 if (refChild->
next == 0) {
1741 last->
next = newChild;
1742 newChild->
prev = last;
1749 newChild->
prev = refChild;
1752 refChild->
next = newChild;
1759 if (!newChild || !oldChild)
1761 if (oldChild->
parent() !=
this)
1763 if (newChild == oldChild)
1775 if (newChild->
first == 0)
1794 if (first == oldChild)
1795 first = newChild->
first;
1796 if (last == oldChild)
1797 last = newChild->
last;
1807 newChild->
first = 0;
1835 if (first == oldChild)
1837 if (last == oldChild)
1854 if (oldChild->
parent() !=
this)
1864 if (oldChild->
next == 0 && oldChild->
prev == 0 && first != oldChild)
1872 if (last == oldChild)
1873 last = oldChild->
prev;
1874 if (first == oldChild)
1875 first = oldChild->
next;
1890 return insertAfter(newChild, 0);
1949 n->
save(s, depth, indent);
1956 this->lineNumber = lineNumber;
1957 this->columnNumber = columnNumber;
1966 #define IMPL ((QDomNodePrivate*)impl) 2183 if (!
IMPL->prefix.isEmpty())
2222 IMPL->setNodeValue(v);
2260 return IMPL->nodeType();
2445 return IMPL->namespaceURI;
2473 return IMPL->prefix;
2491 if (!
impl ||
IMPL->prefix.isNull())
2493 if (isAttr() || isElement())
2511 if (!
impl ||
IMPL->createdWithDom1Interface)
2658 qWarning(
"Calling appendChild() on a null node does nothing.");
2672 return IMPL->first != 0;
2753 IMPL->save(str, 1, indent);
2784 return impl->isAttr();
2801 return impl->isCDATASection();
2818 return impl->isDocumentFragment();
2833 return impl->isDocument();
2850 return impl->isDocumentType();
2865 return impl->isElement();
2882 return impl->isEntityReference();
2897 return impl->isText();
2912 return impl->isEntity();
2927 return impl->isNotation();
2944 return impl->isProcessingInstruction();
2961 return impl->isCharacterData();
2976 return impl->isComment();
2992 for (
QDomNode child = firstChild(); !child.
isNull(); child = child.nextSibling()) {
2993 if (child.isElement()) {
3012 for (
QDomNode child = lastChild(); !child.
isNull(); child = child.previousSibling()) {
3013 if (child.isElement()) {
3032 for (
QDomNode sib = nextSibling(); !sib.
isNull(); sib = sib.nextSibling()) {
3033 if (sib.isElement()) {
3052 for (
QDomNode sib = previousSibling(); !sib.
isNull(); sib = sib.previousSibling()) {
3053 if (sib.isElement()) {
3076 return impl ?
impl->lineNumber : -1;
3093 return impl ?
impl->columnNumber : -1;
3108 appendToParent =
false;
3123 for (; it !=
map.constEnd(); ++
it) {
3137 if (!appendToParent) {
3139 for (; it !=
map.constEnd(); ++
it)
3140 if (!(*it)->ref.deref())
3156 for (; it !=
map.constEnd(); ++
it) {
3169 if (readonly || !arg)
3184 if (readonly || !arg)
3199 return setNamedItem(arg);
3212 return parent->removeChild(p);
3222 if ((
uint)index >= length())
3224 return *(
map.constBegin() +
index);
3235 return map.value(name) != 0;
3240 return namedItemNS(nsURI, localName) != 0;
3249 #define IMPL ((QDomNamedNodeMapPrivate*)impl) 3482 return IMPL->length();
3525 return IMPL->contains(name);
3624 if (oldChild && oldChild->
isEntity())
3661 return quote + data + quote;
3669 s <<
"<!DOCTYPE " <<
name;
3685 (*it2)->save(s, 0, indent);
3689 (*it)->save(s, 0, indent);
3697 /************************************************************** 3701 **************************************************************/ 3703 #define IMPL ((QDomDocumentTypePrivate*)impl) 3730 QDomDocumentType::QDomDocumentType() : QDomNode() 3741 QDomDocumentType::QDomDocumentType(const QDomDocumentType& n) 3746 QDomDocumentType::QDomDocumentType(QDomDocumentTypePrivate* n) 3758 QDomDocumentType& QDomDocumentType::operator= (const QDomDocumentType& n) 3760 return (QDomDocumentType&) QDomNode::operator=(n); 3769 QString QDomDocumentType::name() const 3773 return IMPL->nodeName(); 3779 QDomNamedNodeMap QDomDocumentType::entities() const 3782 return QDomNamedNodeMap(); 3783 return QDomNamedNodeMap(IMPL->entities); 3789 QDomNamedNodeMap QDomDocumentType::notations() const 3792 return QDomNamedNodeMap(); 3793 return QDomNamedNodeMap(IMPL->notations); 3802 QString QDomDocumentType::publicId() const 3806 return IMPL->publicId; 3815 QString QDomDocumentType::systemId() const 3819 return IMPL->systemId; 3828 QString QDomDocumentType::internalSubset() const 3832 return IMPL->internalSubset; 3836 Are these needed at all? The only difference when removing these 3837 two methods in all subclasses is that we'd get a different
type 4023 #define IMPL ((QDomCharacterDataPrivate*)impl) 4117 return IMPL->dataLength();
4128 return IMPL->substringData(offset, count);
4137 IMPL->appendData(arg);
4146 IMPL->insertData(offset, arg);
4155 IMPL->deleteData(offset, count);
4165 IMPL->replaceData(offset, count, arg);
4247 const bool encodeQuotes =
true,
4248 const bool performAVN =
false,
4249 const bool encodeEOLs =
false)
4251 #ifdef QT_NO_TEXTCODEC 4258 int len = retval.
length();
4262 const QChar ati(retval.
at(i));
4268 }
else if (encodeQuotes && (ati ==
QLatin1Char(
'"'))) {
4280 }
else if (performAVN &&
4281 (ati ==
QChar(0xA) ||
4282 ati ==
QChar(0xD) ||
4283 ati ==
QChar(0x9))) {
4285 retval.
replace(i, 1, replacement);
4286 i += replacement.
length();
4287 len += replacement.length() - 1;
4288 }
else if (encodeEOLs && ati ==
QChar(0xD)) {
4293 #ifndef QT_NO_TEXTCODEC 4300 const ushort codepoint(ati.unicode());
4302 retval.
replace(i, 1, replacement);
4303 i += replacement.
length();
4304 len += replacement.length() - 1;
4342 #define IMPL ((QDomAttrPrivate*)impl) 4437 return IMPL->specified();
4476 IMPL->m_specified =
true;
4592 if (p && p->
ref == 0)
4666 QString qName(name);
4687 s <<
'<' << qName << nsDecl;
4696 if (it.
value()->namespaceURI.isNull()) {
4711 if((!it.
value()->ownerNode ||
4712 it.
value()->ownerNode->prefix != it.
value()->prefix) &&
4714 s <<
" xmlns:" << it.
value()->prefix <<
"=\"" <<
encodeText(it.
value()->namespaceURI, s,
true,
true) <<
'\"';
4728 /* -1 disables new lines. */ 4732 QDomNodePrivate::save(s, depth + 1, indent); if (!last->isText()) 4733 s << QString(indent < 1 ? 0 : depth * indent, QLatin1Char(' ')); 4735 s << "</" << qName << '>
'; 4739 if (!(next && next->isText())) { 4740 /* -1 disables new lines. */ 4746 /************************************************************** 4750 **************************************************************/ 4752 #define IMPL ((QDomElementPrivate*)impl) 4808 QDomElement::QDomElement() 4820 QDomElement::QDomElement(const QDomElement& x) 4825 QDomElement::QDomElement(QDomElementPrivate* n) 4837 QDomElement& QDomElement::operator= (const QDomElement& x) 4839 return (QDomElement&) QDomNode::operator=(x); 4856 void QDomElement::setTagName(const QString& name) 4871 QString QDomElement::tagName() const 4875 return impl->nodeName(); 4884 QDomNamedNodeMap QDomElement::attributes() const 4887 return QDomNamedNodeMap(); 4888 return QDomNamedNodeMap(IMPL->attributes()); 4897 QString QDomElement::attribute(const QString& name, const QString& defValue) const 4901 return IMPL->attribute(name, defValue); 4911 void QDomElement::setAttribute(const QString& name, const QString& value) 4915 IMPL->setAttribute(name, value); 4946 void QDomElement::setAttribute(const QString& name, qlonglong value) 4952 IMPL->setAttribute(name, x); 4963 void QDomElement::setAttribute(const QString& name, qulonglong value) 4969 IMPL->setAttribute(name, x); 4980 void QDomElement::setAttribute(const QString& name, float value) 4986 IMPL->setAttribute(name, x); 4997 void QDomElement::setAttribute(const QString& name, double value) 5003 int count = qsnprintf(buf, sizeof(buf), "%.16g", value); 5005 x = QString::fromLatin1(buf, count); 5007 x.setNum(value); // Fallback 5008 IMPL->setAttribute(name, x); 5016 void QDomElement::removeAttribute(const QString& name) 5020 IMPL->removeAttribute(name); 5030 QDomAttr QDomElement::attributeNode(const QString& name) 5034 return QDomAttr(IMPL->attributeNode(name)); 5047 QDomAttr QDomElement::setAttributeNode(const QDomAttr& newAttr) 5051 return QDomAttr(IMPL->setAttributeNode(((QDomAttrPrivate*)newAttr.impl))); 5059 QDomAttr QDomElement::removeAttributeNode(const QDomAttr& oldAttr) 5062 return QDomAttr(); // ### should this return oldAttr? 5063 return QDomAttr(IMPL->removeAttributeNode(((QDomAttrPrivate*)oldAttr.impl))); 5075 QDomNodeList QDomElement::elementsByTagName(const QString& tagname) const 5077 return QDomNodeList(new QDomNodeListPrivate(impl, tagname)); 5092 bool QDomElement::hasAttribute(const QString& name) const 5096 return IMPL->hasAttribute(name); 5106 QString QDomElement::attributeNS(const QString nsURI, const QString& localName, const QString& defValue) const 5110 return IMPL->attributeNS(nsURI, localName, defValue); 5125 void QDomElement::setAttributeNS(const QString nsURI, const QString& qName, const QString& value) 5129 IMPL->setAttributeNS(nsURI, qName, value); 5147 void QDomElement::setAttributeNS(const QString nsURI, const QString& qName, qlonglong value) 5153 IMPL->setAttributeNS(nsURI, qName, x); 5159 void QDomElement::setAttributeNS(const QString nsURI, const QString& qName, qulonglong value) 5165 IMPL->setAttributeNS(nsURI, qName, x); 5171 void QDomElement::setAttributeNS(const QString nsURI, const QString& qName, double value) 5177 IMPL->setAttributeNS(nsURI, qName, x); 5186 void QDomElement::removeAttributeNS(const QString& nsURI, const QString& localName) 5190 QDomNodePrivate *n = IMPL->attributeNodeNS(nsURI, localName); 5193 IMPL->removeAttribute(n->nodeName()); 5203 QDomAttr QDomElement::attributeNodeNS(const QString& nsURI, const QString& localName) 5207 return QDomAttr(IMPL->attributeNodeNS(nsURI, localName)); 5220 QDomAttr QDomElement::setAttributeNodeNS(const QDomAttr& newAttr) 5224 return QDomAttr(IMPL->setAttributeNodeNS(((QDomAttrPrivate*)newAttr.impl))); 5236 QDomNodeList QDomElement::elementsByTagNameNS(const QString& nsURI, const QString& localName) const 5238 return QDomNodeList(new QDomNodeListPrivate(impl, nsURI, localName)); 5246 bool QDomElement::hasAttributeNS(const QString& nsURI, const QString& localName) const 5250 return IMPL->hasAttributeNS(nsURI, localName); 5267 QString QDomElement::text() const 5271 return IMPL->text(); 5276 /************************************************************** 5280 **************************************************************/ 5282 QDomTextPrivate::QDomTextPrivate(QDomDocumentPrivate* d, QDomNodePrivate* parent, const QString& val) 5283 : QDomCharacterDataPrivate(d, parent, val) 5285 name = QLatin1String("#text"); 5288 QDomTextPrivate::QDomTextPrivate(QDomTextPrivate* n, bool deep) 5289 : QDomCharacterDataPrivate(n, deep) 5293 QDomNodePrivate* QDomTextPrivate::cloneNode(bool deep) 5295 QDomNodePrivate* p = new QDomTextPrivate(this, deep); 5296 // We are not interested in this node 5301 QDomTextPrivate* QDomTextPrivate::splitText(int offset) 5304 qWarning("QDomText::splitText The node has no parent. So I can not split"); 5308 QDomTextPrivate* t = new QDomTextPrivate(ownerDocument(), 0, value.mid(offset)); 5309 value.truncate(offset); 5311 parent()->insertAfter(t, this); 5316 void QDomTextPrivate::save(QTextStream& s, int, int) const 5318 QDomTextPrivate *that = const_cast<QDomTextPrivate*>(this); 5319 s << encodeText(value, s, !(that->parent() && that->parent()->isElement()), false, true); 5322 /************************************************************** 5326 **************************************************************/ 5328 #define IMPL ((QDomTextPrivate*)impl) 5356 QDomText::QDomText() 5357 : QDomCharacterData() 5368 QDomText::QDomText(const QDomText& x) 5369 : QDomCharacterData(x) 5373 QDomText::QDomText(QDomTextPrivate* n) 5374 : QDomCharacterData(n) 5385 QDomText& QDomText::operator= (const QDomText& x) 5387 return (QDomText&) QDomNode::operator=(x); 5409 QDomText QDomText::splitText(int offset) 5413 return QDomText(IMPL->splitText(offset)); 5418 /************************************************************** 5420 * QDomCommentPrivate 5422 **************************************************************/ 5424 QDomCommentPrivate::QDomCommentPrivate(QDomDocumentPrivate* d, QDomNodePrivate* parent, const QString& val) 5425 : QDomCharacterDataPrivate(d, parent, val) 5427 name = QLatin1String("#comment"); 5430 QDomCommentPrivate::QDomCommentPrivate(QDomCommentPrivate* n, bool deep) 5431 : QDomCharacterDataPrivate(n, deep) 5436 QDomNodePrivate* QDomCommentPrivate::cloneNode(bool deep) 5438 QDomNodePrivate* p = new QDomCommentPrivate(this, deep); 5439 // We are not interested in this node 5444 void QDomCommentPrivate::save(QTextStream& s, int depth, int indent) const 5446 /* We don't output whitespace
if we would pollute
a text node. */
5448 s << QString(indent < 1 ? 0 : depth * indent,
QLatin1Char(
' '));
5450 s <<
"<!--" <<
value;
5563 s <<
"<![CDATA[" << value <<
"]]>";
5653 const QString& aname,
5654 const QString& pub,
const QString& sys)
5679 s <<
"<!NOTATION " << name <<
' ';
5690 /************************************************************** 5694 **************************************************************/ 5696 #define IMPL ((QDomNotationPrivate*)impl) 5733 QDomNotation::QDomNotation() 5745 QDomNotation::QDomNotation(const QDomNotation& x) 5750 QDomNotation::QDomNotation(QDomNotationPrivate* n) 5762 QDomNotation& QDomNotation::operator= (const QDomNotation& x) 5764 return (QDomNotation&) QDomNode::operator=(x); 5779 QString QDomNotation::publicId() const 5789 QString QDomNotation::systemId() const 5798 /************************************************************** 5802 **************************************************************/ 5804 QDomEntityPrivate::QDomEntityPrivate(QDomDocumentPrivate* d, QDomNodePrivate* parent, 5805 const QString& aname, 5806 const QString& pub, const QString& sys, const QString& notation) 5807 : QDomNodePrivate(d, parent) 5812 m_notationName = notation; 5815 QDomEntityPrivate::QDomEntityPrivate(QDomEntityPrivate* n, bool deep) 5816 : QDomNodePrivate(n, deep) 5820 m_notationName = n->m_notationName; 5823 QDomNodePrivate* QDomEntityPrivate::cloneNode(bool deep) 5825 QDomNodePrivate* p = new QDomEntityPrivate(this, deep); 5826 // We are not interested in this node 5832 Encode an entity value upon saving. 5834 static QByteArray encodeEntity(const QByteArray& str) 5836 QByteArray tmp(str); 5837 uint len = tmp.size(); 5839 const char* d = tmp.data(); 5842 tmp.replace(i, 1, "<"); 5847 else if (d[i] == '"') { 5848 tmp.replace(i, 1, ""
"); 5852 } else if (d[i] == '&' && i + 1 < len && d[i+1] == '#') { 5853 // Don't encode < or " or &custom;. 5854 // Only encode character references 5855 tmp.replace(i, 1, "&
"); 5867 void QDomEntityPrivate::save(QTextStream& s, int, int) const 5869 QString _name = name; 5870 if (_name.startsWith(QLatin1Char('%'))) 5871 _name = QLatin1String("%
") + _name.mid(1); 5873 if (m_sys.isNull() && m_pub.isNull()) { 5874 s << "<!ENTITY
" << _name << " \
"" <<
encodeEntity(value.toUtf8()) <<
"\">" <<
endl;
5876 s <<
"<!ENTITY " << _name <<
' ';
5882 if (! m_notationName.isNull()) {
5883 s <<
" NDATA " << m_notationName;
5889 /************************************************************** 5893 **************************************************************/ 5895 #define IMPL ((QDomEntityPrivate*)impl) 5935 QDomEntity::QDomEntity() 5948 QDomEntity::QDomEntity(const QDomEntity& x) 5953 QDomEntity::QDomEntity(QDomEntityPrivate* n) 5965 QDomEntity& QDomEntity::operator= (const QDomEntity& x) 5967 return (QDomEntity&) QDomNode::operator=(x); 5983 QString QDomEntity::publicId() const 5994 QString QDomEntity::systemId() const 6006 QString QDomEntity::notationName() const 6010 return IMPL->m_notationName; 6015 /************************************************************** 6017 * QDomEntityReferencePrivate 6019 **************************************************************/ 6021 QDomEntityReferencePrivate::QDomEntityReferencePrivate(QDomDocumentPrivate* d, QDomNodePrivate* parent, const QString& aname) 6022 : QDomNodePrivate(d, parent) 6027 QDomEntityReferencePrivate::QDomEntityReferencePrivate(QDomNodePrivate* n, bool deep) 6028 : QDomNodePrivate(n, deep) 6032 QDomNodePrivate* QDomEntityReferencePrivate::cloneNode(bool deep) 6034 QDomNodePrivate* p = new QDomEntityReferencePrivate(this, deep); 6035 // We are not interested in this node 6040 void QDomEntityReferencePrivate::save(QTextStream& s, int, int) const 6042 s << '&
' << name << ';
'; 6045 /************************************************************** 6047 * QDomEntityReference 6049 **************************************************************/ 6094 QDomEntityReference::QDomEntityReference() 6106 QDomEntityReference::QDomEntityReference(const QDomEntityReference& x) 6111 QDomEntityReference::QDomEntityReference(QDomEntityReferencePrivate* n) 6123 QDomEntityReference& QDomEntityReference::operator= (const QDomEntityReference& x) 6125 return (QDomEntityReference&) QDomNode::operator=(x); 6137 /************************************************************** 6139 * QDomProcessingInstructionPrivate 6141 **************************************************************/ 6143 QDomProcessingInstructionPrivate::QDomProcessingInstructionPrivate(QDomDocumentPrivate* d, 6144 QDomNodePrivate* parent, const QString& target, const QString& data) 6145 : QDomNodePrivate(d, parent) 6151 QDomProcessingInstructionPrivate::QDomProcessingInstructionPrivate(QDomProcessingInstructionPrivate* n, bool deep) 6152 : QDomNodePrivate(n, deep) 6157 QDomNodePrivate* QDomProcessingInstructionPrivate::cloneNode(bool deep) 6159 QDomNodePrivate* p = new QDomProcessingInstructionPrivate(this, deep); 6160 // We are not interested in this node 6165 void QDomProcessingInstructionPrivate::save(QTextStream& s, int, int) const 6167 s << "<?" << name << ' ' << value << "?>" << endl; 6170 /************************************************************** 6172 * QDomProcessingInstruction 6174 **************************************************************/ 6217 QDomProcessingInstruction::QDomProcessingInstruction() 6229 QDomProcessingInstruction::QDomProcessingInstruction(const QDomProcessingInstruction& x) 6234 QDomProcessingInstruction::QDomProcessingInstruction(QDomProcessingInstructionPrivate* n) 6246 QDomProcessingInstruction& QDomProcessingInstruction::operator= (const QDomProcessingInstruction& x) 6248 return (QDomProcessingInstruction&) QDomNode::operator=(x); 6265 QString QDomProcessingInstruction::target() const 6269 return impl->nodeName(); 6277 QString QDomProcessingInstruction::data() const 6281 return impl->nodeValue(); 6289 void QDomProcessingInstruction::setData(const QString& d) 6293 impl->setNodeValue(d); 6296 /************************************************************** 6298 * QDomDocumentPrivate 6300 **************************************************************/ 6302 QDomDocumentPrivate::QDomDocumentPrivate() 6303 : QDomNodePrivate(0), 6304 impl(new QDomImplementationPrivate), 6307 type = new QDomDocumentTypePrivate(this, this); 6310 name = QLatin1String("#document"); 6313 QDomDocumentPrivate::QDomDocumentPrivate(const QString& aname) 6314 : QDomNodePrivate(0), 6315 impl(new QDomImplementationPrivate), 6318 type = new QDomDocumentTypePrivate(this, this); 6322 name = QLatin1String("#document"); 6325 QDomDocumentPrivate::QDomDocumentPrivate(QDomDocumentTypePrivate* dt) 6326 : QDomNodePrivate(0), 6327 impl(new QDomImplementationPrivate), 6333 type = new QDomDocumentTypePrivate(this, this); 6337 name = QLatin1String("#document"); 6340 QDomDocumentPrivate::QDomDocumentPrivate(QDomDocumentPrivate* n, bool deep) 6341 : QDomNodePrivate(n, deep), 6342 impl(n->impl->clone()), 6345 type = static_cast<QDomDocumentTypePrivate*>(n->type->cloneNode()); 6346 type->setParent(this); 6349 QDomDocumentPrivate::~QDomDocumentPrivate() 6353 void QDomDocumentPrivate::clear() 6357 QDomNodePrivate::clear(); 6360 static void initializeReader(QXmlSimpleReader &reader, bool namespaceProcessing) 6362 reader.setFeature(QLatin1String("http://xml.org/sax/features/namespaces"), namespaceProcessing); 6363 reader.setFeature(QLatin1String("http://xml.org/sax/features/namespace-prefixes"), !namespaceProcessing); 6364 reader.setFeature(QLatin1String("http://trolltech.com/xml/features/report-whitespace-only-CharData"), false); // Shouldn't change in
Qt 4
6371 return setContent(source, &reader, errorMsg, errorLine, errorColumn);
6381 bool namespaceProcessing = reader->
feature(
QLatin1String(
"http://xml.org/sax/features/namespaces"))
6391 if (!reader->
parse(source)) {
6418 return static_cast<QDomElementPrivate *>(p);
6489 const QString &
data)
6543 switch (importedNode->
nodeType()) {
6591 #ifndef QT_NO_TEXTCODEC 6601 QString enc = encoding.
cap(3);
6603 enc = encoding.
cap(5);
6617 type->save(s, 0, indent);
6620 n->
save(s, 0, indent);
6627 #ifdef QT_NO_TEXTCODEC 6631 Q_ASSERT_X(codec,
"QDomNode::save()",
"A codec must be specified in the text stream.");
6635 s <<
"<?xml version=\"1.0\" encoding=\"" 6645 startNode = n->
next;
6654 startNode->
save(s, 0, indent);
6655 startNode = startNode->
next;
6666 #define IMPL ((QDomDocumentPrivate*)impl) 6829 return IMPL->setContent(&source, namespaceProcessing, errorMsg, errorLine, errorColumn);
6894 return IMPL->setContent(&source, namespaceProcessing, errorMsg, errorLine, errorColumn);
6911 return IMPL->setContent(&source, namespaceProcessing, errorMsg, errorLine, errorColumn);
6931 return IMPL->setContent(source, &reader, errorMsg, errorLine, errorColumn);
6949 return setContent(text,
false, errorMsg, errorLine, errorColumn);
6966 return setContent(buffer,
false, errorMsg, errorLine, errorColumn);
6982 return setContent(dev,
false, errorMsg, errorLine, errorColumn);
7005 return IMPL->setContent(source, reader, errorMsg, errorLine, errorColumn);
7163 const QString&
data)
7324 return QDomAttr(
IMPL->createAttributeNS(nsURI, qName));
7351 qWarning(
"elementById() is not implemented and will always return a null node.");
7560 : errorLine(0), errorColumn(0), doc(adoc), node(adoc), cdata(false),
7561 nsProcessing(namespaceProcessing), locator(0)
7604 for (
int i=0; i<atts.
length(); i++)
7636 QString(), QString(), QString()));
7669 if (!qt_xml_skipped_entity_in_content)
7722 publicId, systemId, notationName);
bool fatalError(const QXmlParseException &exception)
A reader must use this function to report a non-recoverable error.
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QDomNodePrivate * node_impl
QDomElement firstChildElement(const QString &tagName=QString()) const
Returns the first child element with tag name tagName if tagName is non-empty; otherwise returns the ...
bool endElement(const QString &nsURI, const QString &localName, const QString &qName)
The reader calls this function when it has parsed an end element tag with the qualified name qName...
QDomImplementation()
Constructs a QDomImplementation object.
bool endEntity(const QString &)
The reader calls this function to report the end of an entity called name.
QString value() const
Returns the value of the attribute or an empty string if the attribute has not been specified...
QDomNodePrivate * item(int index)
QDomNode parentNode() const
Returns the parent node.
QDomProcessingInstruction toProcessingInstruction() const
Converts a QDomNode into a QDomProcessingInstruction.
QDomElement createElement(const QString &tagName)
Creates a new element called tagName that can be inserted into the DOM tree, e.g. ...
bool startElement(const QString &nsURI, const QString &localName, const QString &qName, const QXmlAttributes &atts)
The reader calls this function when it has parsed a start element tag.
QDomNodePrivate * cloneNode(bool deep=true)
void clear()
Converts the node into a null node; if it was not a null node before, its type and contents are delet...
virtual QDomNodePrivate * replaceChild(QDomNodePrivate *newChild, QDomNodePrivate *oldChild)
QDomNode appendChild(const QDomNode &newChild)
Appends newChild as the node's last child.
bool isCDATASection() const
Returns true if the node is a CDATA section; otherwise returns false.
The QHash::const_iterator class provides an STL-style const iterator for QHash and QMultiHash...
QDomEntityReferencePrivate * createEntityReference(const QString &name)
QDomEntityReference createEntityReference(const QString &name)
Creates a new entity reference called name that can be inserted into the document, e.g.
bool isSupported(const QString &feature, const QString &version) const
Returns true if the DOM implementation implements the feature feature and this feature is supported b...
The QXmlLocator class provides the XML handler classes with information about the parsing position wi...
QString tagName() const
Returns the tag name of this element.
QDomNamedNodeMap attributes() const
Returns a named node map of all attributes.
virtual bool isCharacterData() const
virtual void setContentHandler(QXmlContentHandler *handler)=0
Sets the content handler to handler.
bool startDTD(const QString &name, const QString &publicId, const QString &systemId)
The reader calls this function to report the start of a DTD declaration, if any.
bool characters(const QString &ch)
The reader calls this function when it has parsed a chunk of character data (either normal character ...
QString cap(int nth=0) const
Returns the text captured by the nth subexpression.
QDomElement nextSiblingElement(const QString &taName=QString()) const
Returns the next sibling element with tag name tagName if tagName is non-empty; otherwise returns any...
QDomNodePrivate * parent() const
#define QT_END_NAMESPACE
This macro expands to.
bool endCDATA()
The reader calls this function to report the end of a CDATA section.
QDomNodePrivate * removeChild(QDomNodePrivate *oldChild)
QString value(int index) const
Returns an attribute's value for the attribute at position index.
QDomNodePrivate * importNode(const QDomNodePrivate *importedNode, bool deep)
QDomAttrPrivate(QDomDocumentPrivate *, QDomNodePrivate *, const QString &name)
virtual QDomNodePrivate * insertAfter(QDomNodePrivate *newChild, QDomNodePrivate *refChild)
char * data()
Returns a pointer to the data stored in the byte array.
void setLocation(int lineNumber, int columnNumber)
QDomDocumentFragment()
Constructs an empty document fragment.
int remove(const Key &key)
Removes all the items that have the key from the hash.
bool skippedEntity(const QString &name)
Some readers may skip entities if they have not seen the declarations (e.
const QChar at(int i) const
Returns the character at the given index position in the string.
static QString fixedCharData(const QString &data, bool *ok)
bool specified() const
Returns true if the attribute has been set by the user with setValue().
bool isDocument() const
Returns true if the node is a document; otherwise returns false.
The QRegExp class provides pattern matching using regular expressions.
static void setInvalidDataPolicy(InvalidDataPolicy policy)
Sets the invalid data policy, which specifies what should be done when a factory function in QDomDocu...
bool operator==(const QDomNodeListPrivate &) const
QDomCommentPrivate * createComment(const QString &data)
T * data() const
Returns the value of the pointer referenced by this object.
The QDomText class represents text data in the parsed XML document.
ushort unicode() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool isDocumentFragment() const
Returns true if the node is a document fragment; otherwise returns false.
The QAtomicInt class provides platform-independent atomic operations on integers. ...
bool hasFeature(const QString &feature, const QString &version) const
The function returns true if QDom implements the requested version of a feature; otherwise returns fa...
#define it(className, varName)
uint length() const
Returns the number of nodes in the map.
NodeType
This enum defines the type of the node:
QDomNode removeNamedItem(const QString &name)
Removes the node called name from the map.
uint length() const
Returns the number of nodes in the list.
void setData(const QByteArray &data)
Sets the contents of the internal buffer to be data.
The QDomProcessingInstruction class represents an XML processing instruction.
QDomNodeList elementsByTagName(const QString &tagname) const
Returns a QDomNodeList, that contains all the elements in the document with the name tagname...
QHash< QString, QDomNodePrivate * > map
bool isNull()
Returns false if the object was created by QDomDocument::implementation(); otherwise returns true...
void setAttributeNS(const QString &nsURI, const QString &qName, const QString &newValue)
QString substringData(unsigned long offset, unsigned long count) const
QByteArray toUtf8() const Q_REQUIRED_RESULT
Returns a UTF-8 representation of the string as a QByteArray.
QDomAttr()
Constructs an empty attribute.
QDomNode::NodeType nodeType() const
QDomCharacterData()
Constructs an empty character data object.
QString & replace(int i, int len, QChar after)
QDomElement lastChildElement(const QString &tagName=QString()) const
Returns the last child element with tag name tagName if tagName is non-empty; otherwise returns the l...
void saveDocument(QTextStream &stream, const int indent, QDomNode::EncodingPolicy encUsed) const
bool createdWithDom1Interface
The QByteArray class provides an array of bytes.
NodeType nodeType() const
Returns the type of the node.
virtual void save(QTextStream &, int, int) const
void normalize()
Calling normalize() on an element converts all its children into a standard form. ...
int length() const
Returns the number of characters in this string.
void setCodec(QTextCodec *codec)
Sets the codec for this stream to codec.
bool hasChildNodes() const
Returns true if the node has one or more children; otherwise returns false.
QDomAttrPrivate * removeAttributeNode(QDomAttrPrivate *oldAttr)
QDomNodePrivate * appendChild(QDomNodePrivate *newChild)
bool startCDATA()
The reader calls this function to report the start of a CDATA section.
virtual void save(QTextStream &s, int, int) const
T * take()
Returns the value of the pointer referenced by this object.
QDomNode firstChild() const
Returns the first child of the node.
QString toString(int=1) const
Converts the parsed document back to its textual representation.
virtual bool isText() const
QString nodeName() const
Returns the name of the node.
void removeAttribute(const QString &name)
QDomCDATASection toCDATASection() const
Converts a QDomNode into a QDomCDATASection.
QString attributeNS(const QString &nsURI, const QString &localName, const QString &defValue) const
QDomDocument toDocument() const
Converts a QDomNode into a QDomDocument.
bool contains(const QString &name) const
Returns true if the map contains a node called name; otherwise returns false.
static void clear(QVariant::Private *d)
QDomNotation toNotation() const
Converts a QDomNode into a QDomNotation.
bool operator!=(const QDomNodeList &) const
Returns true the node list n and this node list are not equal; otherwise returns false.
QString localName() const
If the node uses namespaces, this function returns the local name of the node; otherwise it returns a...
virtual void save(QTextStream &s, int, int) const
QDomDocumentPrivate * ownerDocument()
bool isElement() const
Returns true if the node is an element; otherwise returns false.
QDomNodeList & operator=(const QDomNodeList &)
Assigns n to this node list.
QDomDocumentTypePrivate * doctype()
static bool isChar(const QChar c)
Determines whether c is a valid instance of production [2]Char in the XML 1.0 specification.
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
QDomNode()
Constructs a null node.
long ASN1_INTEGER_get ASN1_INTEGER * a
QDomNode & operator=(const QDomNode &)
Assigns a copy of n to this DOM node.
virtual bool isNotation() const
QDomNodePrivate * insertBefore(QDomNodePrivate *newChild, QDomNodePrivate *refChild)
bool operator!=(QBool b1, bool b2)
QDomProcessingInstructionPrivate * createProcessingInstruction(const QString &target, const QString &data)
bool ref()
Atomically increments the value of this QAtomicInt.
QDomNode item(int index) const
Retrieves the node at position index.
bool isEntityReference() const
QDomNodePrivate * removeNamedItem(const QString &name)
void setData(const QString &)
Sets this object's string to v.
The QBuffer class provides a QIODevice interface for a QByteArray.
friend class QDomNodeList
QDomNodePrivate * insertAfter(QDomNodePrivate *newChild, QDomNodePrivate *refChild)
The QString class provides a Unicode character string.
static InvalidDataPolicy invalidDataPolicy()
Returns the invalid data policy, which specifies what should be done when a factory function in QDomD...
QDomNode::NodeType nodeType() const
QDomTextPrivate * createTextNode(const QString &data)
The QHash class is a template class that provides a hash-table-based dictionary.
~QDomImplementation()
Destroys the object and frees its resources.
QDomText toText() const
Converts a QDomNode into a QDomText.
QDomNodePrivate * cloneNode(bool deep=true)
void insertData(unsigned long offset, const QString &arg)
Inserts the string arg into the stored string at position offset.
virtual bool isAttr() const
QDomNodePrivate * ownerNode
The QDomDocumentType class is the representation of the DTD in the document tree. ...
QDomNamedNodeMapPrivate * clone(QDomNodePrivate *parent)
virtual QDomNodePrivate * appendChild(QDomNodePrivate *newChild)
The QDomNotation class represents an XML notation.
bool hasAttribute(const QString &name)
QDomNodePrivate * setNamedItemNS(QDomNodePrivate *arg)
uint length() const
Returns the length of the stored string.
QDomDocumentType doctype() const
Returns the document type of this document.
virtual bool isEntity() const
QString attribute(const QString &name, const QString &defValue) const
The QChar class provides a 16-bit Unicode character.
bool notationDecl(const QString &name, const QString &publicId, const QString &systemId)
The reader calls this function when it has parsed a notation declaration.
void setPrefix(const QString &pre)
If the node has a namespace prefix, this function changes the namespace prefix of the node to pre...
QDomAttr createAttributeNS(const QString &nsURI, const QString &qName)
Creates a new attribute with namespace support that can be inserted into an element.
QDomNode::NodeType nodeType() const
virtual bool isElement() const
QDomImplementation implementation() const
Returns a QDomImplementation object.
QDomNode::NodeType nodeType() const
QTextCodec * codec() const
Returns the codec that is current assigned to the stream.
virtual int lineNumber() const =0
Returns the line number (starting at 1) or -1 if there is no line number available.
static QString fixedCDataSection(const QString &data, bool *ok)
QString substringData(unsigned long offset, unsigned long count)
Returns the substring of length count from position offset.
The QScopedPointer class stores a pointer to a dynamically allocated object, and deletes it upon dest...
bool operator!=(const QDomImplementation &) const
Returns true if x and this DOM implementation object were created from different QDomDocuments; other...
bool setContent(const QByteArray &text, bool namespaceProcessing, QString *errorMsg=0, int *errorLine=0, int *errorColumn=0)
QDomNamedNodeMapPrivate * entities
bool canEncode(QChar) const
Returns true if the Unicode character ch can be fully encoded with this codec; otherwise returns fals...
virtual QDomNode::NodeType nodeType() const
bool operator==(const QDomImplementation &) const
Returns true if x and this DOM implementation object were created from the same QDomDocument; otherwi...
static void qt_split_namespace(QString &prefix, QString &name, const QString &qName, bool hasURI)
QDomNodePrivate * replaceChild(QDomNodePrivate *newChild, QDomNodePrivate *oldChild)
QDomNodePrivate(QDomDocumentPrivate *, QDomNodePrivate *parent=0)
static QString fixedPIData(const QString &data, bool *ok)
The QXmlSimpleReader class provides an implementation of a simple XML parser.
virtual bool isDocumentFragment() const
bool processingInstruction(const QString &target, const QString &data)
The reader calls this function when it has parsed a processing instruction.
void appendData(const QString &arg)
Appends the string arg to the stored string.
QString nodeValue() const
The QDomDocument class represents an XML document.
QDomDocumentFragment & operator=(const QDomDocumentFragment &)
Assigns x to this DOM document fragment.
#define QT_BEGIN_NAMESPACE
This macro expands to.
QDomElement toElement() const
Converts a QDomNode into a QDomElement.
void setValue(const QString &)
Sets the attribute's value to v.
int columnNumber() const
For nodes created by QDomDocument::setContent(), this function returns the column number in the XML d...
QDomHandler(QDomDocumentPrivate *d, bool namespaceProcessing)
QDomNode::NodeType nodeType() const
QDomNode insertAfter(const QDomNode &newChild, const QDomNode &refChild)
Inserts the node newChild after the child node refChild.
QDomAttrPrivate * attributeNode(const QString &name)
virtual bool isDocumentType() const
QDomNodePrivate * namedItem(const QString &name)
QDomNode::NodeType nodeType() const
QDomNode::NodeType nodeType() const
int indexIn(const QString &str, int offset=0, CaretMode caretMode=CaretAtZero) const
Attempts to find a match in str from position offset (0 by default).
QDomDocumentPrivate * doc
QString left(int n) const Q_REQUIRED_RESULT
Returns a substring that contains the n leftmost characters of the string.
void replaceData(unsigned long offset, unsigned long count, const QString &arg)
bool contains(const T &value) const
int size() const
Returns the number of characters in this string.
virtual int columnNumber() const =0
Returns the column number (starting at 1) or -1 if there is no column number available.
QDomNode::NodeType nodeType() const
QDomImplementationPrivate * implementation()
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
static QString fixedSystemLiteral(const QString &data, bool *ok)
void replaceData(unsigned long offset, unsigned long count, const QString &arg)
Replaces the substring of length count starting at position offset with the string arg...
static bool isNameChar(const QChar c)
Determines whether c is a valid instance of production [4]NameChar in the XML 1.0 specification...
QDomDocumentFragmentPrivate * createDocumentFragment()
virtual QDomNodePrivate * cloneNode(bool deep=true)
bool deref()
Atomically decrements the value of this QAtomicInt.
QExplicitlySharedDataPointer< QDomDocumentTypePrivate > type
QDomNodePrivate * item(int index) const
QDomDocumentFragment toDocumentFragment() const
Converts a QDomNode into a QDomDocumentFragment.
virtual void save(QTextStream &s, int, int) const
bool isEmpty() const
Returns true if the hash contains no items; otherwise returns false.
QDomNode namedItemNS(const QString &nsURI, const QString &localName) const
Returns the node associated with the local name localName and the namespace URI nsURI.
QDomCDATASection & operator=(const QDomCDATASection &)
Assigns x to this CDATA section.
friend class QDomDocumentType
const T & value() const
Returns the current item's value.
Q_CORE_EXPORT void qWarning(const char *,...)
virtual bool isAttr() const
const_iterator insert(const T &value)
The QDomDocumentFragment class is a tree of QDomNodes which is not usually a complete QDomDocument...
virtual bool isEntity() const
void deleteData(unsigned long offset, unsigned long count)
static const char * data(const QByteArray &arr)
int indexOf(QChar c, int from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
virtual QDomNodePrivate * insertBefore(QDomNodePrivate *newChild, QDomNodePrivate *refChild)
QDomAttrPrivate * createAttribute(const QString &name)
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
static QTextCodec * codec(MYSQL *mysql)
~QDomDocumentTypePrivate()
virtual bool isCDATASection() const
QDomDocument()
Constructs an empty document.
virtual void setDTDHandler(QXmlDTDHandler *handler)=0
Sets the DTD handler to handler.
QString nodeValue() const
Returns the value of the node.
int columnNumber() const
Returns the column number where the error occurred.
virtual void setDeclHandler(QXmlDeclHandler *handler)=0
Sets the declaration handler to handler.
QByteArray toLatin1() const Q_REQUIRED_RESULT
Returns a Latin-1 representation of the string as a QByteArray.
QDomAttr createAttribute(const QString &name)
Creates a new attribute called name that can be inserted into an element, e.g.
The QXmlDefaultHandler class provides a default implementation of all the XML handler classes...
static QSvgNode * createTextNode(QSvgNode *parent, const QXmlStreamAttributes &attributes, QSvgHandler *handler)
QDomNodePrivate * setNamedItem(QDomNodePrivate *arg)
bool hasAttributes() const
Returns true if the node has attributes; otherwise returns false.
virtual void setNodeValue(const QString &v)
QDomElement ownerElement() const
Returns the element node this attribute is attached to or a null node if this attribute is not attach...
QDomElementPrivate * documentElement()
EncodingPolicy
This enum specifies how QDomNode::save() determines what encoding to use when serializing.
virtual bool isText() const
QDomNode removeChild(const QDomNode &oldChild)
Removes oldChild from the list of children.
~QDomNode()
Destroys the object and frees its resources.
QDomNamedNodeMapPrivate * m_attr
The QDomCDATASection class represents an XML CDATA section.
QDomAttrPrivate * setAttributeNode(QDomAttrPrivate *newAttr)
QDomCDATASection createCDATASection(const QString &data)
Creates a new CDATA section for the string value that can be inserted into the document, e.g.
The QXmlReader class provides an interface for XML readers (i.e.
QDomImplementationPrivate * clone()
virtual void setErrorHandler(QXmlErrorHandler *handler)=0
Sets the error handler to handler.
QDomCDATASectionPrivate * createCDATASection(const QString &data)
QDomImplementation & operator=(const QDomImplementation &)
Assigns x to this DOM implementation.
static QString quotedValue(const QString &data)
~QDomNamedNodeMapPrivate()
void setNodeValue(const QString &)
Sets the node's value to v.
bool unparsedEntityDecl(const QString &name, const QString &publicId, const QString &systemId, const QString ¬ationName)
The reader calls this function when it finds an unparsed entity declaration.
void reset(T *other=0)
Deletes the existing object it is pointing to if any, and sets its pointer to other.
QDomComment toComment() const
Converts a QDomNode into a QDomComment.
QString name() const
Returns the attribute's name.
QDomImplementationPrivate()
virtual void save(QTextStream &s, int, int) const
The QDomEntity class represents an XML entity.
virtual QByteArray name() const =0
QTextCodec subclasses must reimplement this function.
bool isNull() const
Returns true if this string is null; otherwise returns false.
QString message() const
Returns the error message.
bool isAttr() const
Returns true if the node is an attribute; otherwise returns false.
static QByteArray encodeEntity(const QByteArray &str)
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the hash.
QDomNodePrivate * cloneNode(bool deep=true)
QString mid(int position, int n=-1) const Q_REQUIRED_RESULT
Returns a string that contains n characters of this string, starting at the specified position index...
QDomNode::NodeType nodeType() const
QDomElementPrivate(QDomDocumentPrivate *, QDomNodePrivate *parent, const QString &name)
QDomNotationPrivate(QDomDocumentPrivate *, QDomNodePrivate *parent, const QString &name, const QString &pub, const QString &sys)
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the hash...
virtual QDomNodePrivate * cloneNode(bool deep=true)
bool hasAttributeNS(const QString &nsURI, const QString &localName)
static QString fixedComment(const QString &data, bool *ok)
#define Q_ASSERT_X(cond, where, what)
QDomNode namedItem(const QString &name) const
Returns the node called name.
virtual ~QDomNodePrivate()
QDomNamedNodeMapPrivate * attributes()
bool externalEntityDecl(const QString &name, const QString &publicId, const QString &systemId)
The reader calls this function to report a parsed external entity declaration.
QDomNodeList()
Creates an empty node list.
QDomAttrPrivate * attributeNodeNS(const QString &nsURI, const QString &localName)
QDomCDATASectionPrivate(QDomDocumentPrivate *, QDomNodePrivate *parent, const QString &val)
QDomCharacterData & operator=(const QDomCharacterData &)
Assigns x to this character data.
QString & append(QChar c)
QDomElement elementById(const QString &elementId)
Returns the element whose ID is equal to elementId.
QDomDocumentTypePrivate(QDomDocumentPrivate *, QDomNodePrivate *parent=0)
~QDomDocument()
Destroys the object and frees its resources.
QDomDocumentFragment createDocumentFragment()
Creates a new document fragment, that can be used to hold parts of the document, e.g.
QDomCDATASection()
Constructs an empty CDATA section.
int length() const
Returns the number of attributes in the list.
The QDomEntityReference class represents an XML entity reference.
QDomNodeListPrivate(QDomNodePrivate *)
QString uri(int index) const
Looks up an attribute's namespace URI for the attribute at position index.
QDomNode cloneNode(bool deep=true) const
Creates a deep (not shallow) copy of the QDomNode.
QDomNodeListPrivate * impl
The QTextStream class provides a convenient interface for reading and writing text.
void setAttribute(const QString &name, const QString &value)
QDomNode namedItem(const QString &name) const
Returns the first direct child node for which nodeName() equals name.
void clear()
Clears the contents of the string and makes it empty.
QDomAttr toAttr() const
Converts a QDomNode into a QDomAttr.
void setParent(QDomNodePrivate *p)
The QDomAttr class represents one attribute of a QDomElement.
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
QDomNode setNamedItemNS(const QDomNode &newNode)
Inserts the node newNode in the map.
virtual bool isEntityReference() const
virtual void setLexicalHandler(QXmlLexicalHandler *handler)=0
Sets the lexical handler to handler.
The QDomNode class is the base class for all the nodes in a DOM tree.
QDomDocumentType toDocumentType() const
Converts a QDomNode into a QDomDocumentType.
bool isEntity() const
Returns true if the node is an entity; otherwise returns false.
QDomText createTextNode(const QString &data)
Creates a text node for the string value that can be inserted into the document tree, e.g.
bool contains(const QString &name) const
static bool isLetter(const QChar c)
Determines whether c is a valid instance of production [84]Letter in the XML 1.0 specification.
static QDomImplementation::InvalidDataPolicy invalidDataPolicy
bool isProcessingInstruction() const
Returns true if the node is a processing instruction; otherwise returns false.
QDomProcessingInstruction createProcessingInstruction(const QString &target, const QString &data)
Creates a new processing instruction that can be inserted into the document, e.g. ...
QDomNamedNodeMap & operator=(const QDomNamedNodeMap &)
Assigns n to this named node map.
QDomDocumentType createDocumentType(const QString &qName, const QString &publicId, const QString &systemId)
Creates a document type node for the name qName.
QDomNode replaceChild(const QDomNode &newChild, const QDomNode &oldChild)
Replaces oldChild with newChild.
QDomEntity toEntity() const
Converts a QDomNode into a QDomEntity.
QDomAttrPrivate * setAttributeNodeNS(QDomAttrPrivate *newAttr)
~QDomNodeList()
Destroys the object and frees its resources.
QDomElementPrivate * createElementNS(const QString &nsURI, const QString &qName)
void setNodeValue(const QString &v)
bool isNull() const
Returns true if this node is null (i.e.
QByteArray toByteArray(int=1) const
Converts the parsed document back to its textual representation and returns a QByteArray containing t...
virtual bool isElement() const
bool setContent(QXmlInputSource *source, bool namespaceProcessing, QString *errorMsg, int *errorLine, int *errorColumn)
static QString fixedXmlName(const QString &_name, bool *ok, bool namespaces=false)
QDomAttr & operator=(const QDomAttr &)
Assigns x to this DOM attribute.
static QString fixedPubidLiteral(const QString &data, bool *ok)
QDomNode insertBefore(const QDomNode &newChild, const QDomNode &refChild)
Inserts the node newChild before the child node refChild.
bool isNotation() const
Returns true if the node is a notation; otherwise returns false.
QString qName(int index) const
Looks up an attribute's XML 1.0 qualified name for the attribute at position index.
virtual bool isDocumentType() const
virtual bool parse(const QXmlInputSource &input)=0
Parses the given input.
QDomNodePrivate * cloneNode(bool deep=true)
static QTextCodec * codecForName(const QByteArray &name)
Searches all installed QTextCodec objects and returns the one which best matches name; the match is c...
virtual bool isDocument() const
bool fatalError(const QXmlParseException &exception)
This reimplementation does nothing.
QDomCharacterDataPrivate(QDomDocumentPrivate *, QDomNodePrivate *parent, const QString &data)
The QDomNodeList class is a list of QDomNode objects.
virtual bool isProcessingInstruction() const
bool operator!=(const QDomNodeListPrivate &) const
QDomNode setNamedItem(const QDomNode &newNode)
Inserts the node newNode into the named node map.
QDomNode removeNamedItemNS(const QString &nsURI, const QString &localName)
Removes the node with the local name localName and the namespace URI nsURI from the map...
QDomNodePrivate * cloneNode(bool deep=true)
virtual bool isNotation() const
bool operator!=(const QDomNamedNodeMap &) const
Returns true if n and this named node map are not equal; otherwise returns false. ...
QDomNode item(int index) const
Returns the node at position index.
The QDomCharacterData class represents a generic string in the DOM.
InvalidDataPolicy
This enum specifies what should be done when a factory function in QDomDocument is called with invali...
void setOwnerDocument(QDomDocumentPrivate *doc)
bool operator==(const QDomNamedNodeMap &) const
Returns true if n and this named node map are equal; otherwise returns false.
QDomElement previousSiblingElement(const QString &tagName=QString()) const
Returns the previous sibilng element with tag name tagName if tagName is non-empty; otherwise returns...
bool isDocumentType() const
Returns true if the node is a document type; otherwise returns false.
bool startEntity(const QString &)
The reader calls this function to report the start of an entity called name.
QDomImplementationPrivate * impl
The QXmlAttributes class provides XML attributes.
QDomNodeList elementsByTagNameNS(const QString &nsURI, const QString &localName)
Returns a QDomNodeList that contains all the elements in the document with the local name localName a...
bool endDocument()
The reader calls this function after it has finished parsing.
QString namespaceURI() const
Returns the namespace URI of this node or an empty string if the node has no namespace URI...
bool qt_xml_skipped_entity_in_content
QTextStream & operator<<(QTextStream &str, const QDomNode &node)
Writes the XML representation of the node node and all its children to the stream str...
virtual bool feature(const QString &name, bool *ok=0) const =0
If the reader has the feature called name, the feature's value is returned.
bool isComment() const
Returns true if the node is a comment; otherwise returns false.
QDomNode::NodeType nodeType() const
QDomDocument & operator=(const QDomDocument &)
Assigns x to this DOM document.
void setAppendToParent(bool b)
QDomDocumentFragmentPrivate(QDomDocumentPrivate *, QDomNodePrivate *parent=0)
QString prefix() const
Returns the namespace prefix of the node or an empty string if the node has no namespace prefix...
QDomDocument ownerDocument() const
Returns the document to which this node belongs.
QDomEntityReference toEntityReference() const
Converts a QDomNode into a QDomEntityReference.
bool operator!=(const QDomNode &) const
Returns true if n and this DOM node are not equal; otherwise returns false.
bool isEntityReference() const
Returns true if the node is an entity reference; otherwise returns false.
bool isCharacterData() const
Returns true if the node is a character data node; otherwise returns false.
QDomNodePrivate * namedItemNS(const QString &nsURI, const QString &localName) const
virtual bool isCharacterData() const
static void initializeReader(QXmlSimpleReader &reader, bool namespaceProcessing)
iterator insertMulti(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
virtual bool isDocumentFragment() const
QString & remove(int i, int len)
Removes n characters from the string, starting at the given position index, and returns a reference t...
QDomComment createComment(const QString &data)
Creates a new comment for the string value that can be inserted into the document, e.g.
The QTextCodec class provides conversions between text encodings.
static QString encodeText(const QString &str, QTextStream &s, const bool encodeQuotes=true, const bool performAVN=false, const bool encodeEOLs=false)
virtual QDomNodePrivate * removeChild(QDomNodePrivate *oldChild)
virtual bool isProcessingInstruction() const
~QDomNamedNodeMap()
Destroys the object and frees its resources.
The QDomNamedNodeMap class contains a collection of nodes that can be accessed by name...
QDomNodePrivate * cloneNode(bool deep=true)
QDomNode previousSibling() const
Returns the previous sibling in the document tree.
The QIODevice class is the base interface class of all I/O devices in Qt.
bool comment(const QString &ch)
The reader calls this function to report an XML comment anywhere in the document. ...
QExplicitlySharedDataPointer< QDomImplementationPrivate > impl
QDomAttrPrivate * createAttributeNS(const QString &nsURI, const QString &qName)
QString & insert(int i, QChar c)
QDomDocument createDocument(const QString &nsURI, const QString &qName, const QDomDocumentType &doctype)
Creates a DOM document with the document type doctype.
static void normalize(double &x, double &y)
QDomNode lastChild() const
Returns the last child of the node.
static bool isPublicID(const QString &candidate)
Determines whether c is a valid instance of production [12] PubidLiteral in the XML 1...
The QDomImplementation class provides information about the features of the DOM implementation.
void appendData(const QString &arg)
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
QDomNode importNode(const QDomNode &importedNode, bool deep)
Imports the node importedNode from another document to this document.
The QDomElement class represents one element in the DOM tree.
QDomNodePrivate * cloneNode(bool deep=true)
void save(QTextStream &, int) const
Writes the XML representation of the node and all its children to the stream str. ...
bool operator==(QBool b1, bool b2)
QDomNamedNodeMapPrivate * notations
QDomNode::NodeType nodeType() const
#define impl(owner, mather, type)
QDomNodePrivate * namedItem(const QString &name) const
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
void save(QTextStream &s, int, int) const
virtual bool isComment() const
bool isText() const
Returns true if the node is a text node; otherwise returns false.
void setDocumentLocator(QXmlLocator *locator)
The reader calls this function before it starts parsing the document.
QDomElement documentElement() const
Returns the root element of the document.
QDomNode::NodeType nodeType() const
QDomNamedNodeMap()
Constructs an empty named node map.
QDomElementPrivate * createElement(const QString &tagName)
static void qNormalizeNode(QDomNodePrivate *n)
bool containsNS(const QString &nsURI, const QString &localName) const
QDomNode nextSibling() const
Returns the next sibling in the document tree.
QDomNamedNodeMapPrivate(QDomNodePrivate *)
bool operator==(const QDomNodeList &) const
Returns true if the node list n and this node list are equal; otherwise returns false.
QDomNode::NodeType nodeType() const
Returns the type of node this object refers to (i.e.
void deleteData(unsigned long offset, unsigned long count)
Deletes a substring of length count from position offset.
The QXmlParseException class is used to report errors with the QXmlErrorHandler interface.
virtual bool isCDATASection() const
QDomNodeList childNodes() const
Returns a list of all direct child nodes.
QDomNamedNodeMapPrivate * impl
void insertData(unsigned long offset, const QString &arg)
The QList class is a template class that provides lists.
QString data() const
Returns the string stored in this object.
QList< QDomNodePrivate * > list
int lineNumber() const
Returns the line number where the error occurred.
QDomElement createElementNS(const QString &nsURI, const QString &qName)
Creates a new element with namespace support that can be inserted into the DOM tree.
QDomCharacterData toCharacterData() const
Converts a QDomNode into a QDomCharacterData.
int lineNumber() const
For nodes created by QDomDocument::setContent(), this function returns the line number in the XML doc...
Q_CORE_EXPORT QTextStream & endl(QTextStream &s)
bool operator==(const QDomNode &) const
Returns true if n and this DOM node are equal; otherwise returns false.