xsl-list
[Top] [All Lists]

Re: [xsl] Question about variable definition and types

2008-03-06 15:25:06
"Jim" == Jim Garrison <Jim(_dot_)Garrison(_at_)troux(_dot_)com> 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[(_at_)name='whatever...']

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

    Jim>        $itSystems/itSystem[(_at_)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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--