Subject: Re: [xsl] the document() in IE From: David Carlisle <davidc@xxxxxxxxx> Date: Wed, 11 Jul 2007 13:29:59 +0100 |
> Do you happen to know whether this holds for a variable or parameter? variables are bound to values, and by the time that it's passed to a function such as document() it shouldn't matter whether the value was passed to the function as a variable reference or any other kind of expression. Note however the difference between <xsl:variable name="href" select="path/to/href"/> and the form that you often see beginners use: <xsl:variable name="href"> <xsl:value-of select="path/to/href"/> </xsl:variable> With the first form, $href is an element node with base URI depending on the document that contains the node, with the second form, $href is a rtf (in xslt 1) and so will act as a string in document() with uri resolution being against the base uri of the stylesheet. In XSLT2 $href will be a document node, again with base URI being that of the stylesheet. > document('path', document('absolute path to current xslt')) yes, but that's the same as document(string('path')) > Finally: this new solution would work with document(), but not with > xsl:import/include, which are relative to the xslt base always (and do > not take parameters anyway). usually when there are problems with uri resolution in xslt1 (I must say I've not really done this much in client side stylesheets) its because the base uri is not as expected, or not set at all. If the XSLt engine is reading a document directly then it's fairly clear what the base URI should be, but if the document (or the stylesheet) has previously been read into a DOM of some sort, perhaps manipulated with DOM scripting, and then passed as an in-memory tree to the XSLT processor, then the XSLT REC gives you noi guidance at all on what the base URI of the nodes will be, it is all completely implementation defined. David ________________________________________________________________________ The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom. This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. ________________________________________________________________________
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] the document() in IE, Abel Braaksma | Thread | Re: [xsl] the document() in IE, Abel Braaksma |
Re: [xsl] csv to xml converter bug, Andrew Welch | Date | [xsl] Tricky transformation task, Jimmy |
Month |