Scilab Home page | Wiki | Bug tracker | Forge | Mailing list archives | ATOMS | File exchange
Please login or create an account
Change language to: Français - Português - Русский - 日本語
Scilab Help >> Preferences > getPreferencesValue

getPreferencesValue

Get preferences value

Syntax

getPreferencesValue(xpath, attributes [, doc])

Arguments

xpath

a string, represents the XPath request to get the node in the preferences file.

attributes

a matrix of strings, the attributes names.

doc

a mlist typed XMLDoc, the XML document associated to the preference file.

Description

Get the values of the attributes in preferences file (SCIHOME+'/XConfiguration.xml').

When doc is specified, the values are searched in this document. It is useful when several requests need to be done to avoid to parse again and again the same configuration file.

All valid XPath requests are possible. For example to write the XPath request to get proxy settings:

  • Open the file SCIHOME+'/XConfiguration.xml' and gets the nodes names to access to the expected node:

    <?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>

    The path will be "/interface/web/body/proxy" (or to simplify "//web/body/proxy").

Examples

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

See Also

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:27:55 CEST 2016