Re: [xsl] Question about variable definition and types

Subject: Re: [xsl] Question about variable definition and types
From: Colin Paul Adams <colin@xxxxxxxxxxxxxxxxxx>
Date: Thu, 06 Mar 2008 22:24:27 +0000
>>>>> "Jim" == Jim Garrison <Jim.Garrison@xxxxxxxxx> writes:

    Jim> Given <xsl:variable name="itSystems" as="element()*">
    Jim> <xsl:for-each select="//system"> <itSystem
    Jim> name="{nameOfSystem}"/> </xsl:for-each> <xsl:for-each
    Jim> select="//replacedLegacySystem"> <itSystem
    Jim> name="{nameOfLegacySystem}"/> </xsl:for-each> </xsl:variable>

    Jim> The type of $itSystems is such that the following Xpath
    Jim> expression works:

    Jim> 	$itSystems[@name='whatever...']

    Jim> However if I remove the as="element()*" attribute then the
    Jim> expression has to be written as:

    Jim> 	$itSystems/itSystem[@name='whatever...']

    Jim> What is the formal type of object returned in each case?  In
    Jim> the first I believe it is a sequence of element nodes, but in
    Jim> the second there seems to be an additional level of
    Jim> hierarchy.

There is - a document node.
-- 
Colin Adams
Preston Lancashire

Current Thread