You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Rick Maddy <rm...@bea.com> on 2000/09/27 01:44:17 UTC

Bug in caching documents

The 'document' function caches documents based on the URI but it doesn't
take into account the base URI.

If two XSL files in different directories have a code fragment such as:

...
...document('./data.xml')...
...

and one of these XSL files includes the other (again, from a different
directory), then the second call to 'document' will use the cached version
of the first since they have the same URI ('./data.xml') even though they
have different bases (the actual directory of the XSL file).

A simpler example would be a single XSL file with two calls to 'document'
such as:

...
...document('data.xml')...
...
...document('./data.xml')...
...

This is really the same file but it is cached twice since the literal URI is
different.

The file FuncDocument.java in org.apache.xalan.xslt has a function called
'getDoc'. This functions gets and sets to/from a cache based solely on the
URI. This needs to be modified to also include the base URI.

This was found in Xalan Java 1.1. Version 1.2D02 has the problem as well.

Thanks,
Rick