XML CDATASection ノードの表現。
// Create and log an XML document that shows how special characters like '<', // '>', and '&' are stored in a CDATASection node as compared to in a Text node. const illegalCharacters = '<em>The Amazing Adventures of Kavalier & Clay</em>'; const cdata = XmlService.createCdata(illegalCharacters); const text = XmlService.createText(illegalCharacters); const root = XmlService.createElement('root').addContent(cdata).addContent(text); const document = XmlService.createDocument(root); const xml = XmlService.getPrettyFormat().format(document); Logger.log(xml);
メソッド
| メソッド | 戻り値の型 | 概要 |
|---|---|---|
append(text) | Text | 指定されたテキストを、ノードにすでに存在するコンテンツに追加します。 |
detach() | Content|null | ノードを親の Element ノードから切り離します。 |
get | Element|null | ノードの親の Element ノードを取得します。 |
get | String | Text ノードのテキスト値を取得します。 |
get | String | ドキュメントに表示される順に、ノードの直接の子または間接的な子であるすべてのノードのテキスト値を取得します。 |
set | Text | Text ノードのテキスト値を設定します。 |
詳細なドキュメント
append(text)
指定されたテキストを、ノードにすでに存在するコンテンツに追加します。
パラメータ
| 名前 | タイプ | 説明 |
|---|---|---|
text | String | ノードに追加するテキスト。 |
戻る
Text \- チェーン用の Text ノード。
getParentElement()
getText()
Text ノードのテキスト値を取得します。
戻る
String \- Text ノードのテキスト値。
getValue()
ドキュメントに表示される順に、ノードの直接の子または間接的な子であるすべてのノードのテキスト値を取得します。
戻る
String \- ノードの直接の子または間接的な子であるすべてのノードのテキスト値。