Was this page helpful?

Web.Xml

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

    Convert source to HTML by optionally fetching and parsing it.

    Usage Restrictions

    1.9.1 or later

    Parameters

    Name Type Description
    source str XML source text or source uri
    xpath str (optional, default:none) XML source text or source uri
    namespaces map (optional, default:none) namespaces
    ttl num (optional, range: 60 - 86400, default: 300) Caching durations in seconds (8.08 or later)

    Result

    The result of web.xml depends on the combination of arguments provided.  If source is not a URI and xpath is omitted, web.xml parses the source argument as an XML document.  If source is not a URI and xpath is provided, then web.xml parses the source argument as an XML document and then applies the xpath expression (see xpath note below). If source is a URI and xpath is omitted, then web.xml fetches the data from the URI and parses it as an XML document.  If source is a URI and xpath is provided, then web.xml fetches the data from the URI and applies the xpath expression.

    When applying the xpath expression, web.xml returns only the XML node matched by the xpath expression.

    NOTE: all web.* functions are limited to reading at most 500KB of data from a URI.

    Samples

        Output

    to turn text into xml:

    {{web.xml("<ul><li>one</li><li>two</li></ul>")  }}  

       

    • one
    • two

       

    Was this page helpful?
    Tag page
    You must login to post a comment.

    Copyright © 2011 MindTouch, Inc. Powered by