Eneboo - Documentación para desarrolladores
Métodos públicos
Referencia de la Clase QXmlDefaultHandler

The QXmlDefaultHandler class provides a default implementation of all the XML handler classes.XMLVery often we are only interested in parts of the things that the reader reports. This class implements a default behaviour for the handler classes (i.e. most of the time do nothing). Usually this is the class you subclass for implementing your own customized handler. Más...

#include <qxml.h>

Diagrama de herencias de QXmlDefaultHandler
QXmlDeclHandler QXmlLexicalHandler QXmlEntityResolver QXmlDTDHandler QXmlErrorHandler QXmlContentHandler QXmlDeclHandler QXmlLexicalHandler QXmlEntityResolver QXmlDTDHandler QXmlErrorHandler QXmlContentHandler QDomHandler QphHandler TsHandler TsHandler UiHandler

Lista de todos los miembros.

Métodos públicos

 QXmlDefaultHandler ()
virtual ~QXmlDefaultHandler ()
void setDocumentLocator (QXmlLocator *locator)
bool startDocument ()
bool endDocument ()
bool startPrefixMapping (const QString &prefix, const QString &uri)
bool endPrefixMapping (const QString &prefix)
bool startElement (const QString &namespaceURI, const QString &localName, const QString &qName, const QXmlAttributes &atts)
bool endElement (const QString &namespaceURI, const QString &localName, const QString &qName)
bool characters (const QString &ch)
bool ignorableWhitespace (const QString &ch)
bool processingInstruction (const QString &target, const QString &data)
bool skippedEntity (const QString &name)
bool warning (const QXmlParseException &exception)
bool error (const QXmlParseException &exception)
bool fatalError (const QXmlParseException &exception)
bool notationDecl (const QString &name, const QString &publicId, const QString &systemId)
bool unparsedEntityDecl (const QString &name, const QString &publicId, const QString &systemId, const QString &notationName)
bool resolveEntity (const QString &publicId, const QString &systemId, QXmlInputSource *&ret)
bool startDTD (const QString &name, const QString &publicId, const QString &systemId)
bool endDTD ()
bool startEntity (const QString &name)
bool endEntity (const QString &name)
bool startCDATA ()
bool endCDATA ()
bool comment (const QString &ch)
bool attributeDecl (const QString &eName, const QString &aName, const QString &type, const QString &valueDefault, const QString &value)
bool internalEntityDecl (const QString &name, const QString &value)
bool externalEntityDecl (const QString &name, const QString &publicId, const QString &systemId)
QString errorString ()
 QXmlDefaultHandler ()
virtual ~QXmlDefaultHandler ()
void setDocumentLocator (QXmlLocator *locator)
bool startDocument ()
bool endDocument ()
bool startPrefixMapping (const QString &prefix, const QString &uri)
bool endPrefixMapping (const QString &prefix)
bool startElement (const QString &namespaceURI, const QString &localName, const QString &qName, const QXmlAttributes &atts)
bool endElement (const QString &namespaceURI, const QString &localName, const QString &qName)
bool characters (const QString &ch)
bool ignorableWhitespace (const QString &ch)
bool processingInstruction (const QString &target, const QString &data)
bool skippedEntity (const QString &name)
bool warning (const QXmlParseException &exception)
bool error (const QXmlParseException &exception)
bool fatalError (const QXmlParseException &exception)
bool notationDecl (const QString &name, const QString &publicId, const QString &systemId)
bool unparsedEntityDecl (const QString &name, const QString &publicId, const QString &systemId, const QString &notationName)
bool resolveEntity (const QString &publicId, const QString &systemId, QXmlInputSource *&ret)
bool startDTD (const QString &name, const QString &publicId, const QString &systemId)
bool endDTD ()
bool startEntity (const QString &name)
bool endEntity (const QString &name)
bool startCDATA ()
bool endCDATA ()
bool comment (const QString &ch)
bool attributeDecl (const QString &eName, const QString &aName, const QString &type, const QString &valueDefault, const QString &value)
bool internalEntityDecl (const QString &name, const QString &value)
bool externalEntityDecl (const QString &name, const QString &publicId, const QString &systemId)
QString errorString ()

