# Using inline processing instructions with XSLT module?

**URL:** <https://www.ruby-forum.com/t/using-inline-processing-instructions-with-xslt-module/167706>\
**Category:** NGINX\
**Created:** [May 11, 2009, 7:23pm UTC](https://www.ruby-forum.com/t/using-inline-processing-instructions-with-xslt-module/167706 "2009-05-11T19:23:27Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![digitala](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/848f3c/32.png) [@digitala](https://www.ruby-forum.com/u/digitala)\
**Post date:** [May 11, 2009, 7:23pm UTC](https://www.ruby-forum.com/t/using-inline-processing-instructions-with-xslt-module/167706/1 "2009-05-11T19:23:27Z")

</div>

Is it possible to return an XML document (for example from FastCGI)  
which contains a processing instruction, and have the XSLT module locate  
and apply the XSL file?

For example; if the FastCGI app returns:

```
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="/xsl/basic.xsl"?>

```

…then would/could the XSLT module load the file based on the current  
“root” set in the server section of the config file?

Posted at Nginx Forum:

> **[Using inline processing instructions with XSLT module?](https://forum.nginx.org/read.php?2,1905,1905#msg-1905)**
>
> Is it possible to return an XML document (for example from FastCGI) which contains a processing instruction, and have the XSLT module locate and apply the XSL file? For example; if the FastCGI app returns: \<?xml version="1.0"...

---

<div class="post-metadata">

**Author:** ![digitala](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/848f3c/32.png) [@digitala](https://www.ruby-forum.com/u/digitala)\
**Post date:** [May 11, 2009, 7:40pm UTC](https://www.ruby-forum.com/t/using-inline-processing-instructions-with-xslt-module/167706/2 "2009-05-11T19:40:29Z")

</div>

On Mon, May 11, 2009 at 01:15:41PM -0400, digitala wrote:

> Is it possible to return an XML document (for example from FastCGI) which contains a processing instruction, and have the XSLT module locate and apply the XSL file?
> 
> For example; if the FastCGI app returns:
> 
> ```
> <?xml version="1.0" encoding="UTF-8"?>
> <?xml-stylesheet type="text/xsl" href="/xsl/basic.xsl"?>
> 
> ```
> 
> …then would/could the XSLT module load the file based on the current “root” set in the server section of the config file?

No, currently stylesheets are proccessed on configuraiton stage.  
One of the reasons why it was implemented so because a stylesheet  
may have remote includes that may block for long time, etc.

---

<div class="post-metadata">

**Author:** ![digitala](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/848f3c/32.png) [@digitala](https://www.ruby-forum.com/u/digitala)\
**Post date:** [May 11, 2009, 11:41pm UTC](https://www.ruby-forum.com/t/using-inline-processing-instructions-with-xslt-module/167706/3 "2009-05-11T23:41:49Z")

</div>

On 11-May-09, at 10:15 AM, digitala wrote:

> Is it possible to return an XML document (for example from FastCGI)  
> which contains a processing instruction, and have the XSLT module  
> locate and apply the XSL file?

Are you currently using XSLT in nginx to serve XML files returned from  
FastCGI? I’ve tried doing that in my environment, and nginx just  
returns the XML raw.

---

<div class="post-metadata">

**Author:** ![digitala](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/848f3c/32.png) [@digitala](https://www.ruby-forum.com/u/digitala)\
**Post date:** [May 12, 2009, 10:24am UTC](https://www.ruby-forum.com/t/using-inline-processing-instructions-with-xslt-module/167706/4 "2009-05-12T10:24:05Z")

</div>

On Tue, May 12, 2009 at 03:29:29AM -0400, digitala wrote:

> Not yet - I was going to play with setting “xslt\_types process/xml;” and have my fastcgi app return that content type, but I would’ve preferred to be able to set a processing instruction to allow separation of stylesheets into “logged out”/“logged in” sets.
> 
> Igor; is the functionality for parsing Processing Instructions planned?

Currently - no.

---

<div class="post-metadata">

**Author:** ![digitala](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/848f3c/32.png) [@digitala](https://www.ruby-forum.com/u/digitala)\
**Post date:** [May 12, 2009, 9:35am UTC](https://www.ruby-forum.com/t/using-inline-processing-instructions-with-xslt-module/167706/5 "2009-05-12T09:35:24Z")

</div>

Not yet - I was going to play with setting “xslt\_types process/xml;” and  
have my fastcgi app return that content type, but I would’ve preferred  
to be able to set a processing instruction to allow separation of  
stylesheets into “logged out”/“logged in” sets.

Igor; is the functionality for parsing Processing Instructions planned?

Posted at Nginx Forum:

> **[Re: Using inline processing instructions with XSLT module?](https://forum.nginx.org/read.php?2,1905,1942#msg-1942)**
>
> Is it possible to return an XML document (for example from FastCGI) which contains a processing instruction, and have the XSLT module locate and apply the XSL file? For example; if the FastCGI app returns: \<?xml version="1.0"...

---

<div class="post-metadata">

**Author:** ![digitala](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/848f3c/32.png) [@digitala](https://www.ruby-forum.com/u/digitala)\
**Post date:** [April 5, 2016, 3:55pm UTC](https://www.ruby-forum.com/t/using-inline-processing-instructions-with-xslt-module/167706/6 "2016-04-05T15:55:17Z")

</div>

Can we vote for this feature ?  
If it is security risk, may be sandbox it to local location only

Posted at Nginx Forum:

> **[Re: Using inline processing instructions with XSLT module?](https://forum.nginx.org/read.php?2,1905,265887#msg-265887)**
>
> Is it possible to return an XML document (for example from FastCGI) which contains a processing instruction, and have the XSLT module locate and apply the XSL file? For example; if the FastCGI app returns: \<?xml version="1.0"...
