[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: AW: Using key() from outside the default namespace

Subject: Re: AW: Using key() from outside the default namespace
From: Peter Flynn <peter@xxxxxxxxxxx>
Date: 06 Aug 2003 00:21:17 +0100
Re: AW:  Using key() from outside the default namespace
On Tue, 2003-08-05 at 02:16, Peter Flynn wrote:
> I'll sort out a minimal instance to demonstrate this.

This is in http://www.silmaril.ie/xslt/minimal.zip

 Length   Method    Size  Ratio   Date   Time   CRC-32    Name
--------  ------  ------- -----   ----   ----   ------    ----
     198  Defl:N      138  30%  08-05-03 23:40  8e998f3c  styles.xml
     952  Defl:N      367  61%  08-05-03 23:42  8b778bd3  bibstyle.css
      67  Defl:N       52  22%  08-06-03 00:06  73f11633  demo.css
     820  Defl:N      428  48%  08-06-03 00:15  d198d1a9  README
    1113  Defl:N      295  74%  08-06-03 00:16  270ec157  doc.html
    3611  Defl:N     1102  70%  08-06-03 00:16  b8c75731  doc2htm.xsl
     273  Defl:N      184  33%  08-06-03 00:16  66c1701f  doc.xml
--------          -------  ---                            -------
    7034             2566  64%                            7 files

README says:

This is a minimal set of files to reproduce the problem:

    How do you use a key which indexes nodes in the
    main document, when processing nodes from an
    auxiliary document via for-each using document()?

The canonical answer is to set a global variable to the document root
and then within the for-each of the document(), set a variable to hold
the desired key node, containing a dummy for-each to process the
global variable (which sets the context back to the main document),
within which you make the call to key().

This set of files does exactly that, and shows that this procedure
of using the global variable causes the document root template to
be fired, outputting unwanted nested literal result elements.

To run this, use something like

	$ saxon doc.xml doc2htm.xsl doc.html

<peter@xxxxxxxxxxx>
 




 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.