Forum: NGINX xslt not work properly with nginx 7.30 on xslt function document() for apply template

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Tomasen (Guest)
on 2008-12-28 22:39
(Received via mailing list)
The xlst module on nginx is great! Everything seems working except....

I (or nginx xslt module) still having trouble on the following line in
my xsl file:

<xsl:apply-templates select="document('/xml/hotsearch/sub.xml')"/>

Nginx-xslt module does able to retrive the data in that xml, but not
been able to render it (as other xslt render like IE \ firefox \ Opera).

About the function: http://www.w3schools.com/Xsl/func_document.asp

Tomasen
mike (Guest)
on 2008-12-29 00:05
(Received via mailing list)
On Sun, Dec 28, 2008 at 12:28 PM, Tomasen <removed_email_address@domain.invalid> 
wrote:
> About the function: http://www.w3schools.com/Xsl/func_document.asp
Is there anything in the error log? Maybe turn on debugging? Perhaps
the file path is not correct (perhaps it needs the full system path?)

XSLT is picky, and document() may not be supported properly. If I
recall on one system I used I don't think it was available either (not
nginx, but some .NET thing)
Tomasen (Guest)
on 2008-12-29 01:08
(Received via mailing list)
There is no log about this.

And the xml file and data inside has been read. It's just that xslt
template
havn't been apply to the xml loaded via document()

sad :( xslt is easy to maintain and great. I hope there could be more
support on this.

Thanks

Tomasen

--------------------------------------------------
From: "mike" <removed_email_address@domain.invalid>
Sent: Monday, December 29, 2008 5:55 AM
To: <removed_email_address@domain.invalid>
Subject: Re: xslt not work properly with nginx 7.30 on xslt function
document() for apply template
Denis F. Latypoff (Guest)
on 2008-12-29 11:45
(Received via mailing list)
Hello Tomasen,

Monday, December 29, 2008, 2:28:41 AM, you wrote:

> The xlst module on nginx is great! Everything seems working except....

> I (or nginx xslt module) still having trouble on the following line in my xsl file:

> <xsl:apply-templates select="document('/xml/hotsearch/sub.xml')"/>

try relative path to sub.xml

> Nginx-xslt module does able to retrive the data in that xml, but
> not been able to render it (as other xslt render like IE \ firefox \ Opera).

> About the function: http://www.w3schools.com/Xsl/func_document.asp
>
> Tomasen

This works for me:

<xsl:variable name="doc" select="document('/path/to/xml')" />
<xsl:apply-templates select="$doc" />
This topic is locked and can not be replied to.