xsl-list
[Top] [All Lists]

RE: [xsl] Using XSLT's key() function while context in secondary document?

2008-02-19 10:47:22
No problem. Keys are cool, and (ab)using them to their fullest extent is
one of the few ways that I can stay sane in the processing I do at work,
while being limited to XSLT 1.0. Hope you find it as useful as I have.

~ Scott


-----Original Message-----
From: Andrew Welch [mailto:andrew(_dot_)j(_dot_)welch(_at_)gmail(_dot_)com] 
Sent: Tuesday, February 19, 2008 11:44 AM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: Re: [xsl] Using XSLT's key() function while context in
secondary document?

On 19/02/2008, Scott Trenda <Scott(_dot_)Trenda(_at_)oati(_dot_)net> wrote:
Unless there's going to be a processing error at
"document('s.xml')//Channel" when s.xml does not exist, then the
pattern
should be solid here. From the XSLT 1.0 specification:

"When the second argument to the key function is of type node-set,
then
the result is the union of the result of applying the key function to
the string value of each of the nodes in the argument node-set."

So, by passing document('s.xml')//Channel as the second argument to
key(), you can bypass the explicit context switch below, and jump
right
into processing the key results. I had mentioned before that this is
beneficial only if no other processing is needed for the
document('s.xml')//Channel nodes, but that was part of the original
example.

heh,  I didn't know that...

Thanks Scott!


-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/

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


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