syndication/atom
25#include <syndication/elementwrapper.h>
26#include <syndication/tools.h>
28#include <QtXml/QDomElement>
29#include <QtCore/QString>
31namespace Syndication {
35QString
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-2024 The KDE developers.
Generated on Wed Jan 24 2024 00:00:00 by
doxygen 1.10.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.