Descripción detallada

The QXmlDefaultHandler class provides a default implementation of all the XML handler classes.

XML

Very often we are only interested in parts of the things that the reader reports. This class implements a default behaviour for the handler classes (i.e. most of the time do nothing). Usually this is the class you subclass for implementing your own customized handler.

See also the Introduction to SAX2.

Ver también:
QXmlDTDHandler QXmlDeclHandler QXmlContentHandler QXmlEntityResolver QXmlErrorHandler QXmlLexicalHandler

Documentación del constructor y destructor

QXmlDefaultHandler::QXmlDefaultHandler ( ) [inline]

Constructor.

QXmlDefaultHandler::~QXmlDefaultHandler ( ) [inline, virtual]

Destructor.

QXmlDefaultHandler::QXmlDefaultHandler ( ) [inline]
virtual QXmlDefaultHandler::~QXmlDefaultHandler ( ) [inline, virtual]

Documentación de las funciones miembro

bool QXmlDefaultHandler::attributeDecl ( const QString eName,
const QString aName,
const QString type,
const QString valueDefault,
const QString value 
) [virtual]

Does nothing.

Implementa QXmlDeclHandler.

bool QXmlDefaultHandler::attributeDecl ( const QString eName,
const QString aName,
const QString type,
const QString valueDefault,
const QString value 
) [virtual]

The reader calls this function to report an attribute type declaration. Only the effective (first) declaration for an attribute is reported.

The reader passes the name of the associated element in eName and the name of the attribute in aName. It passes a string that represents the attribute type in type and a string that represents the attribute default in valueDefault. This string is one of "#IMPLIED", "#REQUIRED", "#FIXED" or QString::null (if none of the others applies). The reader passes the attribute's default value in value. If no default value is specified in the XML file, value is QString::null.

If this function returns FALSE the reader stops parsing and reports an error. The reader uses the function errorString() to get the error message.

Implementa QXmlDeclHandler.

bool QXmlDefaultHandler::characters ( const QString ch) [virtual]

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 QXmlLexicalHandler::startCDATA() and QXmlLexicalHandler::endCDATA()). The character data is reported in ch.

Some readers report whitespace in element content using the ignorableWhitespace() function rather than using this one.

A reader may report the character data of an element in more than one chunk; e.g. a reader might want to report "a\<b" in three characters() events ("a ", "\<" and " b").

If this function returns FALSE the reader stops parsing and reports an error. The reader uses the function errorString() to get the error message.

Implementa QXmlContentHandler.

Reimplementado en TsHandler, QDomHandler, QphHandler, UiHandler y TsHandler.

bool QXmlDefaultHandler::characters ( const QString ch) [virtual]

Does nothing.

Implementa QXmlContentHandler.

Reimplementado en TsHandler, QDomHandler, QphHandler, UiHandler y TsHandler.

bool QXmlDefaultHandler::comment ( const QString ch) [virtual]

Does nothing.

Implementa QXmlLexicalHandler.

Reimplementado en QDomHandler.

bool QXmlDefaultHandler::comment ( const QString ch) [virtual]

The reader calls this function to report an XML comment anywhere in the document. It reports the text of the comment in ch.

If this function returns FALSE the reader stops parsing and reports an error. The reader uses the function errorString() to get the error message.

Implementa QXmlLexicalHandler.

Reimplementado en QDomHandler.

bool QXmlDefaultHandler::endCDATA ( ) [virtual]

Does nothing.

Implementa QXmlLexicalHandler.

Reimplementado en QDomHandler.

bool QXmlDefaultHandler::endCDATA ( ) [virtual]

The reader calls this function to report the end of a CDATA section.

If this function returns FALSE the reader stops parsing and reports an error. The reader uses the function errorString() to get the error message.

Ver también:
startCDATA() QXmlContentHandler::characters()

Implementa QXmlLexicalHandler.

Reimplementado en QDomHandler.

