[oXygen-user] oXygen and EXSLT
Sorin Ristache
Tue Apr 22 04:34:47 CDT 2008
Hello,
If you can't use XSLT 2.0 which has built-in support for
regular expressions you have to import the EXSLT regexp
extension in an XSLT 1.0 stylesheet but you have to use
MSXML or Xalan in oXygen.
For MSXML the EXSLT stylesheets need a modification: import
the MSXML stylesheet directly instead of the wrapper
stylesheet that includes the MSXML stylesheet with a
func:script element. For example for the EXSLT regexp
replace stylesheet you have to import in your stylesheet
directly regexp.replace.msxsl.xsl:
<xsl:import href="regexp.replace.msxsl.xsl" />
instead of
<xsl:import href="regexp.replace.xsl" />
which contains an element
<func:script language="exslt:msxsl"
implements-prefix="regexp" src="regexp.replace.msxsl.xsl"/>
as in the EXSLT example on the exslt.org website.
For Xalan you have to modify the EXSLT stylesheet to conform
with the Xalan extension rules specified on the Xalan
Extensions page:
http://xml.apache.org/xalan-j/extensions.html#basic-pattern
The JavaScript code from the EXSLT stylesheets (for example
regexp.replace.js) must be adapted to Xalan as in the
example which you can find on the same Xalan page:
http://xml.apache.org/xalan-j/extensions.html#ex-basic
You have to add bsf.jar (the Bean Scripting Framework) and
js.jar (the Apache Rhino project) as XSLT extensions to the
oXygen transformation scenario that processes your EXSLT
enabled stylesheet with Xalan. These jar files are needed
for adding a JavaScript extension to Xalan.
The oXygen User Manual describes how to set an XSLT
extension in an oXygen transformation scenario:
http://www.oxygenxml.com/doc/ug-standalone/defining-new-transformation-scenario.html
http://www.oxygenxml.com/doc/ug-standalone/xslt-xquery-extensions.html
Regards,
Sorin
wrote:
> Hi,
>
> I was wondering if it's possible to get oXygen 9.1 working with EXSLT?
>
> I'm particularly interested in regExp, but when I try that, I get a debugger error "Unknown Saxon extension element: script".
>
> If someone has been able to get this working, can you please share how you accomplished this?
>
> Thanks,
> Jim
>
> P.S. I can't use XSLT 2.0 because it won't be available in another environment which is the target.
More information about the oXygen-user
mailing list