Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Welcome to the Saxon XSLT Processor Service

Wiki MarkupThis local service provides an XSLT Transformation Engine ^\[1\]^ for transforming XML-encoded source documents using a supplied XSLT stylesheet. The service functions as a Java servlet and can be invoked using the following syntax:

*hostname:\[port-number\]/saxon/SaxonServlet?source=\[xml-source\]&style=\[xsl-stylesheet\]&clear-stylesheet-cache=yes*

Panel

Wiki Markup

Where:

  • Wiki Markup\[hostname\] -- The hostname of the Fedora server; default is localhost.unmigrated-wiki-markup
  • \[port-number\] -- The port number on which the Fedora server is running; default is 8080.unmigrated-wiki-markup
  • \[xml-source\] -- The URL of the XML source file. Wiki Markup\
  • [xsl-stylesheet\] -- The URL of the XSLT stylesheet file.
  • clear-stylesheet-cache – An optional parameter indicating if the stylesheet cache is to be cleared. A value of of "yes" signals to clear the stylesheet cache. If the parameter is omitted or has any other value, the stylesheet cache remains untouched.

...

Note that the text credentials for must be present at the start of the param-name, and the URL should be supplied without the protocol part (ie localhost:8080/fedora/path rather than http://localhost:8080/fedora/pathImage Removed).

The Saxon Servlet will need to be restarted in order for new values to take effect.

...

Panel
titleURL

http://localhost:8080/saxon/SaxonServlet?source=http://dl.lib.virginia.edu/data/xmltext/ead/viu03270&style=http://dl.lib.virginia.edu/bin/ead/xsl/document.xsl&param1=SomeText

Code Block
xml
xml
borderStylesolid
titleStylesheetborderStylesolid
<?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="$param1"/>
    </output>
  </xsl:template>
</xsl:stylesheet>

...

Panel
titleURL

http://localhost:8080/saxon/SaxonServlet?source=http://dl.lib.virginia.edu/data/xmltext/ead/viu03270&style=http://dl.lib.virginia.edu/bin/ead/xsl/document.xsl&param1=http://dl.lib.virginia.edu/data/xmltext/another-input

Code Block
borderStyle
xml
xml
borderStylesolid
titleStylesheetsolid
<?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>

...

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
borderStylesolid
titleInternet Media Type exampleborderStylesolid
<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/.