|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.trolltech.qt.QSignalEmitter
com.trolltech.qt.QtJambiObject
com.trolltech.qt.xmlpatterns.QAbstractXmlReceiver
com.trolltech.qt.xmlpatterns.QXmlSerializer
public class QXmlSerializer
The QXmlSerializer
class is an implementation of QAbstractXmlReceiver
for transforming XQuery
output into unformatted XML. QXmlSerializer
translates an XQuery sequence
, usually the output of an QXmlQuery
, into XML. Consider the example:
QXmlQuery query = new QXmlQuery(); query.setQuery("doc('index.html')/html/body/p[1]"); QXmlSerializerPointer serializer = new QXmlSerializerPointer(new QXmlSerializer(query, myOutputDevice)); query.evaluateToReceiver(serializer);First it constructs a
query
that gets the first paragraph from document index.html. Then it constructs an instance of this class with the query
and myOutputDevice
. Finally, it evaluates
the query
, producing an ordered sequence of calls to the serializer's callback functions. The sequence of callbacks transforms the query output to XML and writes it to myOutputDevice
. QXmlSerializer
will:
QXmlQuery::evaluateTo()
. If the generated XML should be indented and formatted for reading, use QXmlFormatter
.
QXmlFormatter
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter |
---|
QSignalEmitter.Signal0, QSignalEmitter.Signal1, QSignalEmitter.Signal2, QSignalEmitter.Signal3, QSignalEmitter.Signal4, QSignalEmitter.Signal5, QSignalEmitter.Signal6, QSignalEmitter.Signal7, QSignalEmitter.Signal8, QSignalEmitter.Signal9 |
Constructor Summary | |
---|---|
QXmlSerializer(QXmlQuery query,
QIODevice outputDevice)
Constructs a serializer that uses the name pool and message handler in query, and writes the output to outputDevice. |
Method Summary | |
---|---|
QTextCodec |
codec()
Returns the codec being used by the serializer for encoding its XML output. |
static QXmlSerializer |
fromNativePointer(QNativePointer nativePointer)
|
QIODevice |
outputDevice()
Returns a pointer to the output device. |
void |
setCodec(QTextCodec codec)
Sets the codec the serializer will use for encoding its XML output. |
Methods inherited from class com.trolltech.qt.xmlpatterns.QAbstractXmlReceiver |
---|
clone, comment, endDocument, endElement, namespaceBinding, nativePointerArray, processingInstruction, startDocument, startElement, whitespaceOnly |
Methods inherited from class com.trolltech.qt.QtJambiObject |
---|
dispose, disposed, equals, finalize, reassignNativeResources, tr, tr, tr |
Methods inherited from class com.trolltech.qt.QSignalEmitter |
---|
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.trolltech.qt.QtJambiInterface |
---|
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership |
Constructor Detail |
---|
public QXmlSerializer(QXmlQuery query, QIODevice outputDevice)
outputDevice must be a valid, non-null device that is open in write mode, otherwise behavior is undefined.
outputDevice must not be opened with QIODevice::Text
because it will cause the output to be incorrect. This class will ensure line endings are serialized as according with the XML specification. QXmlSerializer
does not take ownership of outputDevice.
Method Detail |
---|
public final QTextCodec codec()
setCodec()
.
public final QIODevice outputDevice()
public final void setCodec(QTextCodec codec)
codec()
.
public static QXmlSerializer fromNativePointer(QNativePointer nativePointer)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |