Re: [xsl] Difficulty with document() and for-each scope

Subject: Re: [xsl] Difficulty with document() and for-each scope
From: Adam Nielsen <adam.nielsen@xxxxxxxxx>
Date: Tue, 17 Jun 2008 10:21:39 +1000
Yes. The de facto (?) way of pulling this trick is to use an anchor variable. Either you set document('')/me:month to a variable, or you set "/" to a variable (before you enter the for-each block). That way you either prevent the scope from shifting to another document (the first approach) or you keep a reference to the original input document (the second approach).

Thanks for your reply! I had seen this trick on the web, but I couldn't figure out how to use the anchor variable with the apply-templates block.


Deborah's suggestion of using for-each sounds like it would do this, so I'll try it now.

Cheers,
Adam.

Current Thread