syndication/atom
22 #include "constants.h"
25 #include <syndication/elementwrapper.h>
26 #include <syndication/tools.h>
28 #include <QtXml/QDomElement>
29 #include <QtCore/QString>
31 namespace Syndication {
35 QString
extractAtomText(
const Syndication::ElementWrapper& parent,
const QString& tagname)
39 QDomElement el = parent.firstElementByTagNameNS(
atom1Namespace(), tagname);
41 bool isCDATA = el.firstChild().isCDATASection();
43 QString type = el.attribute(QLatin1String(
"type"), QLatin1String(
"text"));
45 if (type == QLatin1String(
"text"))
47 str = parent.extractElementTextNS(
atom1Namespace(), tagname).trimmed();
49 str = resolveEntities(str);
51 str = escapeSpecialCharacters(str);
53 else if (type == QLatin1String(
"html"))
55 str = parent.extractElementTextNS(
atom1Namespace(), tagname).trimmed();
57 else if (type == QLatin1String(
"xhtml"))
59 str = ElementWrapper::childNodesAsXML(el).trimmed();
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Jul 13 2013 01:26:22 by
doxygen 1.8.3.1 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.