Hi Emmanuel,

The document() function is only executed at run-time, never at stylesheet
compilation, even with a string literal for the URI.  The processor is
required to return the same document instance for any call to the
document() function with the same URI, so documents are cached for the
lifetime of the transformation.

Indexes for xsl:key are always rebuilt with successive transformations.  I
suppose we could do some sort of xsl:key caching, or lazy rebuilding of the
keys, but how often would you run the same stylesheet with the same
document instance?

Dave



                                                                                
                                        
                      "Abram-Profeta,                                           
                                        
                      Emmanuel"                To:      
<[email protected]>                                  
                      <[EMAIL PROTECTED]         cc:      (bcc: David N 
Bertoni/Cambridge/IBM)                            
                      .com>                    Subject: Performance-related 
questions about document('') and xsl:key    
                                                                                
                                        
                      04/10/2003 03:46                                          
                                        
                      PM                                                        
                                        
                                                                                
                                        



Hi,

I would like to know more about how document() and xsl:key work in Xalan
1.4 and 1.5. Before going through the code in a debugger, Iâd be very
interested in getting any information from this list. Some specific
questions:

- If I compile a stylesheet containing document(ââ), is the latter called
each time the compiled stylesheet is used for a transform? Or is the
content parsed and stored in-memory once and for all? More generally, if
the argument to document is a fixed URI (as opposed to an input parameter
value, a la âdocument($someURL)â), is the URI content retrieved just once?

- Assuming that indeed, the value of document(âFixedURIâ) is fetched upon
stylesheet compilation: if I use <xsl:key> to build an index on some nodes
of the fetched document, will the index be reused across successive
transforms with the same stylesheet? Or is the index rebuilt each time the
compiled stylesheet is used?

Thanks in advance for any info and possibly links to the Xalan C++ code.

Emmanuel

Reply via email to