QDomProcessingInstruction Class

QDomProcessingInstructionクラスは、XML処理命令を表します。詳細...

ヘッダー #include <QDomProcessingInstruction>
CMake: find_package(Qt6 REQUIRED COMPONENTS Xml)
target_link_libraries(mytarget PRIVATE Qt6::Xml)
qmake: QT += xml
継承: QDomNode

注意:このクラスの関数はすべてリエントラントです。

パブリック関数

QDomProcessingInstruction()
QDomProcessingInstruction(const QDomProcessingInstruction &processingInstruction)
QString data() const
QDomNode::NodeType nodeType() const
void setData(const QString &data)
QString target() const
QDomProcessingInstruction &operator=(const QDomProcessingInstruction &other)

詳細説明

処理命令は、XMLでプロセッサ固有の情報をドキュメントのテキストに保持するために使用されます。

XML文書の先頭に表示されるXML宣言(通常は<?xml version='1.0' encoding='UTF-8'?> )は、QDomでは処理命令として扱われる。XML宣言は処理命令ではないので、これは残念なことです。他の相違点として、XML宣言を文書の先頭行以外の場所に挿入することはできません。

XML宣言は処理命令と同じ構文を持っていますが、QDomでは処理命令として扱われない可能性があるため、この関数を使用してXML宣言を作成しないでください。

処理命令の内容は、data ()で取得し、setData ()で設定します。処理命令のターゲットはtarget() で取得します。

ドキュメント・オブジェクト・モデルの詳細については、レベル1とレベル2コアを参照してください。DOM実装のより一般的な紹介については、QDomDocument ドキュメントを参照してください。

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

QDomProcessingInstruction::QDomProcessingInstruction()

空の処理命令を構築する。内容のある処理命令を作成するには、QDomDocument::createProcessingInstruction() を使用します。

QDomProcessingInstruction::QDomProcessingInstruction(const QDomProcessingInstruction &processingInstruction)

processingInstruction のコピーを構築する。

コピーのデータは共有されます(シャローコピー):一方のノードを変更すると、もう一方のノードも変更されます。深いコピーを作成したい場合は、cloneNode() を使用します。

QString QDomProcessingInstruction::data() const

この処理命令の内容を返す。

setData() およびtarget()も参照

QDomNode::NodeType QDomProcessingInstruction::nodeType() const

ProcessingInstructionNode を返す。

void QDomProcessingInstruction::setData(const QString &data)

処理命令に含まれるデータをdata に設定する。

data()も参照のこと

QString QDomProcessingInstruction::target() const

この処理命令のターゲットを返す。

data()も参照

QDomProcessingInstruction &QDomProcessingInstruction::operator=(const QDomProcessingInstruction &other)

この処理命令にother を割り当てる。

コピーのデータは共有される(シャロー・コピー):一方のノードを変更すると、もう一方のノードも変更される。ディープ・コピーを作成したい場合は、cloneNode ()を使用する。

© 2025 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.