# Inject xml-stylesheet to Media Server Response

**URL:** <https://forums.plex.tv/t/inject-xml-stylesheet-to-media-server-response/9973>\
**Category:** Dev/API Corner\
**Tags:** other-dev\
**Created:** [July 18, 2011, 1:15pm UTC](https://forums.plex.tv/t/inject-xml-stylesheet-to-media-server-response/9973 "2011-07-18T13:15:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jnks](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jnks](https://forums.plex.tv/u/jnks)\
**Post date:** [July 18, 2011, 1:15pm UTC](https://forums.plex.tv/t/inject-xml-stylesheet-to-media-server-response/9973/1 "2011-07-18T13:15:52Z")

</div>

Does anyone know if it’s possible to get PMS to inject an xml-stylesheet reference into the XML response, and to store XSL files so that they are served by the PMS web server?  
  
  
  
For example, if I open [http://localhost:32400/music](http://localhost:32400/music) I would like to insert \<?xml-stylesheet type="text/xsl" href="plugins.xsl"?\> right after the xml declaration, as such

```auto

<br />
<?xml version="1.0" encoding="UTF-8"?><br />
<?xml-stylesheet type="text/xsl" href="plugins.xsl"?><br />
<MediaContainer size="3" content="plugins"><br />
  <Directory key="bbcpodcasts" title="BBC Podcasts" thumb="/music/bbcpodcasts/:/resources/icon-default.png" art="/music/bbcpodcasts/:/resources/art-default.jpg" hasStoreServices="1" hasPrefs="1" identifier="com.plexapp.plugins.bbcpodcasts" lastAccessedAt="1310669625"/><br />
  ...<br />
</MediaContainer><br />

```

  
  
and then use something like  
  

```auto

<br />
<?xml version="1.0" encoding="UTF-8"?><br />
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:xdt="http://www.w3.org/2005/xpath-datatypes"><br />
  <xsl:output method="html" version="1.0" indent="yes"/><br />
  <xsl:template match="/"><br />
    <html><br />
      <head><br />
        <title/><br />
      </head><br />
      <body><br />
        <table><br />
          <xsl:for-each select="//Directory"><br />
            <tr><br />
              <td><br />
                <img><br />
                  <xsl:attribute name="src"><xsl:value-of select="@thumb"/></xsl:attribute><br />
                  <xsl:attribute name="alt"><xsl:value-of select="@title"/></xsl:attribute><br />
                  <xsl:attribute name="width">100</xsl:attribute><br />
                  <xsl:attribute name="height">100</xsl:attribute><br />
                </img><br />
              </td><br />
              <td valign="top"><br />
                <a><br />
                  <xsl:attribute name="href"><xsl:value-of select="@key"/></xsl:attribute><br />
                  <xsl:value-of select="@title"/><br />
                </a><br />
              </td><br />
            </tr><br />
          </xsl:for-each><br />
        </table><br />
      </body><br />
    </html><br />
  </xsl:template><br />
</xsl:stylesheet><br />

```

  
This way, I would have an easy way to test a plugin during development without having to resort to a proper client every single time I modify something.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [December 20, 2019, 9:11pm UTC](https://forums.plex.tv/t/inject-xml-stylesheet-to-media-server-response/9973/2 "2019-12-20T21:11:58Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
