このページでは

QXmlDTDHandler Class

QXmlDTDHandler クラスは、XML データの DTD コンテンツを報告するためのインターフェースを提供します。詳細...

ヘッダー: #include <QXmlDTDHandler>
CMake: find_package(Qt6 REQUIRED COMPONENTS Core5Compat)
target_link_libraries(mytarget PRIVATE Qt6::Core5Compat)
qmake: QT += core5compat
継承元:

QXmlDefaultHandler

注:このクラスのすべての関数は再入可能である。

パブリック関数

virtual ~QXmlDTDHandler()
virtual QString errorString() const = 0
virtual bool notationDecl(const QString &name, const QString &publicId, const QString &systemId) = 0
virtual bool unparsedEntityDecl(const QString &name, const QString &publicId, const QString &systemId, const QString &notationName) = 0

詳細な説明

アプリケーションが表記や未解析エンティティに関する情報を必要とする場合、このインターフェースを実装し、QXmlReader::setDTDHandler() を使用してインスタンスを登録することができます。

このインターフェースには、XML 勧告でプロセッサに報告が義務付けられている DTD イベント、すなわち、notationDecl() およびunparsedEntityDecl() を使用してそれぞれ宣言される表記法および未解析エンティティのみが含まれていることに注意してください。

QXmlDeclHandler 、QXmlContentHandler 、QXmlEntityResolver 、QXmlErrorHandler 、およびQXmlLexicalHandlerも参照してください 。

メンバ関数のドキュメント

[virtual noexcept] QXmlDTDHandler::~QXmlDTDHandler()

DTDハンドラを破棄します。

[pure virtual] QString QXmlDTDHandler::errorString() const

ハンドラ関数のいずれかがfalse を返した場合、リーダーはこの関数を呼び出してエラー文字列を取得します。

[pure virtual] bool QXmlDTDHandler::notationDecl(const QString &name, const QString &publicId, const QString &systemId)

この関数は、表記宣言の解析が完了した際に、リーダーによって呼び出されます。

引数name は表記名、publicId は表記のパブリック識別子、systemId は表記のシステム識別子です。

この関数が `false ` を返した場合、リーダーは解析を中止し、エラーを報告します。リーダーは関数 `errorString()` を使用してエラーメッセージを取得します。

[pure virtual] bool QXmlDTDHandler::unparsedEntityDecl(const QString &name, const QString &publicId, const QString &systemId, const QString &notationName)

リーダーは、未解析のエンティティ宣言を検出すると、この関数を呼び出します。

引数name は未解析のエンティティの名前、publicId はエンティティのパブリック識別子、systemId はエンティティのシステム識別子、notationName は関連する表記法の名前です。

この関数が `false ` を返した場合、リーダーは解析を中止し、エラーを報告します。リーダーは関数 `errorString()` を使用してエラーメッセージを取得します。

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.