<!--
    Copyright (C) 2007 Orbeon, Inc.

    This program is free software; you can redistribute it and/or modify it under the terms of the
    GNU Lesser General Public License as published by the Free Software Foundation; either version
    2.1 of the License, or (at your option) any later version.

    This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
    without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    See the GNU Lesser General Public License for more details.

    The full text of the license is available at http://www.gnu.org/copyleft/lesser.html
-->
<xh:html xmlns:xf="http://www.w3.org/2002/xforms"
    xmlns:f="http://orbeon.org/oxf/xml/formatting"
    xmlns:xh="http://www.w3.org/1999/xhtml"
    xmlns:xxf="http://orbeon.org/oxf/xml/xforms"
    xmlns:widget="http://orbeon.org/oxf/xml/widget"
    xmlns:ev="http://www.w3.org/2001/xml-events"
    xmlns:xs="http://www.w3.org/2001/XMLSchema">

    <xh:head>
        <xh:title>Date Control</xh:title>
        <xf:model>
            <xf:instance id="instance">
                <instance>
                    <url/>
                    <a>value1</a>
                    <b>value2</b>
                </instance>
            </xf:instance>
        </xf:model>
    </xh:head>
    <xh:body>
        <xf:input ref="url">
            <xf:label>Enter value:</xf:label>
        </xf:input>
        <xh:br/>
        <xf:output value="encode-for-uri(url)">
            <xf:label>encode-for-uri()</xf:label>
        </xf:output>
        <xh:br/>
        <xf:output value="iri-to-uri(url)">
            <xf:label>iri-to-uri()</xf:label>
        </xf:output>
        <xh:br/>
        <xf:output value="escape-html-uri(url)">
            <xf:label>escape-html-uri()</xf:label>
        </xf:output>
        <xh:br/>

        <xf:trigger>
            <xf:label>Load</xf:label>
            <xf:load ev:event="DOMActivate" resource="http://www.google.com/{instance('instance')/a}"/>
        </xf:trigger>
        <xf:trigger>
            <xf:label>Load</xf:label>
            <xf:load ev:event="DOMActivate" resource="http://www.google.com/{instance('instance')/a}/something"/>
        </xf:trigger>
        <xf:trigger>
            <xf:label>Load</xf:label>
            <xf:load ev:event="DOMActivate" resource="http://www.google.com/{instance('instance')/a}/{{something}}"/>
        </xf:trigger>
        <xf:trigger>
            <xf:label>Load</xf:label>
            <xf:load ev:event="DOMActivate" resource="http://www.google.com/{instance('instance')/a}/{{something}}/else"/>
        </xf:trigger>
        <xf:trigger>
            <xf:label>Load</xf:label>
            <xf:load ev:event="DOMActivate" resource="http://www.google.com/{concat(string(instance('instance')/a), '{', '{{', string(instance('instance')/b), '}', '}}')}/{{something}}/else"/>
        </xf:trigger>
    </xh:body>
</xh:html>
