<commit_before><?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="../xsltforms/xsltforms.xsl" type="text/xsl"?>
<?css-conversion no?>
<?oxygen NVDLSchema="../../../../../Development/Oxygen/samples/nvdl/xhtml-xforms.nvdl"?>
<!-- $Id$ -->
<book xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:xf="http://www.w3.org/2002/xforms">
    <bookinfo>
        <graphic fileref="../../logo.jpg"/>
        <productname>Open Source Native XML Database</productname>
        <title>eXist - Task Manager XForms Demo</title>
        <author>
            <firstname><NAME>.</firstname>
            <surname>Meier</surname>
        </author>
        <link type="text/css" href="todo.css" rel="stylesheet"/>
        <xf:model>
            <!-- the main instance containing the list of tasks -->
            <xf:instance id="todo" src="todo.xql"/>
            <!-- the edit instance serves as a temporary buffer. Before
                 editing a task, we copy it here -->
            <xf:instance id="edit">
                <edit xmlns="">
                    <todo/>
                </edit>
            </xf:instance>
            <!-- template with default settings for creating new tasks -->
            <xf:instance id="new">
                <edit xmlns="">
                    <todo id="">
                        <name/>
                        <project>default</project>
                        <priority>0</priority>
                        <progress>0</progress>
                        <description/>
                    </todo>
                </edit>
            </xf:instance>
            <!-- session instance is used to keep internal properties
                 of the app -->
            <xf:instance id="session" xmlns="">
                <session new-todo="false">
                    <action name="" uuid=""/>
                </session>
            </xf:instance>
            <!-- list of projects -->
	    <xf:instance id="projects" xmlns="">
		    <projects>
			    <project>Default</project>
			</projects>
		</xf:instance>
	    
	    <xf:instance id="loadProjects" src="../../rest/db/todo?_query=/projects&amp;_wrap=no"/>
            <!-- priorities -->
            <xf:instance id="priorities">
                <priorities xmlns="">
                    <priority prio="2">Urgent</priority>
                    <priority prio="1">High</priority>
                    <priority prio="0">Medium</priority>
                    <priority prio="-1">Low</priority>
                    <priority prio="-2">Very Low</priority>
                </priorities>
            </xf:instance>

            <xf:instance id="completeness">
                <percent xmlns="">
                    <value>0</value>
                    <value>10</value>
                    <value>20</value>
                    <value>30</value>
                    <value>40</value>
                    <value>50</value>
                    <value>60</value>
                    <value>70</value>
                    <value>80</value>
                    <value>90</value>
                    <value>100</value>
                </percent>
            </xf:instance>

            <!-- bind to the currently edited task -->
            <xf:bind id="bind-current-todo" nodeset="instance('edit')//todo[last()]">
                <xf:bind id="bind-title" nodeset="name" required="true()"/>
            </xf:bind>

            <!-- The confirm dialog becomes visible when the action instance changes
                 to 'delete' -->
            <xf:bind id="confirm-delete" nodeset="instance('session')/action/@name"
                relevant="instance('session')/action/@name = 'delete'"/>

            <!-- Submit the currently edited task -->
            <xf:submission id="s1" instance="edit" ref="instance('edit')//todo[last()]"
                method="post" action="todo.xql" replace="instance"/>

            <!-- Submit the project list  -->
            <xf:submission id="sprojects" method="put" ref="instance('projects')"
                action="../../rest/db/todo/todo-projects.xml" replace="none"/>
            <!-- Submit an action, e.g. to delete a task -->
            <xf:submission id="saction" ref="instance('session')//action" method="post"
                action="todo.xql" replace="none"/>
            
            <!-- Initialize the database collection when the XForms has loaded by
                submitting action 'init' to 'todo.xql' -->
            <xf:action ev:event="xforms-ready">
                <xf:setvalue ref="instance('session')/action/@name"
                value="'init'"/>
                <xf:send submission="saction"/>
		<xf:insert nodeset="instance('projects')/*" origin="instance('loadProjects')/*"/>
		<xf:delete nodeset="instance('projects')/project[1]"/>
            </xf:action>
        </xf:model>
    </bookinfo>
    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="sidebar.xml"/>
    <chapter><commit_msg>Update based on XSLTForms revision 360<commit_after><?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="../xsltforms/xsltforms.xsl" type="text/xsl"?>