bool QXmlDefaultHandler::endDocument ( ) [virtual]

Does nothing.

Implementa QXmlContentHandler.

Reimplementado en QDomHandler.

bool QXmlDefaultHandler::endDocument ( ) [virtual]

The reader calls this function after it has finished parsing. It is called just once, and is the last handler function called. It is called after the reader has read all input or has abandoned parsing because of a fatal error.

If this function returns FALSE the reader stops parsing and reports an error. The reader uses the function errorString() to get the error message.

Ver también:
startDocument()

Implementa QXmlContentHandler.

Reimplementado en QDomHandler.

bool QXmlDefaultHandler::endDTD ( ) [virtual]

Does nothing.

Implementa QXmlLexicalHandler.

bool QXmlDefaultHandler::endDTD ( ) [virtual]

The reader calls this function to report the end of a DTD declaration, if any.

If this function returns FALSE the reader stops parsing and reports an error. The reader uses the function errorString() to get the error message.

Ver también:
startDTD()

Implementa QXmlLexicalHandler.

bool QXmlDefaultHandler::endElement ( const QString namespaceURI,
const QString localName,
const QString qName 
) [virtual]

The reader calls this function when it has parsed an end element tag with the qualified name qName, the local name localName and the namespace URI namespaceURI.

If this function returns FALSE the reader stops parsing and reports an error. The reader uses the function errorString() to get the error message.

See also the namespace description.

Ver también:
startElement()

Implementa QXmlContentHandler.

Reimplementado en TsHandler, QDomHandler, QphHandler, UiHandler y TsHandler.

bool QXmlDefaultHandler::endElement ( const QString namespaceURI,
const QString localName,
const QString qName 
) [virtual]

Does nothing.

Implementa QXmlContentHandler.

Reimplementado en TsHandler, QDomHandler, QphHandler, UiHandler y TsHandler.

bool QXmlDefaultHandler::endEntity ( const QString name) [virtual]

Does nothing.

Implementa QXmlLexicalHandler.

Reimplementado en QDomHandler.

bool QXmlDefaultHandler::endEntity ( const QString name) [virtual]

The reader calls this function to report the end of an entity called name.

For every startEntity() call, there is a corresponding endEntity() call. The calls to startEntity() and endEntity() are properly nested.

If this function returns FALSE the reader stops parsing and reports an error. The reader uses the function errorString() to get the error message.

Ver también:
startEntity() QXmlContentHandler::skippedEntity() QXmlSimpleReader::setFeature()

Implementa QXmlLexicalHandler.

Reimplementado en QDomHandler.

bool QXmlDefaultHandler::endPrefixMapping ( const QString prefix) [virtual]

The reader calls this function to signal the end of a prefix mapping for the prefix prefix.

If this function returns FALSE the reader stops parsing and reports an error. The reader uses the function errorString() to get the error message.

See also the namespace description.

Ver también:
startPrefixMapping()

Implementa QXmlContentHandler.

bool QXmlDefaultHandler::endPrefixMapping ( const QString prefix) [virtual]

Does nothing.

Implementa QXmlContentHandler.

bool QXmlDefaultHandler::error ( const QXmlParseException exception) [virtual]

A reader might use this function to report a recoverable error. A recoverable error corresponds to the definiton of "error" in section 1.2 of the XML 1.0 specification. Details of the error are stored in exception.

The reader must continue to provide normal parsing events after invoking this function.

If this function returns FALSE the reader stops parsing and reports an error. The reader uses the function errorString() to get the error message.

Implementa QXmlErrorHandler.

bool QXmlDefaultHandler::error ( const QXmlParseException exception) [virtual]

Does nothing.

Implementa QXmlErrorHandler.

QString QXmlDefaultHandler::errorString ( ) [virtual]

The reader calls this function to get an error string, e.g. if any of the handler functions returns FALSE.

Implementa QXmlContentHandler.

QString QXmlDefaultHandler::errorString ( ) [virtual]

Returns the default error string.

Implementa QXmlContentHandler.

