aboutsummaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/QXmppElement.cpp9
-rw-r--r--source/QXmppElement.h1
2 files changed, 10 insertions, 0 deletions
diff --git a/source/QXmppElement.cpp b/source/QXmppElement.cpp
index 7dac43e6..a793a999 100644
--- a/source/QXmppElement.cpp
+++ b/source/QXmppElement.cpp
@@ -33,6 +33,10 @@ QXmppElement::QXmppElement()
QXmppElement::QXmppElement(const QDomElement &element)
{
m_tagName = element.tagName();
+ QString xmlns = element.namespaceURI();
+ QString parentns = element.parentNode().namespaceURI();
+ if (!xmlns.isEmpty() && xmlns != parentns)
+ m_attributes.insert("xmlns", xmlns);
QDomNamedNodeMap attributes = element.attributes();
for (int i = 0; i < attributes.size(); i++)
{
@@ -73,6 +77,11 @@ void QXmppElement::setChildren(QList<QXmppElement> &children)
m_children = children;
}
+bool QXmppElement::isNull() const
+{
+ return m_tagName.isEmpty();
+}
+
QString QXmppElement::tagName() const
{
return m_tagName;
diff --git a/source/QXmppElement.h b/source/QXmppElement.h
index 74f8150c..416487cb 100644
--- a/source/QXmppElement.h
+++ b/source/QXmppElement.h
@@ -47,6 +47,7 @@ public:
QString tagName() const;
void setTagName(const QString &type);
+ bool isNull() const;
void toXml(QXmlStreamWriter *writer) const;
private: