Re: [xsl] Document() question

Subject: Re: [xsl] Document() question
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Tue, 18 Sep 2007 22:00:43 -0400
(Sorry; I was accidentally using the wrong email profile and signature for sending my earlier response because of ongoing work in another window)

At 2007-09-18 18:33 -0700, Kerry Kobashi wrote:
I am not able to access the /a/b/c/index.xml file located off my website:

I tried:


*Warning*: XSLTProcessor::transformToXml() [function.XSLTProcessor-transformToXml <>]: I/O warning : failed to load external entity


*Warning*: XSLTProcessor::transformToXml() [function.XSLTProcessor-transformToXml <>]: remote host file access not supported


*Warning*: XSLTProcessor::transformToXml() [function.XSLTProcessor-transformToXml <>]: php_network_getaddresses: getaddrinfo failed:

Any suggestions?

Did you quote the URL values?

There should be no problems with:


The first argument to the document() function is a string. If you apply a node set the processor converts each node to a string and uses the string as a URI.

Remember if you are using a relative URI the absence of the second argument signals the stylesheet node as the base URI (which is a bug in Internet Explorer in that it incorrectly uses the current node URI; IE apparently only uses the stylesheet node if the first argument is the empty string), while supplying a second argument signals the processor to use the base URI of the fragment with the syntax that created the given source tree node.

To work around the Internet Explorer bug, a patch that is portable across all processors I've tried while getting around the bug in IE is:

document( '...relative-uri...', document( '' ) )

For IE this gives conformant behaviour as if the second argument were absent. For other processors this second argument is redundant.

I hope this helps.

. . . . . . . . . . . . Ken

Upcoming public training: UBL and code lists Oct 1/5; Madrid Spain
World-wide corporate, govt. & user group XML, XSL and UBL training
RSS feeds:     publicly-available developer resources and training
G. Ken Holman                 mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd.
Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
Male Cancer Awareness Jul'07
Legal business disclaimers:

Current Thread