bool QXmlDefaultHandler::externalEntityDecl ( const QString name,
const QString publicId,
const QString systemId 
) [virtual]

Does nothing.

Implementa QXmlDeclHandler.

Reimplementado en QDomHandler.

bool QXmlDefaultHandler::externalEntityDecl ( const QString name,
const QString publicId,
const QString systemId 
) [virtual]

The reader calls this function to report a parsed external entity declaration. Only the effective (first) declaration for each entity is reported.

The reader passes the name of the entity in name, the public identifier in publicId and the system identifier in systemId. If there is no public identifier specified, it passes QString::null in publicId.

If this function returns FALSE the reader stops parsing and reports an error. The reader uses the function errorString() to get the error message.

Implementa QXmlDeclHandler.

Reimplementado en QDomHandler.

bool QXmlDefaultHandler::fatalError ( const QXmlParseException exception) [virtual]

A reader must use this function to report a non-recoverable error. Details of the error are stored in exception.

If this function returns TRUE the reader might try to go on parsing and reporting further errors; but no regular parsing events are reported.

Implementa QXmlErrorHandler.

Reimplementado en TsHandler, QDomHandler, QphHandler, UiHandler y TsHandler.

bool QXmlDefaultHandler::fatalError ( const QXmlParseException exception) [virtual]

Does nothing.

Implementa QXmlErrorHandler.

Reimplementado en TsHandler, QDomHandler, QphHandler, UiHandler y TsHandler.

bool QXmlDefaultHandler::ignorableWhitespace ( const QString ch) [virtual]

Some readers may use this function to report each chunk of whitespace in element content. The whitespace is reported in ch.

If this function returns FALSE the reader stops parsing and reports an error. The reader uses the function errorString() to get the error message.

Implementa QXmlContentHandler.

bool QXmlDefaultHandler::ignorableWhitespace ( const QString ch) [virtual]

Does nothing.

Implementa QXmlContentHandler.

bool QXmlDefaultHandler::internalEntityDecl ( const QString name,
const QString value 
) [virtual]

Does nothing.

Implementa QXmlDeclHandler.

bool QXmlDefaultHandler::internalEntityDecl ( const QString name,
const QString value 
) [virtual]

The reader calls this function to report an internal entity declaration. Only the effective (first) declaration is reported.

The reader passes the name of the entity in name and the value of the entity in value.

If this function returns FALSE the reader stops parsing and reports an error. The reader uses the function errorString() to get the error message.

Implementa QXmlDeclHandler.

bool QXmlDefaultHandler::notationDecl ( const QString name,
const QString publicId,
const QString systemId 
) [virtual]

The reader calls this function when it has parsed a notation declaration.

The argument name is the notation name, publicId is the notation's public identifier and systemId is the notation's system identifier.

If this function returns FALSE the reader stops parsing and reports an error. The reader uses the function errorString() to get the error message.

Implementa QXmlDTDHandler.

Reimplementado en QDomHandler.

bool QXmlDefaultHandler::notationDecl ( const QString name,
const QString publicId,
const QString systemId 
) [virtual]

Does nothing.

Implementa QXmlDTDHandler.

Reimplementado en QDomHandler.

bool QXmlDefaultHandler::processingInstruction ( const QString target,
const QString data 
) [virtual]

The reader calls this function when it has parsed a processing instruction.

target is the target name of the processing instruction and data is the data in the processing instruction.

If this function returns FALSE the reader stops parsing and reports an error. The reader uses the function errorString() to get the error message.

Implementa QXmlContentHandler.

Reimplementado en QDomHandler.

bool QXmlDefaultHandler::processingInstruction ( const QString target,
const QString data 
) [virtual]

Does nothing.

Implementa QXmlContentHandler.

Reimplementado en QDomHandler.

bool QXmlDefaultHandler::resolveEntity ( const QString publicId,
const QString systemId,
QXmlInputSource *&  ret 
) [virtual]

Sets ret to 0, so that the reader uses the system identifier provided in the XML document.

Implementa QXmlEntityResolver.

