xsl-list
[Top] [All Lists]

[xsl] Assigning types to variables

2006-09-13 07:52:26
Hi all, if I have declared the following variable:

<xsl:variable name="test" as="element()">
       <one>
           <two>hello</two>
       </one>
</xsl:variable>

I don't understand why <xsl:sequence select="$test/two"/> retrieves the value of <two/> while <xsl:sequence select="$test/one/two"/> does not. If I omit the 'as' attribute it works the other way round. What exactly is happening when I assign a node() or element() or whatever type to this variable?

Also could you advise what type I should be using for this kind of task?

I guess my problem is that I'm thinking about variables in XSLT 1 terms!

As usual thanks in advance

Tom

_________________________________________________________________
Windows Live? Messenger has arrived. Click here to download it for free! http://imagine-msn.com/messenger/launch80/?locale=en-gb


--~------------------------------------------------------------------
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>
--~--

<Prev in Thread] Current Thread [Next in Thread>