<commit_before><!--
    Copyright (C) 2004 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
-->
<xhtml:html xmlns:xforms="http://www.w3.org/2002/xforms"
        xmlns:f="http://orbeon.org/oxf/xml/formatting"
        xmlns:xhtml="http://www.w3.org/1999/xhtml"
        xmlns:ev="http://www.w3.org/2001/xml-events"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:env="http://www.w3.org/2003/05/soap-envelope"
        xmlns:orbeon="http://www.orbeon.com/">

    <xhtml:head>
        <xhtml:title>XML to URL</xhtml:title>
        <xforms:model>
            <xforms:instance id="xml" src="oxf:/examples/xml-to-url/sample.xml"/>
            <xforms:instance id="soap-request" src="oxf:/examples/xml-to-url/soap-request.xml"/>
            <xforms:instance id="soap-response" src="oxf:/examples/xml-to-url/soap-response.xml"/>
            <xforms:submission ref="instance('soap-request')" id="send-request"
                method="post" action="/direct/xml-to-url/url" replace="instance" instance="soap-response"/>
            <xforms:bind nodeset="instance('soap-request')/env:Body/orbeon:xml" calculate="instance('xml')"/>
            <xforms:bind nodeset="instance('soap-response')/env:Body/orbeon:urls/*" relevant=". != ''"/>
        </xforms:model>
    </xhtml:head>
    <xhtml:body>
        <xhtml:ul>
            <xhtml:li>
                Paste an XML document in the text field and click on the "Create URL" button to
                get a URL that will return the XML document you posted.
            </xhtml:li>
            <xhtml:li>
                This page is a front-end for a web service that you can also call directly programmatically.
                See the WSDL file: <xhtml:a f:url-type="resource" href="/direct/xml-to-url/url.wsdl">url.wsdl</xhtml:a>.
            </xhtml:li>
        </xhtml:ul>
        <xforms:group>
            <xhtml:p>
                <xforms:textarea ref="instance('xml')" class="wide-textarea">
                    <xforms:label>XML:</xforms:label>
                </xforms:textarea>
            </xhtml:p>
            <xhtml:p>
                <xforms:trigger>
                    <xforms:label>Create URL</xforms:label>
                    <xforms:action ev:event="DOMActivate">
                        <xforms:send submission="send-request"/>
                    </xforms:action>
                </xforms:trigger>
            </xhtml:p>
            <xhtml:p>
                <xforms:input ref="instance('soap-response')/env:Body/orbeon:urls/orbeon:tiny-url" style="width: 15em">
                    <xforms:label class="fixed-width">Tiny URL:</xforms:label>
                </xforms:input>
            </xhtml:p>
            <xhtml:p>
                <xforms:input ref="instance('soap-response')/env:Body/orbeon:urls/orbeon:original-url" style="width: 15em">
                    <xforms:label class="fixed-width">Direct URL:</xforms:label>
                </xforms:input>
            </xhtml:p>
            <xhtml:p style="color: red">
                <xforms:output ref="instance('soap-response')/env:Body/orbeon:urls/orbeon:error"/>
            </xhtml:p>
        </xforms:group>
    </xhtml:body>
</xhtml:html>
<commit_msg>Fix [ #304482 ] XML to URL throws exception<commit_after><!--
    Copyright (C) 2004 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
-->
<xhtml:html xmlns:xforms="http://www.w3.org/2002/xforms"
        xmlns:f="http://orbeon.org/oxf/xml/formatting"
        xmlns:xhtml="http://www.w3.org/1999/xhtml"
        xmlns:ev="http://www.w3.org/2001/xml-events"
        xmlns:xi="http://www.w3.org/2001/XInclude"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:env="http://www.w3.org/2003/05/soap-envelope"
        xmlns:orbeon="http://www.orbeon.com/">

    <xhtml:head>
        <xhtml:title>XML to URL</xhtml:title>
        <xforms:model>
            <xforms:instance id="xml">
                <xi:include href="oxf:/examples/xml-to-url/sample.xml"/>
            </xforms:instance>
            <xforms:instance id="soap-request">
                <xi:include href="oxf:/examples/xml-to-url/soap-request.xml"/>
            </xforms:instance>
            <xforms:instance id="soap-response">
                <xi:include href="oxf:/examples/xml-to-url/soap-response.xml"/>
            </xforms:instance>
            <xforms:submission ref="instance('soap-request')" id="send-request"
                method="post" action="/direct/xml-to-url/url" replace="instance" instance="soap-response"/>
            <xforms:bind nodeset="instance('soap-request')/env:Body/orbeon:xml" calculate="instance('xml')"/>
            <xforms:bind nodeset="instance('soap-response')/env:Body/orbeon:urls/*" relevant=". != ''"/>
        </xforms:model>
    </xhtml:head>
    <xhtml:body>
        <xhtml:ul>
            <xhtml:li>
                Paste an XML document in the text field and click on the "Create URL" button to
                get a URL that will return the XML document you posted.
            </xhtml:li>
            <xhtml:li>
                This page is a front-end for a web service that you can also call directly programmatically.
                See the WSDL file: <xhtml:a f:url-type="resource" href="/direct/xml-to-url/url.wsdl">url.wsdl</xhtml:a>.
            </xhtml:li>
        </xhtml:ul>
        <xforms:group>
            <xhtml:p>
                <xforms:textarea ref="instance('xml')" class="wide-textarea">
                    <xforms:label>XML:</xforms:label>
                </xforms:textarea>
            </xhtml:p>
            <xhtml:p>
                <xforms:trigger>
                    <xforms:label>Create URL</xforms:label>
                    <xforms:action ev:event="DOMActivate">
                        <xforms:send submission="send-request"/>
                    </xforms:action>
                </xforms:trigger>
            </xhtml:p>
            <xhtml:p>
                <xforms:input ref="instance('soap-response')/env:Body/orbeon:urls/orbeon:tiny-url" style="width: 15em">
                    <xforms:label class="fixed-width">Tiny URL:</xforms:label>
                </xforms:input>
            </xhtml:p>
            <xhtml:p>
                <xforms:input ref="instance('soap-response')/env:Body/orbeon:urls/orbeon:original-url" style="width: 15em">
                    <xforms:label class="fixed-width">Direct URL:</xforms:label>
                </xforms:input>
            </xhtml:p>
            <xhtml:p style="color: red">
                <xforms:output ref="instance('soap-response')/env:Body/orbeon:urls/orbeon:error"/>
            </xhtml:p>
        </xforms:group>
    </xhtml:body>
</xhtml:html>

{'fraction_non_alphanumeric': 0.14199589533093895, 'fraction_numerical': 0.01090302719343253, 'mean_word_length': 2.1630831643002026, 'pattern_counts': {'":': 0, '<': 123, '<?xml version=': 0, '>': 123, 'https://': 0, 'lorem ipsum': 0, 'www.': 15, 'xml': 43}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2266565', 'n_tokens_mistral': 2498, 'n_tokens_neox': 2308, 'n_words': 491}