QXmlParseException Class
QXmlParseException クラスは、QXmlErrorHandler インターフェースに関するエラーを報告するために使用されます。詳細...
| ヘッダー: | #include <QXmlParseException> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Core5Compat) target_link_libraries(mytarget PRIVATE Qt6::Core5Compat) |
| qmake: | QT += core5compat |
注:このクラスのすべての関数は再入可能である。
パブリック関数
| QXmlParseException(const QString &name = QString(), int c = -1, int l = -1, const QString &p = QString(), const QString &s = QString()) | |
| QXmlParseException(const QXmlParseException &other) | |
| ~QXmlParseException() | |
| int | columnNumber() const |
| int | lineNumber() const |
| QString | message() const |
| QString | publicId() const |
| QString | systemId() const |
詳細な説明
XMLサブシステムは、エラーを検出した際にこのクラスのインスタンスを構築します。systemId()、publicId()、lineNumber()、columnNumber() を使用することで、エラーが発生した箇所を取得できます。また、message() を使用してエラー情報を取得することもできます。表示される可能性のあるエラーメッセージは以下の通りです:
- 「エラーは発生しませんでした」
- 「コンシューマーによってエラーが発生しました」
- 「予期しないファイルの終了」
- 「ドキュメント型定義が複数存在します」
- 「要素の解析中にエラーが発生しました」
- 「タグの不一致」
- 「コンテンツの解析中にエラーが発生しました」
- 「予期しない文字」
- 「処理命令の名前が無効です」
- 「XML宣言の読み取り中にバージョン情報が期待されました」
- 「スタンドアロン宣言の値が不正です」
- 「XML宣言の読み取り中に、エンコーディング宣言またはスタンドアロン宣言が期待されました」
- 「XML宣言の読み取り中にスタンドアロン宣言が期待されました」
- 「ドキュメント型定義の解析中にエラーが発生しました」
- 「文字が期待されます」
- 「コメントの解析中にエラーが発生しました」
- 「参照の解析中にエラーが発生しました」
- 「DTD内では内部一般エンティティ参照は許可されていません」
- 「属性値内で、外部解析済み一般エンティティ参照は許可されていません」
- 「DTD 内で、解析済みの外部一般エンティティ参照は許可されていません」
- 「文脈に合わない未解析のエンティティ参照 n」
- 「再帰的エンティティ」
- 「外部エンティティのテキスト宣言にエラーがあります」
なお、これらのエラーメッセージをアプリケーションのユーザーに表示したい場合、明示的に翻訳されていない限り、英語で表示されることに注意してください。
QXmlErrorHandler およびQXmlReaderも参照してください 。
メンバー関数のドキュメント
[explicit] QXmlParseException::QXmlParseException(const QString &name = QString(), int c = -1, int l = -1, const QString &p = QString(), const QString &s = QString())
パブリック識別子 `p ` およびシステム識別子 `s` について、列 `c ` の行 `l ` において、エラー文字列 `name ` を含むパース例外を生成します。
QXmlParseException::QXmlParseException(const QXmlParseException &other)
other のコピーを作成します。
[noexcept] QXmlParseException::~QXmlParseException()
QXmlParseException を削除します。
int QXmlParseException::columnNumber() const
エラーが発生した列番号を返します。
int QXmlParseException::lineNumber() const
エラーが発生した行番号を返します。
QString QXmlParseException::message() const
エラーメッセージを返します。
QString QXmlParseException::publicId() const
エラーが発生したパブリック識別子を返します。
QString QXmlParseException::systemId() const
エラーが発生したシステムの識別子を返します。
© 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.