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

<!--
// // See license.txt for license information. // // schema_xmlobjectlist.xsl // // 17-Nov-2005 phamilton Created //
-->

<xsl:stylesheet xmlns:lit="urn:xmlliterate.schema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:include href="common/get_node_jscript_path.xsl"/>
    <xsl:output method="text"/>
    <xsl:param name="prefix"/>
    <xsl:param name="schemaxml"/>
    <xsl:param name="outdir"/>
    <xsl:template name="newline">
        <xsl:text> </xsl:text>
    </xsl:template>
    <xsl:template name="object">
        <xsl:param name="object"/>
<!--
skip over the actual @xmlobj.
-->

        <xsl:if test="$object/@name != '@xmlobj'">
            <xsl:value-of select="$object/@name"/>
            <xsl:call-template name="newline"/>
        </xsl:if>
        <xsl:if test="count($object/lit:derived/*) > 0">
            <xsl:for-each select="$object/lit:derived/*">
                <xsl:call-template name="object">
                    <xsl:with-param name="object" select="."/>
                </xsl:call-template>
            </xsl:for-each>
        </xsl:if>
    </xsl:template>
    <xsl:template match="/">
        <xsl:if test="lit:object[@name='@root']/lit:derived/lit:object[@name='@xmlobj']">
            <xsl:call-template name="object">
                <xsl:with-param name="object" select="lit:object[@name='@root']/lit:derived/lit:object[@name='@xmlobj']"/>
            </xsl:call-template>
            <xsl:variable name="nodepath">
                <xsl:call-template name="get_node_jscript_path">
                    <xsl:with-param name="node" select="lit:object[@name='@root']/lit:derived/lit:object[@name='@xmlobj']"/>
                    <xsl:with-param name="nodename" select="lit:object[@name='@root']/lit:derived/lit:object[@name='@xmlobj']/@name"/>
                    <xsl:with-param name="path" select="''"/>
                    <xsl:with-param name="append" select="''"/>
                </xsl:call-template>
            </xsl:variable>
            <xsl:for-each select="lit:object/lit:fragment[starts-with(@location, $nodepath)]/*">
                <xsl:call-template name="object">
                    <xsl:with-param name="object" select="."/>
                </xsl:call-template>
            </xsl:for-each>
        </xsl:if>
    </xsl:template>
</xsl:stylesheet>