bool QXmlDefaultHandler::resolveEntity ( const QString publicId,
const QString systemId,
QXmlInputSource *&  ret 
) [virtual]

The reader calls this function before it opens any external entity, except the top-level document entity. The application may request the reader to resolve the entity itself (ret is 0) or to use an entirely different input source (ret points to the input source).

The reader deletes the input source ret when it no longer needs it, so you should allocate it on the heap with new.

The argument publicId is the public identifier of the external entity, systemId is the system identifier of the external entity and ret is the return value of this function. If ret is 0 the reader should resolve the entity itself, if it is non-zero it must point to an input source which the reader uses instead.

If this function returns FALSE the reader stops parsing and reports an error. The reader uses the function errorString() to get the error message.

Implementa QXmlEntityResolver.

void QXmlDefaultHandler::setDocumentLocator ( QXmlLocator locator) [virtual]

Does nothing.

Implementa QXmlContentHandler.

void QXmlDefaultHandler::setDocumentLocator ( QXmlLocator locator) [virtual]

The reader calls this function before it starts parsing the document. The argument locator is a pointer to a QXmlLocator which allows the application to get the parsing position within the document.

Do not destroy the locator; it is destroyed when the reader is destroyed. (Do not use the locator after the reader is destroyed).

Implementa QXmlContentHandler.

bool QXmlDefaultHandler::skippedEntity ( const QString name) [virtual]

Some readers may skip entities if they have not seen the declarations (e.g. because they are in an external DTD). If they do so they report that they skipped the entity called name by calling this function.

If this function returns FALSE the reader stops parsing and reports an error. The reader uses the function errorString() to get the error message.

Implementa QXmlContentHandler.

Reimplementado en QDomHandler.

bool QXmlDefaultHandler::skippedEntity ( const QString name) [virtual]

Does nothing.

Implementa QXmlContentHandler.

Reimplementado en QDomHandler.

bool QXmlDefaultHandler::startCDATA ( ) [virtual]

Does nothing.

Implementa QXmlLexicalHandler.

Reimplementado en QDomHandler.

bool QXmlDefaultHandler::startCDATA ( ) [virtual]

The reader calls this function to report the start of a CDATA section. The content of the CDATA section is reported through the QXmlContentHandler::characters() function. This function is intended only to report the boundary.

If this function returns FALSE the reader stops parsing and reports an error. The reader uses the function errorString() to get the error message.

Ver también:
endCDATA()

Implementa QXmlLexicalHandler.

Reimplementado en QDomHandler.

bool QXmlDefaultHandler::startDocument ( ) [virtual]

Does nothing.

Implementa QXmlContentHandler.

bool QXmlDefaultHandler::startDocument ( ) [virtual]

The reader calls this function when it starts parsing the document. The reader calls this function just once, after the call to setDocumentLocator(), and before any other functions in this class or in the QXmlDTDHandler class are called.

If this function returns FALSE the reader stops parsing and reports an error. The reader uses the function errorString() to get the error message.

Ver también:
endDocument()

Implementa QXmlContentHandler.

bool QXmlDefaultHandler::startDTD ( const QString name,
const QString publicId,
const QString systemId 
) [virtual]

The reader calls this function to report the start of a DTD declaration, if any. It reports the name of the document type in name, the public identifier in publicId and the system identifier in systemId.

If the public identifier is missing, publicId is set to QString::null. If the system identifier is missing, systemId is set to QString::null. Note that it is not valid XML to have a public identifier but no system identifier; in such cases a parse error will occur.

All declarations reported through QXmlDTDHandler or QXmlDeclHandler appear between the startDTD() and endDTD() calls.

If this function returns FALSE the reader stops parsing and reports an error. The reader uses the function errorString() to get the error message.

Ver también:
endDTD()

Implementa QXmlLexicalHandler.

Reimplementado en QDomHandler.

bool QXmlDefaultHandler::startDTD ( const QString name,
const QString publicId,
const QString systemId 
) [virtual]

Does nothing.

Implementa QXmlLexicalHandler.

Reimplementado en QDomHandler.

