W3C home > Mailing lists > Public > public-qt-comments@w3.org > May 2004

RE: result-document from a temporary tree

From: Willink, Ed <Ed.Willink@thalesgroup.com>
Date: Tue, 11 May 2004 12:13:11 +0100
Message-ID: <51BF576D5A02CC4CB2591F50994FD766D2CA70@nts013.uk.trt.thales>
To: "'public-qt-comments@w3.org'" <public-qt-comments@w3.org>
Cc: "'ac@hyperbase.com'" <ac@hyperbase.com>, "'mhk@mhk.me.uk'" <mhk@mhk.me.uk>

Hi Andre, Michael

Apologies for joining in rather late, but I have exactly the
same problem in a different context, and agree with Andre's
critique of the prohibition on recursion. Perhaps my example may
tip the balance, since there is no parameterisation to confuse.

I am performing a chain of model transformations each encoded by
a template function, and returning its results to a variable
that then provides the input to the next transformation. So in a
C-like notation;

	model b = a2b(a);
	model c = b2c(b);
	model d = c2d(c);

Since my intervening models are complex, I wish to do validation
against my schemas, so I have a template function to validate

    <xsl:template name="validate">
        <xsl:param name="document" as="document-node()"/>
        <xsl:param name="document-name" as="xs:string"/>
        <xsl:param name="schema-name" as="xs:string"/>
        <xsl:result-document href="{$document-name}">
            <xsl:copy-of select="$document"/>
        <xsl:result-document href="check/{$document-name}">
            <xsl:call-template name="schema-check-summary">
                <xsl:with-param name="document" select="$document"/>
                <xsl:with-param name="document-name"
                <xsl:with-param name="flat-schema"
                <xsl:with-param name="schema-name" select="$schema-name"/>

'document' : the current model is output for debug to
and the results of the validation against "doc($schema-name)"
to href="check/{$document-name}".

I can readily use this at the top-level as:

        <xsl:variable name="library-doc" as="document-node()">
            <xsl:call-template name="create-library"/>
        <xsl:call-template name="validate">
            <xsl:with-param name="document" select="$library-doc"/>
            <xsl:with-param name="document-name"
            <xsl:with-param name="schema-name"
        <xsl:variable name="library" as="element()"
	  ... continuing to use "library"

but I am unable to incorporate the above into a hierarchical calling
since the call of validate is then within a temporary tree, and the converse
of requiring all nested hierarchical outputs to be exported to the top level
requires undue knowledge of the hierarchical structure at the top level.

		Ed Willink

E.D.Willink,                             Email: mailto:EdWillink@iee.org
Thales Research and Technology (UK) Ltd, Tel:  +44 118 923 8278 (direct)
Worton Drive,                            or  +44 118 986 8601 (ext 8278)
Worton Grange Business Park,             Fax:  +44 118 923 8399
Reading,   RG2 0SB
ENGLAND          http://www.computing.surrey.ac.uk/personal/pg/E.Willink
Received on Tuesday, 11 May 2004 07:26:33 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:56:57 UTC