Was this page helpful?

Xml.Num

    Table of contents
    1. 1. Usage Restrictions
    2. 2. Parameters
    3. 3. Result
    4. 4. Samples
    Xml.Num(doc : xml, xpath : str?, namespaces : map?) : num

    Get a number from an XML document.

    Usage Restrictions

    9.02 or later.

    Parameters

    Name Type Description
    doc xml XML document
    xpath str? xpath to value (optional, default: ".")
    namespaces map namespaces (optional, default: nil)

    Result

    The numeric value represented by the XmlNode found at the specified (or default) xpath

    Samples

       Output

    Get the numeric value of a single node:

    {{xml.num(<x>42</x>)}}
     
    missing value for parameter 'doc' (index 0) (click for details)
    Retrieve a numeric attribute via xpath:
    xml.num(
      web.xml("<doc><x:y xmlns:x='urn:foo' num='42'/></doc>"),
      "x:y/@num",
       {"x": "urn:foo"}
    );
    42
    Was this page helpful?
    Tag page
    You must login to post a comment.

    Copyright © 2011 MindTouch, Inc. Powered by