bool QXmlDefaultHandler::startElement ( const QString namespaceURI,
const QString localName,
const QString qName,
const QXmlAttributes atts 
) [virtual]

The reader calls this function when it has parsed a start element tag.

There is a corresponding endElement() call when the corresponding end element tag is read. The startElement() and endElement() calls are always nested correctly. Empty element tags (e.g. {<x>}) cause a startElement() call to be immediately followed by an endElement() call.

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.

The argument namespaceURI is the namespace URI, or QString::null if the element has no namespace URI or if no namespace processing is done. localName is the local name (without prefix), or QString::null if no namespace processing is done, qName is the qualified name (with prefix) and atts are the attributes attached to the element. If there are no attributes, atts is an empty attributes object.

If this function returns FALSE the reader stops parsing and reports an error. The reader uses the function errorString() to get the error message.

See also the namespace description.

Ver también:
endElement()

Implementa QXmlContentHandler.

Reimplementado en TsHandler, QDomHandler, QphHandler, UiHandler y TsHandler.

bool QXmlDefaultHandler::startElement ( const QString namespaceURI,
const QString localName,
const QString qName,
const QXmlAttributes atts 
) [virtual]

Does nothing.

Implementa QXmlContentHandler.

Reimplementado en TsHandler, QDomHandler, QphHandler, UiHandler y TsHandler.

bool QXmlDefaultHandler::startEntity ( const QString name) [virtual]

The reader calls this function to report the start of an entity called name.

Note that if the entity is unknown, the reader reports it through QXmlContentHandler::skippedEntity() and not through this function.

If this function returns FALSE the reader stops parsing and reports an error. The reader uses the function errorString() to get the error message.

Ver también:
endEntity() QXmlSimpleReader::setFeature()

Implementa QXmlLexicalHandler.

Reimplementado en QDomHandler.

bool QXmlDefaultHandler::startEntity ( const QString name) [virtual]

Does nothing.

Implementa QXmlLexicalHandler.

Reimplementado en QDomHandler.

bool QXmlDefaultHandler::startPrefixMapping ( const QString prefix,
const QString uri 
) [virtual]

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.

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.

The argument prefix is the namespace prefix being declared and the argument uri is the namespace URI the prefix is mapped to.

If this function returns FALSE the reader stops parsing and reports an error. The reader uses the function errorString() to get the error message.

See also the namespace description.

Ver también:
endPrefixMapping()

Implementa QXmlContentHandler.

bool QXmlDefaultHandler::startPrefixMapping ( const QString prefix,
const QString uri 
) [virtual]

Does nothing.

Implementa QXmlContentHandler.

bool QXmlDefaultHandler::unparsedEntityDecl ( const QString name,
const QString publicId,
const QString systemId,
const QString notationName 
) [virtual]

Does nothing.

Implementa QXmlDTDHandler.

Reimplementado en QDomHandler.

bool QXmlDefaultHandler::unparsedEntityDecl ( const QString name,
const QString publicId,
const QString systemId,
const QString notationName 
) [virtual]

The reader calls this function when it finds an unparsed entity declaration.

The argument name is the unparsed entity's name, publicId is the entity's public identifier, systemId is the entity's system identifier and notationName is the name of the associated notation.

If this function returns FALSE the reader stops parsing and reports an error. The reader uses the function errorString() to get the error message.

Implementa QXmlDTDHandler.

Reimplementado en QDomHandler.

bool QXmlDefaultHandler::warning ( const QXmlParseException exception) [virtual]

Does nothing.

Implementa QXmlErrorHandler.

bool QXmlDefaultHandler::warning ( const QXmlParseException exception) [virtual]

A reader might use this function to report a warning. Warnings are conditions that are not errors or fatal errors as defined by the XML 1.0 specification. Details of the warning are stored in exception.

If this function returns FALSE the reader stops parsing and reports an error. The reader uses the function errorString() to get the error message.

Implementa QXmlErrorHandler.


La documentación para esta clase fue generada a partir de los siguientes ficheros:
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'