s9api and Saxon extensions
Post here questions and problems related to oXygen frameworks/document types.
s9api and Saxon extensions
I have an extension plugin for oXygen 18. One of the purposes of the plugin is to allow users to convert various XML formats. All conversions are done in XSLT via the s9api interface from saxon9ee.jar. I have had no issues with this approach until I tried adding a Saxon extension function, specifically saxon:serialize(), to one of the stylesheets, which results in this error when the stylesheet is compiled:
The stylesheet in question works perfectly fine when I run it in the XSLT debugger. How do I enable extension functions in s9api? My Processor instance is created with Processor(true) and reports "EE" as its edition. Is it really the case that XSLT functionality which exists in oXygen itself is not available to plugin developers?
Code: Select all
XPST0017 XPath syntax error at char 8 on line 32 near {...katalogpost>\s+</katalogpos...}:
Cannot find a matching 2-argument function named {http://saxon.sf.net/}serialize().
Saxon extension functions require a Saxon-PE or Saxon-EE license
-
- Posts: 1009
- Joined: Wed Nov 16, 2005 11:11 am
Re: s9api and Saxon extensions
Post by alex_jitianu »
Hello,
From an Workspace Access plugin you can create a Saxon EE transformer:
You will get a JAXP transformer that you can use to transform the XSL document. Is it O.K. for you to rewrite the code to use JAXP instead of the s9api ?
If an Oxygen plugin uses Saxon API, that Saxon instance will have access to Oxygen's inner Saxon license. I've tested myself using a Processor and I managed to execute a saxon:serialize(). Are you creating ClassLoaders in this plugin to load a different saxon9ee.jar?
Best regards,
Alex
From an Workspace Access plugin you can create a Saxon EE transformer:
Code: Select all
pluginWorkspaceAccess.getXMLUtilAccess().createXSLTTransformer(
styleSource,
extensionJars,
XMLUtilAccess.TRANSFORMER_SAXON_ENTERPRISE_EDITION,
false)
If an Oxygen plugin uses Saxon API, that Saxon instance will have access to Oxygen's inner Saxon license. I've tested myself using a Processor and I managed to execute a saxon:serialize(). Are you creating ClassLoaders in this plugin to load a different saxon9ee.jar?
Best regards,
Alex
Re: s9api and Saxon extensions
Hi Alex,
You're right, it does work. My issue was that I was using the wrong constructor.
For future reference in case anyone is interested: You have to supply the Processor with a proper Configuration (e.g. by calling Configuration.makeLicensedConfiguration()). The boolean constructor is insufficient.
You're right, it does work. My issue was that I was using the wrong constructor.
For future reference in case anyone is interested: You have to supply the Processor with a proper Configuration (e.g. by calling Configuration.makeLicensedConfiguration()). The boolean constructor is insufficient.
Return to “SDK-API, Frameworks - Document Types”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service