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();
QString atom1Namespace()
namespace used by Atom 1.0 elements
QString extractAtomText(const Syndication::ElementWrapper &parent, const QString &tagname)
extracts the content of an atomTextConstruct.
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Tue Nov 26 2013 09:02:42 by
doxygen 1.8.5 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.