'\" t .TH TQXmlContentHandler 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*- .\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the .\" license file included in the distribution for a complete license .\" statement. .\" .ad l .nh .SH NAME TQXmlContentHandler \- Interface to report the logical content of XML data .SH SYNOPSIS All the functions in this class are reentrant when TQt is built with thread support.

.PP \fC#include \fR .PP Inherited by TQXmlDefaultHandler. .PP .SS "Public Members" .in +1c .ti -1c .BI "virtual void \fBsetDocumentLocator\fR ( TQXmlLocator * locator ) = 0" .br .ti -1c .BI "virtual bool \fBstartDocument\fR () = 0" .br .ti -1c .BI "virtual bool \fBendDocument\fR () = 0" .br .ti -1c .BI "virtual bool \fBstartPrefixMapping\fR ( const TQString & prefix, const TQString & uri ) = 0" .br .ti -1c .BI "virtual bool \fBendPrefixMapping\fR ( const TQString & prefix ) = 0" .br .ti -1c .BI "virtual bool \fBstartElement\fR ( const TQString & namespaceURI, const TQString & localName, const TQString & qName, const TQXmlAttributes & atts ) = 0" .br .ti -1c .BI "virtual bool \fBendElement\fR ( const TQString & namespaceURI, const TQString & localName, const TQString & qName ) = 0" .br .ti -1c .BI "virtual bool \fBcharacters\fR ( const TQString & ch ) = 0" .br .ti -1c .BI "virtual bool \fBignorableWhitespace\fR ( const TQString & ch ) = 0" .br .ti -1c .BI "virtual bool \fBprocessingInstruction\fR ( const TQString & target, const TQString & data ) = 0" .br .ti -1c .BI "virtual bool \fBskippedEntity\fR ( const TQString & name ) = 0" .br .ti -1c .BI "virtual TQString \fBerrorString\fR () = 0" .br .in -1c .SH DESCRIPTION The TQXmlContentHandler class provides an interface to report the logical content of XML data. .PP If the application needs to be informed of basic parsing events, it can implement this interface and activate it using TQXmlReader::setContentHandler(). The reader can then report basic document-related events like the start and end of elements and character data through this interface. .PP The order of events in this interface is very important, and mirrors the order of information in the document itself. For example, all of an element's content (character data, processing instructions, and sub-elements) appears, in order, between the startElement() event and the corresponding endElement() event. .PP The class TQXmlDefaultHandler provides a default implementation for this interface; subclassing from the TQXmlDefaultHandler class is very convenient if you only want to be informed of some parsing events. .PP The startDocument() function is called at the start of the document, and endDocument() is called at the end. Before parsing begins setDocumentLocator() is called. For each element startElement() is called, with endElement() being called at the end of each element. The characters() function is called with chunks of character data; ignorableWhitespace() is called with chunks of whitespace and processingInstruction() is called with processing instructions. If an entity is skipped skippedEntity() is called. At the beginning of prefix-URI scopes startPrefixMapping() is called. .PP See also the Introduction to SAX2. .PP See also TQXmlDTDHandler, TQXmlDeclHandler, TQXmlEntityResolver, TQXmlErrorHandler, TQXmlLexicalHandler, and XML. .SH MEMBER FUNCTION DOCUMENTATION .SH "bool TQXmlContentHandler::characters ( const TQString & ch )\fC [pure virtual]\fR" The reader calls this function when it has parsed a chunk of character data (either normal character data or character data inside a CDATA section; if you need to distinguish between those two types you must use TQXmlLexicalHandler::startCDATA() and TQXmlLexicalHandler::endCDATA()). The character data is reported in \fIch\fR. .PP Some readers report whitespace in element content using the ignorableWhitespace() function rather than using this one. .PP A reader may report the character data of an element in more than one chunk; e.g. a reader might want to report "a\fR) cause a startElement() call to be immediately followed by an endElement() call. .PP The attribute list provided only contains attributes with explicit values. The attribute list contains attributes used for namespace declaration (i.e. attributes starting with xmlns) only if the namespace-prefix property of the reader is TRUE. .PP The argument \fInamespaceURI\fR is the namespace URI, or TQString::null if the element has no namespace URI or if no namespace processing is done. \fIlocalName\fR is the local name (without prefix), or TQString::null if no namespace processing is done, \fIqName\fR is the qualified name (with prefix) and \fIatts\fR are the attributes attached to the element. If there are no attributes, \fIatts\fR is an empty attributes object. .PP If this function returns FALSE the reader stops parsing and reports an error. The reader uses the function errorString() to get the error message. .PP See also the namespace description. .PP See also endElement(). .PP Example: xml/tagreader/structureparser.cpp. .SH "bool TQXmlContentHandler::startPrefixMapping ( const TQString & prefix, const TQString & uri )\fC [pure virtual]\fR" The reader calls this function to signal the begin of a prefix-URI namespace mapping scope. This information is not necessary for normal namespace processing since the reader automatically replaces prefixes for element and attribute names. .PP Note that startPrefixMapping() and endPrefixMapping() calls are not guaranteed to be properly nested relative to each other: all startPrefixMapping() events occur before the corresponding startElement() event, and all endPrefixMapping() events occur after the corresponding endElement() event, but their order is not otherwise guaranteed. .PP The argument \fIprefix\fR is the namespace prefix being declared and the argument \fIuri\fR is the namespace URI the prefix is mapped to. .PP If this function returns FALSE the reader stops parsing and reports an error. The reader uses the function errorString() to get the error message. .PP See also the namespace description. .PP See also endPrefixMapping(). .SH "SEE ALSO" .BR http://doc.trolltech.com/tqxmlcontenthandler.html .BR http://www.trolltech.com/faq/tech.html .SH COPYRIGHT Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the license file included in the distribution for a complete license statement. .SH AUTHOR Generated automatically from the source code. .SH BUGS If you find a bug in Qt, please report it as described in .BR http://doc.trolltech.com/bughowto.html . Good bug reports help us to help you. Thank you. .P The definitive TQt documentation is provided in HTML format; it is located at $TQTDIR/doc/html and can be read using TQt Assistant or with a web browser. This man page is provided as a convenience for those users who prefer man pages, although this format is not officially supported by Trolltech. .P If you find errors in this manual page, please report them to .BR qt-bugs@trolltech.com . Please include the name of the manual page (tqxmlcontenthandler.3qt) and the Qt version (3.3.8).