Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
xml
xml
titleStylesheet
borderStylesolid
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:param name="param1"/>
  <xsl:template match="/">
    <output>
      <xsl:value-of select="document($param1)/path/to/element"/>
    </output>
  </xsl:template>
</xsl:stylesheet>

Setting the Internet Media Type (MIMEType)

By default the Saxon servlet will return a media type of text/html if none has been defined in your stylesheet. If your stylesheet is generating XML you may find it useful to set the media type so the correct type will be returned - for instance to a browser via an object method (disseminator}. To do this include an xsl:output element as a top-level element in your stylesheet, with a media-type attribute defining the media type.

Code Block
xml
xml
titleInternet Media Type example
borderStylesolid

<xsl:output indent="yes" method="xml" media-type="text/xml"/>

...

Wiki Markup
^\[1\]^ This service uses the SAXON XSLT Processor from Michael Kay which is licensed under the Mozilla Public License ([MPL|http://www.mozilla.org/MPL/]). For additonal information regarding the SAXON XSLT Processor, please refer to the Saxon project web site on SourceForge at: http://saxon.sourceforge.net/.

...