xsl-list
[Top] [All Lists]

Re: [xsl] the document() in IE

2007-07-11 04:40:37
Hi Shi,

In IE, the paths of the document() function are relative to the base uri
of the containing HTML page that loads (has) the script that calls the
transformation, instead of being relative to the base uri of the xslt
(as it should be according to the xslt spec).

You did not specify whether you used the PI technique or a javascript to
start your transformation. I don't know if this holds for a PI as well,
but I think it does.

In FF and any other XSLT 1 processor I am aware of, the document()
function is relative to the base uri of the xslt file.

To solve this dynamically for IE, you need to load the xslt from a
javascript and parse the xslt first and change the document() references
by code (or by an xslt-to-xslt transform). I have posted a javascript
solution that covers 95% of the situations is available from the Sarissa
mailing list, not sure it is included in Sarissa as of yet.

To solve this statically, simply use absolute paths. You specify
'/path/xml', which is a relative path. To use an absolute path, start
the uri with the protocol specifier, which is likely 'http:' or 'file:'.
I.e.: 'file:///path/xml'.

Note that this problem also occurs with other instructions that take a
uri: xsl:import and xsl:include (which are also covered in the solution
mentioned above).

I wish I could be of more help, but unfortunately MS made this
particular behavior rather hard to workaround.

Cheers,
-- Abel Braaksma


shi wudao wrote:
Hi guru,

there have /path1/xml1
/path2/xml2
/path3/file.xsl

I use /path3/file.xsl to parse /path2/xml2, and also want to load
/path1/xml1
but IN IE, document("/path1/xml1") will failed by "can not access".
I tried in FF, it is OK.
IN IE, I only can put xml1 under /path2, and use document("xml1") then
it works.
It looks like the security of IE forbid to access XML other than the
current path.

Any XSLT1.0's suggesstion to solve it? thank you.
And I concern that if I use a JSP to create XML, then how can IE load
other XML ? In FF, document("xxx.jsp") still work.

_________________________________________________________________
免费下载 MSN Explorer: http://explorer.msn.com/lccn/

--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--





--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>