55 : isPreviousAtomic(false),
57 np(query.namePool().
d),
80 defNss[0] =
QXmlName(StandardNamespaces::empty,
81 StandardLocalNames::empty,
82 StandardPrefixes::empty);
83 defNss[1] =
QXmlName(StandardNamespaces::xml,
84 StandardLocalNames::empty,
85 StandardPrefixes::xml);
164 qWarning(
"outputDevice cannot be null.");
170 qWarning(
"outputDevice must be opened in write mode.");
198 if (!
d->hasClosedElement.top().second) {
200 d->hasClosedElement.top().second =
true;
214 const int length = toEscape.
length();
216 for(
int i = 0; i < length; ++i)
227 result += toEscape.
at(i);
243 const int length = toEscape.
length();
245 for(
int i = 0; i < length; ++i)
258 result += toEscape.
at(i);
270 d->device->write(
d->codec->fromUnicode(content.
constData(), content.
length(), &
d->converterState));
285 const QString content(
d->np->toLexical(name));
286 mutableCell =
d->codec->fromUnicode(content.constData(),
289 d->device->write(mutableCell);
292 d->device->write(cell);
301 d->device->write(chars);
323 d->query.d->staticContext()->error(QtXmlPatterns::tr(
324 "Element %1 can't be serialized because it appears outside " 326 ReportContext::SENR0001,
327 d->query.d->expression().data());
338 d->hasClosedElement.push(
qMakePair(name,
false));
339 d->isPreviousAtomic =
false;
360 d->isPreviousAtomic =
false;
376 if(name.
prefix() != StandardPrefixes::empty)
383 d->query.d->staticContext()->error(QtXmlPatterns::tr(
384 "Attribute %1 can't be serialized because it appears at " 386 ReportContext::SENR0001,
387 d->query.d->expression().data());
405 const int levelLen =
d->namespaces.size();
407 if(nb.
prefix() == StandardPrefixes::empty)
409 for(
int lvl = levelLen - 1; lvl >= 0; --lvl)
412 const int vectorLen = scope.
size();
414 for(
int s = vectorLen - 1; s >= 0; --s)
418 if(nsb.
prefix() == StandardPrefixes::empty)
425 for(
int lvl = 0; lvl < levelLen; ++lvl)
428 const int vectorLen = scope.
size();
430 for(
int s = 0; s < vectorLen; ++s)
457 "It makes no sense to pass a null QXmlName.");
460 (nb.
prefix() == StandardPrefixes::empty),
462 "Undeclarations of prefixes aren't allowed in XML 1.0 " 463 "and aren't supposed to be received.");
471 d->namespaces.top().append(nb);
473 if(nb.
prefix() == StandardPrefixes::empty)
494 "Invalid input; it's the caller's responsibility to ensure " 495 "the input is correct.");
501 d->isPreviousAtomic =
false;
510 d->isPreviousAtomic =
false;
524 "Invalid input; it's the caller's responsibility to ensure " 525 "the input is correct.");
534 d->isPreviousAtomic =
false;
546 if(
d->isPreviousAtomic)
554 d->isPreviousAtomic =
true;
586 d->isPreviousAtomic =
false;
595 d->isPreviousAtomic =
false;
623 d->codec = outputCodec;
The QVariant class acts like a union for the most common Qt data types.
QBool contains(QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
QIODevice * outputDevice() const
Returns a pointer to the output device.
QString toString() const
Returns a copy of the string reference as a QString object.
virtual void attribute(const QXmlName &name, const QStringRef &value)
Reimplemented Function
const QTextCodec * codec() const
Returns the codec being used by the serializer for encoding its XML output.
A push interface for the XPath Data Model. Similar to SAX's ContentHandler.
#define QT_END_NAMESPACE
This macro expands to.
const QChar at(int i) const
Returns the character at the given index position in the string.
bool isWritable() const
Returns true if data can be written to the device; otherwise returns false.
virtual void characters(const QStringRef &value)
Reimplemented Function
void writeEscaped(const QString &toEscape)
virtual void comment(const QString &value)
Reimplemented Function
QString formatKeyword(const QString &keyword)
void writeEscapedAttribute(const QString &toEscape)
The QByteArray class provides an array of bytes.
int length() const
Returns the number of characters in this string.
Due to strong interdependencies, this file contains the definitions for the classes Item...
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
The QString class provides a Unicode character string.
bool isNode() const
Determines whether this item is an atomic value, or a node.
virtual void endDocument()
Reimplemented Function
void sendAsNode(const QPatternist::Item &outputItem)
Treats outputItem as a node and calls the appropriate function, e.
QTextCodec::ConverterState converterState
The QChar class provides a 16-bit Unicode character.
void setCodec(const QTextCodec *codec)
Sets the codec the serializer will use for encoding its XML output.
QString prefix(const QXmlNamePool &query) const
Returns the prefix.
void reserve(int size)
Ensures that the QHash's internal hash table consists of at least size buckets.
virtual void endElement()
Reimplemented Function
void resize(int size)
Sets the size of the vector to size.
virtual void processingInstruction(const QXmlName &name, const QString &value)
Reimplemented Function
virtual void startOfSequence()
Reimplemented Function
void reserve(int size)
Attempts to allocate memory for at least size characters.
#define QT_BEGIN_NAMESPACE
This macro expands to.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
The QXmlSerializer class is an implementation of QAbstractXmlReceiver for transforming XQuery output ...
The namespace for the internal API of QtXmlPatterns.
Q_CORE_EXPORT void qWarning(const char *,...)
QString stringValue() const
Returns the string value of this Item.
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
static QTextCodec * codec(MYSQL *mysql)
QStack< QPair< QXmlName, bool > > hasClosedElement
bool isNull() const
Returns true if this byte array is null; otherwise returns false.
virtual void item(const QPatternist::Item &item)
void push(const T &t)
Adds element t to the top of the stack.
The QStringRef class provides a thin wrapper around QString substrings.
const T & at(int i) const
Returns the item at index position i in the vector.
virtual void namespaceBinding(const QXmlName &nb)
Reimplemented Function
QHash< QXmlName::Code, QByteArray > nameCache
NamespaceCode namespaceURI() const
bool isAtomicValue() const
Determines whether this item is an atomic value, or a node.
#define Q_ASSERT_X(cond, where, what)
The QXmlName class represents the name of an XML node, in an efficient, namespace-aware way...
Contains functions used for formatting arguments, such as keywords and paths, in translated strings...
Represents an item in the XPath 2.0 Data Model.
virtual void endOfSequence()
Reimplemented Function
QXmlSerializerPrivate(const QXmlQuery &q, QIODevice *outputDevice)
Q_OUTOFLINE_TEMPLATE QPair< T1, T2 > qMakePair(const T1 &x, const T2 &y)
bool isBindingInScope(const QXmlName nb) const
virtual void atomicValue(const QVariant &value)
Reimplemented Function
Code code() const
Returns the internal code that contains the id codes for the local name, prefix and namespace URI...
virtual void startDocument()
Reimplemented Function
void reserve(int size)
Attempts to allocate memory for at least size elements.
QXmlSerializer(const QXmlQuery &query, QIODevice *outputDevice)
Constructs a serializer that uses the name pool and message handler in query, and writes the output t...
The QTextCodec class provides conversions between text encodings.
The QIODevice class is the base interface class of all I/O devices in Qt.
virtual void startElement(const QXmlName &name)
Reimplemented Function
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
int size() const
Returns the number of items in the vector.
bool atDocumentRoot() const
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
const QChar * constData() const
Returns a pointer to the data stored in the QString.
void write(const QXmlName &name)
bool isNull() const
Returns true if this QXmlName is not initialized with a valid combination of {namespace URI}...
The QXmlQuery class performs XQueries on XML data, or on non-XML data modeled to look like XML...
QStack< QVector< QXmlName > > namespaces