Scilab 6.0.1
- Aide de Scilab
- Traitement XML
- htmlDump
- htmlRead
- htmlReadStr
- htmlWrite
- xmlAddNs
- xmlAppend
- xmlAsNumber
- xmlAsText
- xmlDelete
- xmlDocument
- xmlDTD
- xmlDump
- xmlElement
- xmlFormat
- xmlGetNsByHref
- xmlGetNsByPrefix
- xmlGetOpenDocs
- xmlIsValidObject
- xmlName
- xmlNs
- XML Objects
- xmlRead
- xmlReadStr
- xmlRelaxNG
- xmlRemove
- xmlSchema
- xmlSetAttributes
- xmlValidate
- xmlWrite
- xmlXPath
Please note that the recommended version of Scilab is 2025.0.0. This page might be outdated.
See the recommended documentation of this function
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
History
Version | Description |
5.4.0 | XML module introduced. |
Report an issue | ||
<< xmlAppend | Traitement XML | xmlAsText >> |