Joseph, Thanks for the feedback on this. I am just using the URI containing the name of the stylesheet now, and it seems to be working fine. I do think its loading the stylesheet again, but as its not too large, that doesn't seem to be a performance problem.
Thanks, Cory -----Original Message----- From: Joseph Kesselman [mailto:[EMAIL PROTECTED]] Sent: Monday, August 26, 2002 7:30 AM To: [EMAIL PROTECTED] Subject: Re: Import Question >Mike K. says document('') refers to current stylesheet. ... Hm. Just checked http://www.ietf.org/rfc/rfc2396.txt section 5 again, and I think he's right. "" is an invalid URI, but apparently is a valid Relative URI Reference. In any case, the XSLT 1.0 spec defines this as an explicit special case: "Note that a zero-length URI reference is a reference to the document relative to which the URI reference is being resolved; thus document("") refers to the root node of the stylesheet; the tree representation of the stylesheet is exactly the same as if the XML document containing the stylesheet was the initial source document.". And if you're trying to read the stylesheet itself as a document, that is a different case from '/'. Might be worth trying document('.'), which should have the same meaning, just to see whether that works... Note that any of these options will currently cause Xalan to re-read the stylesheet as a source document, which will only work if the stylesheet's base URI was set correctly and it can be successfully re-read from that URI. If you're processing data from a stream which was being generated on demand, that may require changing your upstream code to support this second read. I don't think we want to put a layer into Xalan to internally re-express a stylesheet as a source document. That would conflict with our attempts to move toward optimizing stylesheets, XSLTC being an extreme case but not the only case. And this is a sufficiently unusual case that a second read doesn't seem unreasonable. ______________________________________ Joe Kesselman / IBM Research
