<?xml version="1.0" encoding="UTF-8"?>

<?context-directive job ctxfile x-setups.ctx ?>

<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" file="lxml-ini.mkiv">

    <!-- the definitions themselves -->

    <cd:command name="xmlmain">
        <cd:arguments>
            <cd:resolve name="argument-name"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlflush">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmltext">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
            <cd:resolve name="argument-lpath"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlpure">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
            <cd:resolve name="argument-lpath"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlflushtext">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlflushpure">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlnonspace">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
            <cd:resolve name="argument-lpath"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlflushspacewise">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlflushlinewise">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlall">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
            <cd:resolve name="argument-lpath"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmllastmatch"/>

    <cd:command name="xmlfirst">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
            <cd:resolve name="argument-lpath"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmllast">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
            <cd:resolve name="argument-lpath"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlcontext">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
            <cd:resolve name="argument-lpath"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlflushcontext">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlshow">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlinfo">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlfilter">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
            <cd:resolve name="argument-lpath"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlstrip">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
            <cd:resolve name="argument-lpath"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlstripped">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
            <cd:resolve name="argument-lpath"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlstripnolines">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
            <cd:resolve name="argument-lpath"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlstrippednolines">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
            <cd:resolve name="argument-lpath"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlposition">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
            <cd:resolve name="argument-lpath"/>
            <cd:resolve name="argument-number"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlelement">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
            <cd:resolve name="argument-number"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlpos">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlsnippet">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
            <cd:resolve name="argument-number"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlconcat">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
            <cd:resolve name="argument-lpath"/>
            <cd:resolve name="argument-text"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlconcatrange">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
            <cd:resolve name="argument-lpath"/>
            <cd:resolve name="argument-text"/>
            <cd:resolve name="argument-first"/>
            <cd:resolve name="argument-last"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlcommand">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
            <cd:resolve name="argument-lpath"/>
            <cd:resolve name="argument-xmlsetup"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlinlineverbatim">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlinlineverbatim" type="environment">
        <cd:arguments>
            <cd:resolve name="keyword-name"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmldisplayverbatim">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmldisplayverbatim" type="environment">
        <cd:arguments>
            <cd:resolve name="keyword-name"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlverbatim">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlprettyprint">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
            <cd:resolve name="argument-name"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlloadfile">
        <cd:arguments>
            <cd:resolve name="argument-name"/>
            <cd:resolve name="argument-file"/>
            <cd:resolve name="argument-xmlsetup"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlloadbuffer">
        <cd:arguments>
            <cd:resolve name="argument-buffer"/>
            <cd:resolve name="argument-name"/>
            <cd:resolve name="argument-xmlsetup"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlloaddata">
        <cd:arguments>
            <cd:resolve name="argument-name"/>
            <cd:resolve name="argument-text"/>
            <cd:resolve name="argument-xmlsetup"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlloadonly">
        <cd:arguments>
            <cd:resolve name="argument-name"/>
            <cd:resolve name="argument-file"/>
            <cd:resolve name="argument-xmlsetup"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlprocessfile">
        <cd:arguments>
            <cd:resolve name="argument-name"/>
            <cd:resolve name="argument-file"/>
            <cd:resolve name="argument-xmlsetup"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlprocessbuffer">
        <cd:arguments>
            <cd:resolve name="argument-buffer"/>
            <cd:resolve name="argument-name"/>
            <cd:resolve name="argument-xmlsetup"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlprocessdata">
        <cd:arguments>
            <cd:resolve name="argument-name"/>
            <cd:resolve name="argument-text"/>
            <cd:resolve name="argument-xmlsetup"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlinclude">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
            <cd:resolve name="argument-lpath"/>
            <cd:resolve name="argument-name"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlname">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlpath">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlnamespace">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmltag">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlcount">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlatt">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
            <cd:resolve name="argument-name"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlattdef">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
            <cd:resolve name="argument-name"/>
            <cd:resolve name="argument-text"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlrefatt">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
            <cd:resolve name="argument-name"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmllastatt"/>

    <cd:command name="xmlattribute">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
            <cd:resolve name="argument-lpath"/>
            <cd:resolve name="argument-name"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlattributedef">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
            <cd:resolve name="argument-lpath"/>
            <cd:resolve name="argument-name"/>
            <cd:resolve name="argument-text"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlchainatt">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
            <cd:resolve name="argument-name"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlchainattdef">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
            <cd:resolve name="argument-name"/>
            <cd:resolve name="argument-text"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmldirectives">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmldirectivesbefore">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmldirectivesafter">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlinstalldirective">
        <cd:arguments>
            <cd:resolve name="argument-name"/>
            <cd:resolve name="argument-csname"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlsetup">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
            <cd:resolve name="argument-setup"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlsetsetup">
        <cd:arguments>
            <cd:resolve name="argument-name"/>
            <cd:resolve name="argument-lpath"/>
            <cd:resolve name="argument-setup"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlremovesetup">
        <cd:arguments>
            <cd:resolve name="argument-setup"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlremovedocumentsetup">
        <cd:arguments>
            <cd:resolve name="argument-name"/>
            <cd:resolve name="argument-setup"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlflushdocumentsetups">
        <cd:arguments>
            <cd:resolve name="argument-name"/>
            <cd:resolve name="argument-setup"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlresetsetups">
        <cd:arguments>
            <cd:resolve name="argument-name"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlresetdocumentsetups">
        <cd:arguments>
            <cd:resolve name="argument-name"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlprependsetup">
        <cd:arguments>
            <cd:resolve name="argument-setup"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlappendsetup">
        <cd:arguments>
            <cd:resolve name="argument-setup"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlbeforesetup">
        <cd:arguments>
            <cd:resolve name="argument-setup"/>
            <cd:resolve name="argument-setup"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlaftersetup">
        <cd:arguments>
            <cd:resolve name="argument-setup"/>
            <cd:resolve name="argument-setup"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlprependdocumentsetup">
        <cd:arguments>
            <cd:resolve name="argument-name"/>
            <cd:resolve name="argument-setup"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlappenddocumentsetup">
        <cd:arguments>
            <cd:resolve name="argument-name"/>
            <cd:resolve name="argument-setup"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlbeforedocumentsetup">
        <cd:arguments>
            <cd:resolve name="argument-name"/>
            <cd:resolve name="argument-setup"/>
            <cd:resolve name="argument-setup"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlafterdocumentsetup">
        <cd:arguments>
            <cd:resolve name="argument-name"/>
            <cd:resolve name="argument-setup"/>
            <cd:resolve name="argument-setup"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlregisteredsetups">
    </cd:command>

    <cd:command name="xmlregistereddocumentsetups">
        <cd:arguments>
            <cd:resolve name="argument-name"/>
            <cd:resolve name="argument-setup"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlsetfunction">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
            <cd:resolve name="argument-lpath"/>
            <cd:keywords delimiters="braces">
                <cd:constant type="cd:luafunction"/>
            </cd:keywords>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmldoif">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
            <cd:resolve name="argument-lpath"/>
            <cd:resolve name="argument-true"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmldoifnot">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
            <cd:resolve name="argument-lpath"/>
            <cd:resolve name="argument-true"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmldoifelse">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
            <cd:resolve name="argument-lpath"/>
            <cd:resolve name="argument-true"/>
            <cd:resolve name="argument-false"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmldoiftext">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
            <cd:resolve name="argument-lpath"/>
            <cd:resolve name="argument-true"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmldoifnottext">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
            <cd:resolve name="argument-lpath"/>
            <cd:resolve name="argument-true"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmldoifelsetext">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
            <cd:resolve name="argument-lpath"/>
            <cd:resolve name="argument-true"/>
            <cd:resolve name="argument-false"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmldoifselfempty">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
            <cd:resolve name="argument-true"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmldoifnotselfempty">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
            <cd:resolve name="argument-true"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmldoifelseselfempty">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
            <cd:resolve name="argument-true"/>
            <cd:resolve name="argument-false"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmldoifelseempty">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
            <cd:resolve name="argument-lpath"/>
            <cd:resolve name="argument-true"/>
            <cd:resolve name="argument-false"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlregisterns">
        <cd:arguments>
            <cd:resolve name="argument-name"/>
            <cd:keywords delimiters="braces">
                <cd:constant type="cd:url"/>
            </cd:keywords>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlregisterns">
        <cd:arguments>
            <cd:resolve name="argument-name"/>
            <cd:resolve name="argument-name"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlremapname">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
            <cd:resolve name="argument-lpath"/>
            <cd:resolve name="argument-name"/>
            <cd:resolve name="argument-name"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlremapnamespace">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
            <cd:resolve name="argument-name"/>
            <cd:resolve name="argument-name"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlchecknamespace">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
            <cd:resolve name="argument-name"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlmapvalue">
        <cd:arguments>
            <cd:resolve name="argument-category"/>
            <cd:resolve name="argument-name"/>
            <cd:resolve name="argument-text"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlvalue">
        <cd:arguments>
            <cd:resolve name="argument-category"/>
            <cd:resolve name="argument-name"/>
            <cd:resolve name="argument-text"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmldoifelsevalue">
        <cd:arguments>
            <cd:resolve name="argument-category"/>
            <cd:resolve name="argument-name"/>
            <cd:resolve name="argument-true"/>
            <cd:resolve name="argument-false"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlloaddirectives">
        <cd:arguments>
            <cd:resolve name="argument-file"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlsave">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
            <cd:resolve name="argument-file"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmltofile">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
            <cd:resolve name="argument-lpath"/>
            <cd:resolve name="argument-file"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmltobuffer">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
            <cd:resolve name="argument-lpath"/>
            <cd:resolve name="argument-buffer"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmltobufferverbose">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
            <cd:resolve name="argument-lpath"/>
            <cd:resolve name="argument-buffer"/>
        </cd:arguments>
    </cd:command>

    <!--

        <cd:command name="xmltoparameters">
            <cd:arguments>
            <cd:resolve name="argument-node"/>
            <cd:resolve name="argument-lpath"/>
                <cd:resolve name="argument-buffer"/>
            </cd:arguments>
        </cd:command>

    -->

    <cd:command name="xmladdindex">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlinclusion">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlinclusions">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlbadinclusions">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlraw">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlraw" type="environment"/>

    <!-- injectors -->

    <cd:command name="xmlresetinjectors"/>

    <cd:command name="xmlsetinjectors">
        <cd:arguments>
            <cd:resolve name="keyword-name-list"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlinjector">
        <cd:arguments>
            <cd:resolve name="argument-name"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmlapplyselectors">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
        </cd:arguments>
    </cd:command>

    <!-- entities -->

    <cd:command name="xmlsetentity">
        <cd:arguments>
            <cd:resolve name="argument-name"/>
            <cd:resolve name="argument-text"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmltexentity">
        <cd:arguments>
            <cd:resolve name="argument-name"/>
            <cd:resolve name="argument-text"/>
        </cd:arguments>
    </cd:command>

    <!-- general setup -->

    <cd:command name="setupxml">
        <cd:arguments>
            <cd:assignments list="yes">
                <cd:parameter name="default">
                    <cd:constant type="hidden"/>
                    <cd:constant type="none"/>
                    <cd:constant type="text"/>
                </cd:parameter>
                <cd:parameter name="compress">
                    <cd:constant type="yes"/>
                    <cd:constant type="no"/>
                </cd:parameter>
            </cd:assignments>
        </cd:arguments>
    </cd:command>

    <cd:command name="xmldefaulttotext">
        <cd:arguments>
            <cd:resolve name="argument-node"/>
        </cd:arguments>
    </cd:command>

</cd:interface>
