XSLT: Multiple Output Documents

I was wondering what the status of the <xsl:document> element is. It was
one of my favorite features of XSLT 1.1, but it's not mentioned in the
XSLT 2.0 requirements. I suspect it has been dropped, but I have not
seen an explanation why.

I recently had a conversation on netscape.public.mozilla.layout.xslt
with Axel Hecht in which he pointed out several problems with this
feature, and I pointed out several solutions. The biggest problem he
pointed out was that an XSLT output document could hide a valid page
written by someone else. For instance, someone could output to
http://www.microsoft.com/ and hide the real Microsoft site. (If I'm
misrepresenting Axel, please correct me.)
My solution is to limit the "href" attribute of the <xsl:document>
element to relative URIs without ../ steps in the path. Then, if your
main document is named "index.xml", subdocuments could be addressed by
"index.xml/subdoc1.html". This file cannot actually exist on the server,
so spoofing problems are avoided. If the same address were typed into
another browser window, the server would just return a 404 error. The
only way to access this document would be through links from the main
document and other subdocuments.
A batch transform, however, should be able to generate documents
anywhere in the directory structure. Again, absolute URIs don't make
sense, but now ../ steps should be allowed.
Obviously, this would break the current symmetry between batch
transforms and browser transforms. Since the two processes are
fundamentally different, I think this break is acceptable.

I don't know anything about the implementation issues of this. This
suggestion is certainly not the best one possible, so please suggest
alternatives. But I think the multiple output documents feature would be
useful to a lot of people and should be saved.

Jeffrey Yasskin

Received on Monday, 8 October 2001 08:39:36 UTC