Using explicit default namespace in XPath query

To make life easier when doing XPath queries (XPath being oblivious of the concept of default namespaces), Smartsite will make these namespaces available under the prefixes 'defaultns', 'defaultns2', etc...

In this example, the default namespace is explicitly set and the assigned prefix is used in an XPath query.

Smartsite SXML CopyCode image Copy Code
<se:xmlprocessor>
    <se:parameters>    
        <se:parameter name="xml">
            <input />
        </se:parameter>
        <se:parameter name="namespaces">
            <se:collection>
                <se:member prefix="">http://www.w3.org/1999/xhtml</se:member>
            </se:collection>
        </se:parameter>
        <se:parameter name="actions">
            <se:collection>
                <se:member query="/defaultns:input" >
                    {this.setattribute('name', 'test')}
                </se:member>
            </se:collection>
        </se:parameter>
    </se:parameters>
</se:xmlprocessor>
Example Result CopyCode image Copy Code
<input name="test" />