Removed Functions
-----------------
+* `getPreferencesValue` was obsolete and has been removed. Please use `xmlGetValues` instead.
* `hypermat` was obsolete and has been removed. Please use `matrix` instead.
* `square` was obsolete and has been removed.
* `xgetech` was obsolete and has been removed. Please use `gca` instead.
%_EVoid_p
-getPreferencesValue
setPreferencesValue
tbx_build_blocks
tbx_build_cleaner
<itemizedlist>
<listitem>
<para>
- The list of variables stored in a file can be retrieved with the
- <link linkend="listvarinfile">listvarinfile</link> function.
+ The list of variables stored in a file can be retrieved with the
+ <link linkend="listvarinfile">listvarinfile</link> function.
</para>
</listitem>
<listitem>
<para>
- <literal>load()</literal> loads restores variables in the current scope
- (not on the global one).
+ <literal>load()</literal> loads restores variables in the current scope
+ (not on the global one).
</para>
</listitem>
<listitem>
</para>
</listitem>
<listitem>
- If a restored variable has the same name as an existing variable of
- the current scope, the current variable is silently overwritten.
+ If a restored variable has the same name as an existing variable of
+ the current scope, the current variable is silently overwritten.
</listitem>
<listitem>
<para>
</para>
<para>
The library's name can be retrieved with
- <literal>getPreferencesValue("/scilablib", "name", "/path/to/lib")</literal>,
+ <literal>xmlGetValues("/scilablib", "name", "/path/to/lib")</literal>,
where "/path/to/lib" is replaced with the actual pathname of the lib file.
</para>
</refsect3>
save("TMPDIR/val.dat", "%e");
load("TMPDIR/val.dat");
]]></programlisting>
- <screen><![CDATA[
+ <screen><![CDATA[
--> load("TMPDIR/val.dat");
Redefining permanent variable.
]]></screen>
clf reset
load(TMPDIR+"/test.scg")
]]></programlisting>
- <screen><![CDATA[
+ <screen><![CDATA[
--> load("TMPDIR/val.dat");
Redefining permanent variable.
]]></screen>
<programlisting role="example"><![CDATA[
path = "SCI/modules/scicos_blocks/macros/Threshold/lib";
load(path)
-getPreferencesValue("/scilablib", "name", path)
+xmlGetValues("/scilablib", "name", path)
Thresholdlib
]]></programlisting>
- <screen><![CDATA[
---> getPreferencesValue("/scilablib", "name", path)
+ <screen><![CDATA[
+--> xmlGetValues("/scilablib", "name", path)
ans =
Thresholdlib
GENERAL_f ZCROSS_f NEGTOPOS_f POSTONEG_f
]]></screen>
</refsection>
- <para>
- <literal>xcos()</literal> must be used to load a simulation diagram:
- </para>
- <programlisting role="example"><![CDATA[
+ <para>
+ <literal>xcos()</literal> must be used to load a simulation diagram:
+ </para>
+ <programlisting role="example"><![CDATA[
path = "SCI/modules/xcos/examples/derivative.zcos";
load(path) // => error
xcos(path)
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2014 - Scilab Enterprises - Calixte DENIZET
- * Copyright (C) 2017 - Samuel GOUGEON
- *
- * Copyright (C) 2012 - 2016 - Scilab Enterprises
- *
- * This file is hereby licensed under the terms of the GNU GPL v2.0,
- * pursuant to article 5.3.4 of the CeCILL v.2.1.
- * This file was originally licensed under the terms of the CeCILL v2.1,
- * and continues to be available under such terms.
- * For more information, see the COPYING file which you should have received
- * along with this program.
- *
- -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml"
- xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
- xmlns:scilab="http://www.scilab.org" xml:id="getPreferencesValue" xml:lang="en">
- <refnamediv>
- <refname>getPreferencesValue</refname>
- <refpurpose>Parses and gets values of chosen tags attributes in a XML file of preferences
- <emphasis role="bold">(obsolete)</emphasis>
- </refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <title>Syntax</title>
- <synopsis>
- Values = getPreferencesValue(path2tag, attributes)
- Values = getPreferencesValue(path2tag, attributes, XMLsource)
- </synopsis>
- </refsynopsisdiv>
- <refsection>
- <title>Arguments</title>
- <variablelist>
- <varlistentry>
- <term>path2tag</term>
- <listitem>
- <para>
- 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 <literal>"/a/b/c/d"</literal>, or equivalently
- <literal>"//b/c/d"</literal>. It is case-sensitive.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>attributes</term>
- <listitem>
- <para>
- 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.
- <note>
- <itemizedlist>
- <listitem>
- Attributes names are case-sensitive.
- </listitem>
- <listitem>
- If needed, the name of a given attribute may be specified several times.
- </listitem>
- </itemizedlist>
- </note>
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>XMLsource</term>
- <listitem>
- <para>
- points to the XML document from which informations must be extracted. It
- can be one of the following:
- <itemizedlist>
- <listitem>
- unique string: path to the XML source file (where preferences are
- registered). By default,
- <literal>SCIHOME+'/XConfiguration.xml'</literal> is considered.
- </listitem>
- <listitem>
- XML handle of type <literal>XMLdoc</literal>, as returned by a
- prior <code>xmlRead(XMLsource)</code> external instruction.
- </listitem>
- </itemizedlist>
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>Values</term>
- <listitem>
- <para>
- matrix of strings: Values of the chosen attributes of the chosen tag:
- <itemizedlist>
- <listitem>
- If the set of chosen <varname>attributes</varname> is provided as a
- matrix with several rows, then only the first occurrence of the chosen
- tag is considered, and <varname>Values(i,j)</varname> is the value of
- its <varname>attributes(i,j)</varname>.
- </listitem>
- <listitem>
- Otherwise, if the names of <varname>attributes</varname> are
- provided in a row vector, then
- <emphasis role="italic">all occurences</emphasis> of the chosen tag
- are considered: Results are returned with one row per occurrence,
- and one colum per attribute. Thus, <varname>Values(i,j)</varname>
- is the value of the <varname>attributes(j)</varname> for the
- <literal>
- i<superscript>th</superscript>
- </literal>
- occurrence of the
- tag in the document.
- </listitem>
- </itemizedlist>
- If some final values are expected to be numeric rather than literal (text),
- <code>evstr()</code> may be applied to them to get expected numbers.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsection>
- <refsection>
- <title>Description</title>
- <warning>
- <literal>getPreferencesValue()</literal> is obsolete. It is cloned into
- <code>xmlGetValues()</code>. It will be removed from Scilab 6.1.x
- </warning>
- <para>
- When an XML handle returned by <code>xmlRead(..)</code> is provided as
- <varname>XMLsource</varname>, <function>getPreferencesValue()</function> uses it
- directly to parse the XML Preferences document opened by this prior
- <code>xmlRead(..)</code>. This is useful when the same document must be parsed with
- multiple calls to <function>getPreferencesValue()</function>, typically to address
- different XML tags. In this case, one should not forget to close the XML document after
- its whole processing.
- </para>
- <para>
- When the path of the XML Preferences file is provided as <varname>XMLsource</varname>,
- <function>getPreferencesValue()</function> opens the file, builds its DOM tree, parses
- the tree for the chosen tag and attributes, and finally deletes the tree and closes the
- file before returning results. This is what occurs with the default Xconfiguration.xml
- file when no explicit <varname>XMLsource</varname> is specified.
- </para>
- <para>
- The <varname>path2tag</varname> argument must be a valid "XPath" according to the
- <ulink url="https://www.w3.org/TR/1999/REC-xpath-19991116/">W3C recommendations</ulink>.
- Examples are given herebelow. If the path uses a intermediate or a final tag that does
- not exist, or if one of the queried attributes does not exist, an error is yielded.
- </para>
- </refsection>
- <refsection>
- <title>Examples</title>
- <emphasis role="bold">Example 1:</emphasis>
- <para>
- Your web and proxy settings for Scilab are stored in the default
- <literal>SCIHOME+'/XConfiguration.xml'</literal> preferences file. Let's consider the
- following excerpt of the file:
- <programlisting role="xml"><![CDATA[
- <?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>
- ]]></programlisting>
- </para>
- <para>
- To get some informations about the proxy parameters (proxy tag), the required code
- will be:
- <programlisting role="scilab"><![CDATA[
- proxy = getPreferencesValue("//web/body/proxy", ["enabled", "host", "port"]);
- ]]></programlisting>
- </para>
- <para>
- <emphasis role="bold">Example 2:</emphasis>
- </para>
- <para>
- <function>getPreferencesValue()</function> can also be used to get values of a tag
- having multiple occurrences in the <literal>XMLsource</literal> file. For instance,
- your preferences for the Scilab's editor Scinotes are stored in the
- <literal>SCIHOME\scinotesConfiguration.xml</literal> file. The list of most recent files
- opened in Scinotes is stored in the following part and path:
- <programlisting role="xml"><![CDATA[
-<?xml version="1.0" encoding="utf-8" standalone="no"?>
-<Setting version="0.42">
- <!-- SCINOTES configuration -->
- <Profile name="scinotes">
- <!-- .../... -->
- <!-- Recent Opened Files Section -->
- <recentFiles>
- <document path="C:\Path\to\my\first\working\dir\ged_move_entity.sci"/>
- <document path="C:\Path\to\my\first\working\dir\ged_loop.sci"/>
- <document path="C:\Path\to\my\first\working\dir\test_legend_move.sce"/>
- <document path="C:\Path\to\another\working\dir2\clf.sci"/>
- </recentFiles>
- <!-- .../... -->
- </Profile>
-</Setting>
- ]]></programlisting>
- </para>
- <para>
- Then, the following code will extract, return and display the column of recent files:
- <programlisting role="example"><![CDATA[
- scinotesFile = SCIHOME + "/scinotesConfiguration.xml";
- recent = getPreferencesValue("//Setting/Profile/recentFiles/document", "path", scinotesFile);
- mprintf("%s\n", recent)
- ]]></programlisting>
- <screen><![CDATA[
-C:\Path\to\my\first\working\dir\ged_move_entity.sci
-C:\Path\to\my\first\working\dir\ged_loop.sci
-C:\Path\to\my\first\working\dir\test_legend_move.sce
-C:\Path\to\another\working\dir2\clf.sci
-]]></screen>
- </para>
- </refsection>
- <refsection role="see also">
- <title>See also</title>
- <simplelist type="inline">
- <member>
- <link linkend="xmlGetValues">xmlGetValues</link>
- </member>
- <member>
- <link linkend="xmlSetValues">xmlSetValues</link>
- </member>
- <member>
- <link linkend="xmlXPath">xmlXPath</link>
- </member>
- <member>
- <ulink url="https://www.w3.org/TR/1999/REC-xpath-19991116/">XML path language</ulink>
- </member>
- <member>
- <link linkend="xmlRead">xmlRead</link>
- </member>
- <member>
- <link linkend="xmlDelete">xmlDelete</link>
- </member>
- <member>
- <link linkend="atomsGetConfig">atomsGetConfig</link>
- </member>
- <member>
- <link linkend="printsetupbox">printsetupbox</link>
- </member>
- <member>
- <link linkend="csvDefault">csvDefault</link>
- </member>
- </simplelist>
- </refsection>
- <refsection role="history">
- <title>History</title>
- <revhistory>
- <revision>
- <revnumber>5.5.0</revnumber>
- <revdescription>getPreferencesValue() introduced.
- </revdescription>
- </revision>
- <revision>
- <revnumber>6.0.0</revnumber>
- <revdescription>
- <itemizedlist>
- <listitem>
- XMLsource can now be the path + filename of the preferences file.
- </listitem>
- <listitem>
- A tag with multiple occurrences can now be read.
- </listitem>
- </itemizedlist>
- </revdescription>
- </revision>
- <revision>
- <revnumber>6.0.2</revnumber>
- <revdescription>getPreferencesValue() is cloned into xmlGetValues(). It is
- declared obsolete and will be removed from Scilab 6.1.x
- </revdescription>
- </revision>
- </revhistory>
- </refsection>
-</refentry>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2014 - Scilab Enterprises - Calixte DENIZET
- *
- * Copyright (C) 2012 - 2016 - Scilab Enterprises
- *
- * This file is hereby licensed under the terms of the GNU GPL v2.0,
- * pursuant to article 5.3.4 of the CeCILL v.2.1.
- * This file was originally licensed under the terms of the CeCILL v2.1,
- * and continues to be available under such terms.
- * For more information, see the COPYING file which you should have received
- * along with this program.
- *
- -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="getPreferencesValue" xml:lang="ja">
- <refnamediv>
- <refname>getPreferencesValue</refname>
- <refpurpose>設定値を取得 <emphasis role="bold">(非推奨)</emphasis></refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <title>呼び出し手順</title>
- <synopsis>
- getPreferencesValue(xpath, attributes [, doc])
- </synopsis>
- </refsynopsisdiv>
- <refsection>
- <title>引数</title>
- <variablelist>
- <varlistentry>
- <term>xpath</term>
- <listitem>
- <para>文字列,
- 設定ファイルのノードを取得する
- XPathリクエストを表す.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>attributes</term>
- <listitem>
- <para>文字列の行列, 属性名.</para>
- </listitem>
- </varlistentry>
- </variablelist>
- <variablelist>
- <varlistentry>
- <term>doc</term>
- <listitem>
- <para>XMLDoc型のmlist, 設定ファイルのXML文書.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsection>
- <refsection>
- <title>説明</title>
- <warning>
- <literal>getPreferencesValue()</literal> is obsolete. It is cloned into
- <code>xmlGetValues()</code>. It will be removed from Scilab 6.1.x
- </warning>
- <para>
- 設定ファイル(<literal>SCIHOME+'/XConfiguration.xml'</literal>)の
- 属性の値を取得します.
- </para>
- <para>
- docを指定した場合, 値はこの文書内で探されます.
- 複数のリクエストを実行する必要がある際,
- 同じ設定ファイルを重複してパースすることを避けるために
- 有用です.
- </para>
- <para>
- 有効な任意のXPathリクエストを指定できます.
- 例えば,proxy設定を取得するXPathリクエストは以下のように
- 記述できます:
- </para>
- <simplelist type="inline">
- <member>
- <para>
- ファイル<literal>SCIHOME+'/XConfiguration.xml'</literal>
- を開き,指定したノードにアクセスするためのノード名を
- 取得します:
- </para>
- <programlisting role="xml"><![CDATA[
-<?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>
- ]]></programlisting>
- <para>
- パスは<literal>"/interface/web/body/proxy"</literal>
- (または簡単化するために<literal>"//web/body/proxy"</literal>)
- となります.
- </para>
- </member>
- </simplelist>
- </refsection>
- <refsection>
- <title>例</title>
- <programlisting role="example"><![CDATA[
-getPreferencesValue("//web/body/proxy", ["enabled", "host", "port"]);
- ]]></programlisting>
- </refsection>
- <refsection role="see also">
- <title>参照</title>
- <simplelist type="inline">
- <member>
- <link linkend="xmlGetValues">xmlGetValues</link>
- </member>
- <member>
- <link linkend="xmlSetValues">xmlSetValues</link>
- </member>
- </simplelist>
- </refsection>
- <refsection role="history">
- <title>History</title>
- <revhistory>
- <revision>
- <revnumber>5.5.0</revnumber>
- <revdescription>getPreferencesValue() introduced.
- </revdescription>
- </revision>
- <revision>
- <revnumber>6.0.0</revnumber>
- <revdescription>
- <itemizedlist>
- <listitem>
- XMLsource can now be the path + filename of the preferences file.
- </listitem>
- <listitem>
- A tag with multiple occurrences can now be read.
- </listitem>
- </itemizedlist>
- </revdescription>
- </revision>
- <revision>
- <revnumber>6.0.2</revnumber>
- <revdescription>getPreferencesValue() is cloned into xmlGetValues(). It is
- declared obsolete and will be removed from Scilab 6.1.x
- </revdescription>
- </revision>
- </revhistory>
- </refsection>
-</refentry>
msgid "Save"
msgstr ""
-# File: modules/preferences/macros/getPreferencesValue.sci, line: 20
+#
# File: modules/preferences/macros/setPreferencesValue.sci, line: 24
#, c-format
msgid "%s: Wrong number of input arguments: %d or %d expected.\n"
msgstr ""
#
-# File: modules/preferences/macros/getPreferencesValue.sci, line: 25
# File: modules/preferences/macros/setPreferencesValue.sci, line: 28
#, c-format
msgid "%s: Wrong type for input argument #%d: String expected.\n"
msgstr ""
#
-# File: modules/preferences/macros/getPreferencesValue.sci, line: 30
# File: modules/preferences/macros/setPreferencesValue.sci, line: 32
#, c-format
msgid "%s: Wrong type for input argument #%d: Matrix of strings expected.\n"
msgstr ""
#
-# File: modules/preferences/macros/getPreferencesValue.sci, line: 44
-#, c-format
-msgid "%s: Invalid %s file.\n"
-msgstr ""
-
-#
-# File: modules/preferences/macros/getPreferencesValue.sci, line: 48
-#, c-format
-msgid "%s: The file %s does not exist.\n"
-msgstr ""
-
-#
-# File: modules/preferences/macros/getPreferencesValue.sci, line: 52
# File: modules/preferences/macros/setPreferencesValue.sci, line: 46
#, c-format
msgid "%s: Wrong type for input argument #%d: A XMLDoc expected.\n"
msgstr ""
#
-# File: modules/preferences/macros/getPreferencesValue.sci, line: 62
# File: modules/preferences/macros/setPreferencesValue.sci, line: 55
#, c-format
msgid "%s: Invalid XPath request.\n"
msgstr ""
#
-# File: modules/preferences/macros/getPreferencesValue.sci, line: 70
# File: modules/preferences/macros/setPreferencesValue.sci, line: 62
#, c-format
msgid "%s: Invalid XPath request."
msgstr ""
#
-# File: modules/preferences/macros/getPreferencesValue.sci, line: 81
# File: modules/preferences/macros/setPreferencesValue.sci, line: 70
#, c-format
msgid "%s: Target node is not a XML_ELEMENT_NODE."
msgstr ""
#
-# File: modules/preferences/macros/getPreferencesValue.sci, line: 95
# File: modules/preferences/macros/setPreferencesValue.sci, line: 82
#, c-format
msgid "%s: Invalid attribute name: %s."
+++ /dev/null
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2014 - Scilab Enterprises - Calixte DENIZET
-// Copyright (C) 2017 - Samuel GOUGEON
-//
-// Copyright (C) 2012 - 2016 - Scilab Enterprises
-//
-// This file is hereby licensed under the terms of the GNU GPL v2.0,
-// pursuant to article 5.3.4 of the CeCILL v.2.1.
-// This file was originally licensed under the terms of the CeCILL v2.1,
-// and continues to be available under such terms.
-// For more information, see the COPYING file which you should have received
-// along with this program.
-
-function values = getPreferencesValue(xpath, attributes, doc)
-
- warnobsolete("xmlGetValues", "6.1");
- rhs = argn(2);
-
- if (rhs ~= 2 & rhs ~= 3) then
- msg = _("%s: Wrong number of input arguments: %d or %d expected.\n")
- error(msprintf(msg, "getPreferencesValue", 2, 3));
- end
-
- if type(xpath) <> 10 then
- msg = _("%s: Wrong type for input argument #%d: String expected.\n")
- error(msprintf(msg, "getPreferencesValue", 1));
- end
-
- if type(attributes) <> 10 then
- msg = _("%s: Wrong type for input argument #%d: Matrix of strings expected.\n")
- error(msprintf(msg, "getPreferencesValue", 2));
- end
-
- if rhs == 2 then
- doc = SCIHOME + "/XConfiguration.xml"
- end
- doc0 = doc
- delDoc = (rhs == 2 | type(doc0)==10)
- if type(doc)==10 then
- if isfile(doc)
- try
- doc = xmlRead(doc0);
- catch
- msg = _("%s: Invalid ""%s"" file.\n")
- error(msprintf(msg, "getPreferencesValue", tokens(doc0,["/" "\"])($)));
- end
- else
- msg = _("%s: The file ""%s"" does not exist.\n")
- error(msprintf(msg, "getPreferencesValue", doc));
- end
- elseif typeof(doc) ~= "XMLDoc" then
- msg = _("%s: Wrong type for input argument #%d: A XMLDoc expected.\n")
- error(msprintf(msg, "getPreferencesValue", 3));
- end
-
- try
- xp = xmlXPath(doc, xpath);
- catch
- if delDoc then
- xmlDelete(doc);
- end
- msg = gettext("%s: Invalid XPath request.\n")
- error(msprintf(msg, "getPreferencesValue"));
- end
-
- if xp.size == 0 then
- if delDoc then
- xmlDelete(doc);
- end
- msg = gettext("%s: Invalid XPath request.")
- error(msprintf(msg, "getPreferencesValue"));
- end
-
- values = [];
- for i = 1 : xp.size
- node = xp(i);
- if node.type ~= "XML_ELEMENT_NODE" then
- if delDoc then
- xmlDelete(doc);
- end
- msg = gettext("%s: Target node is not a XML_ELEMENT_NODE.")
- error(msprintf(msg, "getPreferencesValue"));
- end
-
- attr = node.attributes;
- for j = 1:size(attributes,"*")
- a = attributes(j)
- v = attr(a);
- if v ~= [] then
- values(i,j) = v;
- else
- if delDoc then
- xmlDelete(doc);
- end
- msg = gettext("%s: Invalid attribute name: %s.")
- error(msprintf(msg, "getPreferencesValue", a));
- end
- end
- end
- if xp.size==1 then
- values = matrix(values, size(attributes));
- end
- if delDoc then
- xmlDelete(doc);
- end
-endfunction