<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
-->
<p:config xmlns:p="http://www.orbeon.com/oxf/pipeline"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:oxf="http://www.orbeon.com/oxf/processors">

    <p:processor name="oxf:request">
        <p:input name="config">
            <config>
                <include>/request/parameters</include>
            </config>
        </p:input>
        <p:output name="data" id="request"/>
    </p:processor>

    <p:processor name="oxf:xslt">
        <p:input name="data" href="#request"/>
        <p:input name="config">
            <config xsl:version="2.0">
                <url><xsl:value-of select="/request/parameters/parameter[name = 'url']/value"/></url>
                <content-type>text/html</content-type>
                <header>
                    <name>User-Agent</name>
                    <value>Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4.1) Gecko/20031008</value>
                </header>
            </config>
        </p:input>
        <p:output name="data" id="url-generator"/>
    </p:processor>

    <p:processor name="oxf:url-generator">
        <p:input name="config" href="#url-generator"/>
        <p:output name="data" id="page"/>
    </p:processor>
    
    <p:processor name="oxf:xslt">
        <p:input name="data" href="#request#xpointer(/request/parameters/parameter[name = 'xquery']/value)"/>
        <p:input name="config">
            <xsl:stylesheet version="1.0" xmlns:saxon="http://saxon.sf.net/">
                <xsl:template match="/">
                    <xsl:copy-of select="saxon:parse(concat('&lt;xquery>', string(/), '&lt;/xquery>'))"/>
                </xsl:template>
            </xsl:stylesheet>
        </p:input>
        <p:output name="data" id="xquery"/>
    </p:processor>

    <p:processor name="oxf:xquery">
        <p:input name="config" href="#xquery" debug="xquery"/>
        <p:input name="data" href="#page"/>
        <p:output name="data" id="xquery-output" debug="xquery output"/>
    </p:processor>
    
    <p:choose href="#request">
        <p:when test="/request/parameters/parameter[name = 'output']/value = 'html'">
            <p:processor name="oxf:html-serializer">
                <p:input name="config"><config/></p:input>
                <p:input name="data" href="#xquery-output"/>
            </p:processor>
        </p:when>
        <p:when test="/request/parameters/parameter[name = 'output']/value = 'javascript'">
            <p:processor name="oxf:html-converter">
                <p:input name="config"><config/></p:input>
                <p:input name="data" href="#xquery-output"/>
                <p:output name="data" id="html"/>
            </p:processor>
            <p:processor name="oxf:xslt">
                <p:input name="data" href="#html" debug="html"/>
                <p:input name="config">
                    <text xsl:version="2.0">
                        <xsl:variable name="text" as="xs:string" select="replace(/*, '&quot;', '\\&quot;')"/>
                        <xsl:text>document.write(</xsl:text>
                        <xsl:for-each select="tokenize($text, '&#x0a;')">
                            <xsl:if test="position() > 1"> +&#x0a;</xsl:if>
                            <xsl:text>"</xsl:text>
                            <xsl:value-of select="."/>
                            <xsl:text>"</xsl:text>
                        </xsl:for-each>
                        <xsl:text>);</xsl:text>
                    </text>
                </p:input>
                <p:output name="data" id="javascript"/>
            </p:processor>
            <p:processor name="oxf:text-serializer">
                <p:input name="config"><config/></p:input>
                <p:input name="data" href="#javascript"/>
            </p:processor>
        </p:when>
        <p:otherwise>
            <p:processor name="oxf:xml-serializer">
                <p:input name="config"><config/></p:input>
                <p:input name="data" href="#xquery-output"/>
            </p:processor>
        </p:otherwise>
    </p:choose>
