QXmlLexicalHandler(3qt)

πŸ“¦ version 3.3.8b, in fedora 43, fedora 44

πŸ’– QXmlLexicalHandler β€” the 3qt manual, bestie edition πŸ’–

okay so this is QXmlLexicalHandler(3qt), and if you're here it's because you wanna know about the lexical tea in Qt's XML world. it's an interface. it reports the lexical content of XML data. that's the whole vibe. let's get into it πŸ¦‹


✨ NAME ✨

QXmlLexicalHandler β€” the interface that spills the lexical content of your XML data. periodt.


🌸 SYNOPSIS 🌸

reentrancy check! every single function in this class is reentrant when Qt is built with thread support. no cap.
#include <qxml.h>

Inherited by QXmlDefaultHandler.

πŸ‘‘ Public Members πŸ‘‘

all of these are pure virtual, so you gotta implement them yourself, bestie:

  • virtual bool startDTD ( const QString & name, const QString & publicId, const QString & systemId ) = 0
  • virtual bool endDTD () = 0
  • virtual bool startEntity ( const QString & name ) = 0
  • virtual bool endEntity ( const QString & name ) = 0
  • virtual bool startCDATA () = 0
  • virtual bool endCDATA () = 0
  • virtual bool comment ( const QString & ch ) = 0
  • virtual QString errorString () = 0

πŸŽ€ DESCRIPTION πŸŽ€

so QXmlLexicalHandler is the class that gives you an interface to report the lexical content of XML data. that's it. that's the job. πŸ’…

here's the thing you gotta know: the events in the lexical handler apply to the entire document, not just the document element. and every single lexical handler event shows up between the content handler's startDocument and endDocument events. so they're all nestled in there, cozy. 🫢

you can set the lexical handler with QXmlReader::setLexicalHandler(). slay.

this interface's design is based on the SAX2 extension LexicalHandler. iconic behavior honestly.

the interface provides the startDTD(), endDTD(), startEntity(), endEntity(), startCDATA(), endCDATA() and comment() functions. that's the whole squad. 🌈

See also the Introduction to SAX2.

See also QXmlDTDHandler, QXmlDeclHandler, QXmlContentHandler, QXmlEntityResolver, QXmlErrorHandler, and XML.


🧚 MEMBER FUNCTION DOCUMENTATION 🧚

πŸ’œ bool QXmlLexicalHandler::comment ( const QString & ch ) [pure 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. so like… don't return FALSE unless you mean it. 😭


πŸ’œ bool QXmlLexicalHandler::endCDATA () [pure 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.

See also startCDATA() and QXmlContentHandler::characters().


πŸ’œ bool QXmlLexicalHandler::endDTD () [pure virtual]

the reader calls this function to report the end of a DTD declaration, if any. (key phrase: if any. sometimes there just isn't one, and that's fine.)

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 startDTD().


πŸ’œ bool QXmlLexicalHandler::endEntity ( const QString & name ) [pure virtual]

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

for every startEntity() call, there's a corresponding endEntity() call. they're properly nested, like a good friendship. πŸ₯Ή

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 startEntity(), QXmlContentHandler::skippedEntity(), and QXmlSimpleReader::setFeature().


πŸ’œ QString QXmlLexicalHandler::errorString () [pure virtual]

the reader calls this function to get an error string if any of the handler functions returns FALSE. it's basically the "what went wrong bestie" hotline. ☎️


πŸ’œ bool QXmlLexicalHandler::startCDATA () [pure 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. it's not here to give you the content, it's here to tell you "hey, a boundary just happened". ✨

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 endCDATA().


πŸ’œ bool QXmlLexicalHandler::startDTD ( const QString & name, const QString & publicId, const QString & systemId ) [pure 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
  • 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.

⚠️ important warning ⚠️ it is not valid XML to have a public identifier but no system identifier. in such cases a parse error will occur. so like, don't do that. fr fr.

all declarations reported through QXmlDTDHandler or QXmlDeclHandler appear between the startDTD() and endDTD() calls. sandwiched. πŸ₯ͺ

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 endDTD().


πŸ’œ bool QXmlLexicalHandler::startEntity ( const QString & name ) [pure virtual]

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

heads up: if the entity is unknown, the reader reports it through QXmlContentHandler::skippedEntity() and not through this function. so don't come here looking for unknown entities, they're not invited to this party. πŸ™ˆ

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 endEntity() and QXmlSimpleReader::setFeature().


πŸ”₯ SEE ALSO πŸ”₯


Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the license file included in the distribution for a complete license statement.


⭐ AUTHOR ⭐

Generated automatically from the source code. (yes bestie, a robot wrote this. it ate and left no crumbs. πŸ€–πŸ’…)


πŸ’€ BUGS πŸ’€

if you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. good bug reports help us to help you. thank you. 🫢 (genuinely, they mean it)

the definitive Qt documentation is provided in HTML format; it's located at $QTDIR/doc/html and can be read using Qt 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. iykyk.

if you find errors in this manual page, please report them to qt-bugs@trolltech.com. please include the name of the manual page (qxmllexicalhandler.3qt) and the Qt version (3.3.8). don't forget those two things or they'll be like "which one?? 😭"


🌸 and that's the whole page, bestie! 🌸

this lil masterpiece came to you courtesy of Trolltech AS, dated 2 February 2007, and it lives under the name QXmlLexicalHandler(3qt) forever and ever. go forth and handle your lexical content. you got this. πŸ‘‘βœ¨πŸ¦‹

πŸ“¦ where this page comes from