<< frexp 6-0 hypermat >>
removed >> removed > 6-0 > getPreferencesValue

getPreferencesValue

設定値を取得 (非推奨)

呼び出し手順

Values = getPreferencesValue(path2tag, attributes)
Values = getPreferencesValue(path2tag, attributes, XMLsource)

引数

path2tag

unique string: in the XML source file, path targeting a chosen tag whose attributes must be read. The path is the list of nested tags leading to the required one, such as "/a/b/c/d", or equivalently "//b/c/d". It is case-sensitive.

attributes

vector or matrix of strings: names of attributes of the chosen tag, whose values must be read. The order of attributes does not matter wrt their actual order in the tag.
  • Attributes names are case-sensitive.
  • If needed, the name of a given attribute may be specified several times.

XMLsource

points to the XML document from which informations must be extracted. It can be one of the following:

  • unique string: path to the XML source file (where preferences are registered). By default, SCIHOME+'/XConfiguration.xml' is considered.
  • XML handle of type XMLdoc, as returned by a prior xmlRead(XMLsource) external instruction.

Values

matrix of strings: Values of the chosen attributes of the chosen tag:

  • If the set of chosen attributes is provided as a matrix with several rows, then only the first occurrence of the chosen tag is considered, and Values(i,j) is the value of its attributes(i,j).
  • Otherwise, if the names of attributes are provided in a row vector, then all occurences of the chosen tag are considered: Results are returned with one row per occurrence, and one colum per attribute. Thus, Values(i,j) is the value of the attributes(j) for the ith occurrence of the tag in the document.
If some final values are expected to be numeric rather than literal (text), evstr() may be applied to them to get expected numbers.

説明

設定ファイル(SCIHOME+'/XConfiguration.xml')の 属性の値を取得します.

docを指定した場合, 値はこの文書内で探されます. 複数のリクエストを実行する必要がある際, 同じ設定ファイルを重複してパースすることを避けるために 有用です.

有効な任意のXPathリクエストを指定できます. 例えば,proxy設定を取得するXPathリクエストは以下のように 記述できます:

getPreferencesValue("//web/body/proxy", ["enabled", "host", "port"]);

参照

History

VersionDescription
5.5.0 getPreferencesValue() introduced.
6.0.0
  • XMLsource can now be the path + filename of the preferences file.
  • A tag with multiple occurrences can now be read.
6.0.2 getPreferencesValue() is cloned into xmlGetValues(). It is declared obsolete.
6.1.0 getPreferencesValue() is no longer available.

<< frexp 6-0 hypermat >>