Firstly, this is very Saxon-specific, so it would be better asked on the
saxon-help list (reachable via the Saxon project on SourceForge).
Secondly, the comments in the stylesheet say it was tested with Saxon
9.1.0.3. Which version are you running with?
Regards,
Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay
-----Original Message-----
From: Lynn Murdock [mailto:lmurdock(_at_)plos(_dot_)org]
Sent: 26 March 2010 21:09
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] error when trying to run stylesheets with
saxon:transform() extension
i'm hoping that someone can help me. i'm currently testing
various stylesheets in the NLM's (national library of
medicine's) journal publishing 3.0 suite in an integrated
development environment (IDEA's intelliJ, using a saxon xslt
2.0 processor). some of these stylesheets are shell
stylesheets that pipeline other stylesheets.
i'm trying to test some of these integrated stylesheets, and
keep getting the following error in intelliJ that terminates
the transform:
Error at saxon:assign on line 66 of
file:/home/lmurdock/development/ambra/webapp/target/classes/ma
in/shell-utility.xsl:
XPST0003: XPath syntax error at char 135 on line 66 in {...
$runtime-params/* )}:
Cannot find a matching 3-argument function named
{http://saxon.sf.net/}transform()
the full stylesheets are far too long to include here, so i'm
including only what i think is the relevant code here.
first, the primary pipelining stylesheet (i'm not including
the citations-prep or jpub3 stylesheets because i don't think
they're relevant to this problem):
<?xml version="1.0" encoding="UTF-8"?>
<!-- ============================================================= -->
<!-- MODULE: Saxon shell (pipelining) stylesheet -->
<!-- HTML Preview with APA-like citations -->
<!-- VERSION: 1.0 -->
<!-- DATE: January 2009 -->
<!-- -->
<!-- ============================================================= -->
<!-- ============================================================= -->
<!-- SYSTEM: NCBI Archiving and Interchange Journal Articles -->
<!-- -->
<!-- PURPOSE: Pipelines stylesheets to convert -->
<!-- Journal Publishing 3.0 XML as follows: -->
<!-- 1. format citations in APA-like style -->
<!-- 2. convert to HTML for preview display -->
<!-- -->
<!-- PROCESSOR DEPENDENCIES: -->
<!-- Saxon, from Saxonica (www.saxonica.com) -->
<!-- Tested using Saxon 9.1.0.3 (B and SA) -->
<!-- -->
<!-- COMPONENTS REQUIRED: -->
<!-- main/shell-utility.xsl, plus all the stylesheets -->
<!-- named in the $processes variable declaration -->
<!-- -->
<!-- INPUT: Journal Publishing 3.0 XML with citations -->
<!-- in APA format -->
<!-- -->
<!-- OUTPUT: HTML -->
<!-- -->
<!-- CREATED FOR: -->
<!-- Digital Archive of Journal Articles -->
<!-- National Center for Biotechnology Information -->
<!-- (NCBI) -->
<!-- National Library of Medicine (NLM) -->
<!-- -->
<!-- CREATED BY: -->
<!-- Wendell Piez, Mulberry Technologies, Inc. -->
<!-- -->
<!-- ============================================================= -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:saxon="http://saxon.sf.net/"
version="2.0"
extension-element-prefixes="saxon">
<xsl:output method="html" omit-xml-declaration="yes"
encoding="utf-8" indent="no"/>
<!-- <xsl:output method="xml" omit-xml-declaration="no"
encoding="utf-8" indent="no"/> -->
<xsl:variable name="processes">
<!-- format citations in APA format -->
<step>citations-prep/jpub3-APAcit.xsl</step>
<!-- convert into HTML for display -->
<step>main/jpub3-html.xsl</step>
</xsl:variable>
<xsl:include href="main/shell-utility.xsl"/>
</xsl:stylesheet>
and then the included shell stylesheet:
<?xml version="1.0" encoding="UTF-8"?>
<!-- ============================================================= -->
<!-- MODULE: Saxon shell (pipelining) utility stylesheet -->
<!-- VERSION: 1.0 -->
<!-- DATE: January 2009 -->
<!-- -->
<!-- ============================================================= -->
<!-- ============================================================= -->
<!-- SYSTEM: NCBI Archiving and Interchange Journal Articles -->
<!-- -->
<!-- PURPOSE: Provide support for pipelining stylesheets -->
<!-- directly, using Saxon extensions, in XSLT 2.0 -->
<!-- -->
<!-- PROCESSOR DEPENDENCIES: -->
<!-- Saxon, from Saxonica (www.saxonica.com) -->
<!-- Tested using Saxon 9.1.0.3 (B and SA) -->
<!-- -->
<!-- COMPONENTS REQUIRED: -->
<!-- This stylesheet does not stand alone; it is a -->
<!-- code module for inclusion into another stylesheet -->
<!-- that specifies the steps of the pipeline. -->
<!-- -->
<!-- INPUT: Any -->
<!-- -->
<!-- OUTPUT: Any -->
<!-- -->
<!-- CREATED FOR: -->
<!-- Digital Archive of Journal Articles -->
<!-- National Center for Biotechnology Information -->
<!-- (NCBI) -->
<!-- National Library of Medicine (NLM) -->
<!-- -->
<!-- CREATED BY: -->
<!-- Wendell Piez, Mulberry Technologies, Inc. -->
<!-- -->
<!-- ============================================================= -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:saxon="http://saxon.sf.net/"
version="2.0"
extension-element-prefixes="saxon">
<!-- This stylesheet does not stand alone! It is a component
to be called into XSLT 2.0 shell stylesheets. -->
<xsl:variable name="document" select="/" saxon:assignable="yes"/>
<xsl:param name="runtime-params">
<base-dir>
<xsl:value-of
select="replace(base-uri(/), '/[^/]+$','')"/>
</base-dir>
</xsl:param>
<xsl:template match="/">
<xsl:for-each select="$processes/step/concat('../',.)">
<xsl:message>
<xsl:text>
... Applying </xsl:text>
<xsl:value-of select="."/>
</xsl:message>
<saxon:assign name="document"
select="saxon:transform(
saxon:compile-stylesheet(doc(.)),
$document,
$runtime-params/* )"/>
<!-- A third argument to saxon:transform could specify
runtime parameters for any (or all) steps -->
</xsl:for-each>
<xsl:sequence select="$document"/>
<xsl:message>
... Done</xsl:message>
</xsl:template>
</xsl:stylesheet>
i confirmed that the saxon:transform() extension function
does indeed exist:
http://www.saxonica.com/documentation/extensions/functions/tra
nsform.html
and it looks to me like it's written properly.
does anyone have ideas about where the problem exists and how
i can go about remedying it?
thanks-
lynn
--------------------------------------------------------------
--------------------------------------------------------------
--------------------------------------------------------------
--------------------------------
This email is confidential to the intended recipient. If you
have received it in error, please notify the sender and
delete it from your system. Any unauthorized use, disclosure
or copying is not permitted. The views or opinions presented
are solely those of the sender and do not necessarily
represent those of Public Library of Science unless otherwise
specifically stated. Please note that neither Public Library
of Science nor any of its agents accept any responsibility
for any viruses that may be contained in this e-mail or its
attachments and it is your responsibility to scan the e-mail
and attachments (if any).
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail:
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--