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ヘルプ >> Preferences > getPreferencesValue

getPreferencesValue

設定値を取得

呼び出し手順

getPreferencesValue(xpath, attributes [, doc])

引数

xpath

文字列, 設定ファイルのノードを取得する XPathリクエストを表す.

attributes

文字列の行列, 属性名.

doc

XMLDoc型のmlist, 設定ファイルのXML文書.

説明

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

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

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

  • ファイルSCIHOME+'/XConfiguration.xml' を開き,指定したノードにアクセスするためのノード名を 取得します:

    <?xml version="1.0" encoding="utf-8" standalone="no"?>
    <interface height="600" path="1/" version="0.17" width="800">
        <general title="_(General)">
        ...
        </general>
        <web title="_(Web)">
            <body>
                <web command-browser="" command-mailer="" default-browser="true" default-mailer="true"/>
                <proxy enabled="false" host="" password="" port="" user=""/>
                <previous-proxy enabled="false" host="" password="" port="" user=""/>
            </body>
        </web>
        ...
    </interface>

    パスは"/interface/web/body/proxy" (または簡単化するために"//web/body/proxy") となります.

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

参照

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:45 CEST 2016