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

xmlAsNumber

Convert the result of a XPath query into a row of numbers

Syntax

nums = xmlAsNumber(xp)

Arguments

xp

xp, a XML mlist typed XMLSet or XMLList

nums

nums, a single row of doubles

Description

The result of a XPath query or the children of a node can be a set of XMLElements which contains numbers, so the aim of this function is to convert the contents of each nodes into a double.

Examples

doc = xmlReadStr("<root><a>12</a><a>13</a><a>1.2345678</a><a>45e3</a><a>.23E-2</a></root>");

// Retrieve the content of the nodes with name equal to "a"
xp = xmlXPath(doc, "//a/text()");

// convert the result into doubles
data = xmlAsNumber(xp)

xmlDelete(doc);

See also

  • xmlXPath — Make a XPath query on a XML document
  • xmlAsText — Convert the result of a XPath query into a row of strings
  • xmlName — Retrieve the name of the elements.

History

ВерсияОписание
5.4.0 XML module introduced.
Scilab Enterprises
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Tue Feb 14 15:13:25 CET 2017