<?css-conversion no?>
<?oxygen NVDLSchema="../../../../../Development/Oxygen/samples/nvdl/xhtml-xforms.nvdl"?>
<!-- $Id$ -->
<book xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:xf="http://www.w3.org/2002/xforms">
    <bookinfo>
        <graphic fileref="../../logo.jpg"/>
        <productname>Open Source Native XML Database</productname>
        <title>eXist - Task Manager XForms Demo</title>
        <author>
            <firstname><NAME>.</firstname>
            <surname>Meier</surname>
        </author>
        <link type="text/css" href="todo.css" rel="stylesheet"/>
        <xf:model>
            <!-- the main instance containing the list of tasks -->
            <xf:instance id="todo" src="todo.xql"/>
            <!-- the edit instance serves as a temporary buffer. Before
                 editing a task, we copy it here -->
            <xf:instance id="edit">
                <edit xmlns="">
                    <todo/>
                </edit>
            </xf:instance>
            <!-- template with default settings for creating new tasks -->
            <xf:instance id="new">
                <edit xmlns="">
                    <todo id="">
                        <name/>
                        <project>default</project>
                        <priority>0</priority>
                        <progress>0</progress>
                        <description/>
                    </todo>
                </edit>
            </xf:instance>
            <!-- session instance is used to keep internal properties
                 of the app -->
            <xf:instance id="session" xmlns="">
                <session new-todo="false">
                    <action name="" uuid=""/>
                </session>
            </xf:instance>
            <!-- list of projects -->
	    <xf:instance id="projects" xmlns="">
		    <projects>
			    <project>Default</project>
			</projects>
		</xf:instance>
	    
	    <xf:instance id="loadProjects" src="../../rest/db/todo?_query=/projects&amp;_wrap=no"/>
            <!-- priorities -->
            <xf:instance id="priorities">
                <priorities xmlns="">
                    <priority prio="2">Urgent</priority>
                    <priority prio="1">High</priority>
                    <priority prio="0">Medium</priority>
                    <priority prio="-1">Low</priority>
                    <priority prio="-2">Very Low</priority>
                </priorities>
            </xf:instance>

            <xf:instance id="completeness">
                <percent xmlns="">
                    <value>0</value>
                    <value>10</value>
                    <value>20</value>
                    <value>30</value>
                    <value>40</value>
                    <value>50</value>
                    <value>60</value>
                    <value>70</value>
                    <value>80</value>
                    <value>90</value>
                    <value>100</value>
                </percent>
            </xf:instance>

            <!-- bind to the currently edited task -->
            <xf:bind id="bind-current-todo" nodeset="instance('edit')//todo[last()]">
                <xf:bind id="bind-title" nodeset="name" required="true()"/>
            </xf:bind>

            <!-- The confirm dialog becomes visible when the action instance changes
                 to 'delete' -->
            <xf:bind id="confirm-delete" nodeset="instance('session')/action/@name"
                relevant="instance('session')/action/@name = 'delete'"/>

            <!-- Submit the currently edited task -->
            <xf:submission id="s1" instance="edit" ref="instance('edit')//todo[last()]"
                method="post" action="todo.xql" replace="instance"/>

            <!-- Submit the project list  -->
            <xf:submission id="sprojects" method="put" ref="instance('projects')"
                action="../../rest/db/todo/todo-projects.xml" replace="none"/>
            <!-- Submit an action, e.g. to delete a task -->
            <xf:submission id="saction" ref="instance('session')//action" method="post"
                action="todo.xql" replace="none"/>
            
            <!-- Initialize the database collection when the XForms has loaded by
                submitting action 'init' to 'todo.xql' -->
            <xf:action ev:event="xforms-ready">
                <xf:setvalue ref="instance('session')/action/@name"
                value="'init'"/>
                <xf:send submission="saction"/>
		<xf:insert nodeset="instance('projects')/*" origin="instance('loadProjects')/projects/*"/>
		<xf:delete nodeset="instance('projects')/project[1]"/>
            </xf:action>
        </xf:model>
    </bookinfo>
    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="sidebar.xml"/>
    <chapter>
{'fraction_non_alphanumeric': 0.16476818545163868, 'fraction_numerical': 0.011091127098321343, 'mean_word_length': 1.5856367863601137, 'pattern_counts': {'":': 0, '<': 247, '<?xml version=': 2, '>': 247, 'https://': 0, 'lorem ipsum': 0, 'www.': 8, 'xml': 30}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6324664', 'n_tokens_mistral': 2851, 'n_tokens_neox': 2588, 'n_words': 530}