Scilab Home page | Wiki | Bug tracker | Forge | Mailing list archives | ATOMS | File exchange
Please login or create an account
Change language to: English - Français - Português - Русский -
Scilabヘルプ >> XML Management > xmlSetAttributes

xmlSetAttributes

属性の名前と値を設定する.

呼び出し手順

xmlObj = xmlSetAttributes(xmlObj, nameValue)

引数

xmlObj

xmlObj, XMLSet または XMLList または XMLElem または XMLAttr型 のXML mlist

nameValue

nameValue, [name value] または [prefix name value]を各行に含む 文字列の n x 2 または n x 3 行列

説明

要素または要素のリストの属性を設定します.

doc = xmlReadStr("<root><a><b><c></c></b></a><b></b></root>");
// 全てのノードを取得します
xp = xmlXPath(doc, "//*");
// 属性 hello="world" および bonjour="monde" を全ノードに追加します
xmlSetAttributes(xp, ["hello" "world" ; "bonjour" "monde"]);
xmlDump(doc)
// 属性 foo="bar" をルートの最初の子に追加します
xmlSetAttributes(doc.root.children(1), ["foo" "bar"]);
xmlDump(doc)
// 属性 bar="foo" をルートの全ての子に追加します
xmlSetAttributes(doc.root.children, ["bar" "foo"]);
// 属性 truc="machin" を2番目の子<b>の属性のリストに追加します 
xmlSetAttributes(doc.root.children(2).attributes, ["truc" "machin"]);
xmlDump(doc)
xmlDelete(doc);

参照

  • XMLObjects — 異なるのXMLオブジェクトのプロパティを記述する

履歴

バージョン記述
5.4.0 XMLモジュールが導入されました.
Scilab Enterprises
Copyright (c) 2011-2015 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Wed Jun 15 08:35:28 CEST 2016