</p:config><commit_msg>Remove debug in XPL, send JavaScript as text/html<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
-->
<p:config xmlns:p="http://www.orbeon.com/oxf/pipeline"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:oxf="http://www.orbeon.com/oxf/processors">

    <p:processor name="oxf:request">
        <p:input name="config">
            <config>
                <include>/request/parameters</include>
            </config>
        </p:input>
        <p:output name="data" id="request"/>
    </p:processor>

    <p:processor name="oxf:xslt">
        <p:input name="data" href="#request"/>
        <p:input name="config">
            <config xsl:version="2.0">
                <url><xsl:value-of select="/request/parameters/parameter[name = 'url']/value"/></url>
                <content-type>text/html</content-type>
                <header>
                    <name>User-Agent</name>
                    <value>Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4.1) Gecko/20031008</value>
                </header>
            </config>
        </p:input>
        <p:output name="data" id="url-generator"/>
    </p:processor>

    <p:processor name="oxf:url-generator">
        <p:input name="config" href="#url-generator"/>
        <p:output name="data" id="page"/>
    </p:processor>
    
    <p:processor name="oxf:xslt">
        <p:input name="data" href="#request#xpointer(/request/parameters/parameter[name = 'xquery']/value)"/>
        <p:input name="config">
            <xsl:stylesheet version="1.0" xmlns:saxon="http://saxon.sf.net/">
                <xsl:template match="/">
                    <xsl:copy-of select="saxon:parse(concat('&lt;xquery>', string(/), '&lt;/xquery>'))"/>
                </xsl:template>
            </xsl:stylesheet>
        </p:input>
        <p:output name="data" id="xquery"/>
    </p:processor>

    <p:processor name="oxf:xquery">
        <p:input name="config" href="#xquery"/>
        <p:input name="data" href="#page"/>
        <p:output name="data" id="xquery-output"/>
    </p:processor>
    
    <p:choose href="#request">
        <p:when test="/request/parameters/parameter[name = 'output']/value = 'html'">
            <p:processor name="oxf:html-serializer">
                <p:input name="config"><config/></p:input>
                <p:input name="data" href="#xquery-output"/>
            </p:processor>
        </p:when>
        <p:when test="/request/parameters/parameter[name = 'output']/value = 'javascript'">
            <p:processor name="oxf:html-converter">
                <p:input name="config"><config/></p:input>
                <p:input name="data" href="#xquery-output"/>
                <p:output name="data" id="html"/>
            </p:processor>
            <p:processor name="oxf:xslt">
                <p:input name="data" href="#html"/>
                <p:input name="config">
                    <text xsl:version="2.0">
                        <xsl:variable name="text" as="xs:string" select="replace(/*, '&quot;', '\\&quot;')"/>
                        <xsl:text>document.write(</xsl:text>
                        <xsl:for-each select="tokenize($text, '&#x0a;')">
                            <xsl:if test="position() > 1"> +&#x0a;</xsl:if>
                            <xsl:text>"</xsl:text>
                            <xsl:value-of select="."/>
                            <xsl:text>"</xsl:text>
                        </xsl:for-each>
                        <xsl:text>);</xsl:text>
                    </text>
                </p:input>
                <p:output name="data" id="javascript"/>
            </p:processor>
            <p:processor name="oxf:text-serializer">
                <p:input name="config">
                    <config>
                        <content-type>text/plain</content-type>
                    </config>
                </p:input>
                <p:input name="data" href="#javascript"/>
            </p:processor>
        </p:when>
        <p:otherwise>
            <p:processor name="oxf:xml-serializer">
                <p:input name="config"><config/></p:input>
                <p:input name="data" href="#xquery-output"/>
            </p:processor>
        </p:otherwise>
    </p:choose>
</p:config>
{'fraction_non_alphanumeric': 0.1711301830214042, 'fraction_numerical': 0.008272153862061834, 'mean_word_length': 1.9550870760769936, 'pattern_counts': {'":': 0, '<': 218, '<?xml version=': 0, '>': 224, 'https://': 0, 'lorem ipsum': 0, 'www.': 10, 'xml': 12}, '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': '3869930', 'n_tokens_mistral': 3027, 'n_tokens_neox': 2844, 'n_words': 566}