XSLT validation scenario with Saxon initializer class
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 280
- Joined: Thu Nov 28, 2013 9:32 am
- Location: Hamburg/Germany
- Contact:
XSLT validation scenario with Saxon initializer class
Hi,
I have configured a transformations scenario using a Saoxn initializer class to register a custom extension function. When validating the root file being used by this transformaton scenario the validation works fine.
I also created a validation scenario for xslt files included by this root file and set the file to be validated accordingly. Now when validating using this validations cenario I get an error that my custom function is unknown. But in the validtion scenario I foundno place to configure my Saxon initializer!?
Thanks and regards,
Patrik
I have configured a transformations scenario using a Saoxn initializer class to register a custom extension function. When validating the root file being used by this transformaton scenario the validation works fine.
I also created a validation scenario for xslt files included by this root file and set the file to be validated accordingly. Now when validating using this validations cenario I get an error that my custom function is unknown. But in the validtion scenario I foundno place to configure my Saxon initializer!?
Thanks and regards,
Patrik
-
- Posts: 1016
- Joined: Wed Nov 16, 2005 11:11 am
Re: XSLT validation scenario with Saxon initializer class
Post by alex_jitianu »
Hi Patrik,
Currently you can't set Saxon options in a validation scenario. In the version 19 (to be released in mid April) though, things will be better: we will detect the transformation scenario associated with the master and we will use it when validation. All you will have to do in the validation unit is to have to use <Default engine> as the engine used to validate the master.
Unfortunately, right now I don't see an easy solution for your use case because the Initializer class can only be set in the scenario options.
Best regards,
Alex
Currently you can't set Saxon options in a validation scenario. In the version 19 (to be released in mid April) though, things will be better: we will detect the transformation scenario associated with the master and we will use it when validation. All you will have to do in the validation unit is to have to use <Default engine> as the engine used to validate the master.
Unfortunately, right now I don't see an easy solution for your use case because the Initializer class can only be set in the scenario options.
Best regards,
Alex
-
- Posts: 280
- Joined: Thu Nov 28, 2013 9:32 am
- Location: Hamburg/Germany
- Contact:
Re: XSLT validation scenario with Saxon initializer class
Hi Alex,
thanks for the information.
Im just wondering if it wouldn't be easier to implement (and teasier to understand for a user) if you would allow to set Saxon configurations in a validation scenario as well. Especially since there are use-cases when you don't have a transformation scenario at all. For instance I have some XSLT code that is only being executed from my custom Java code (be it as oXygen or DITA-OT plugin). Of course I could still just create a dummy transformation scenario that will never be executed and is just to handle the validation correctly - it just doesn't feel straight forward.
Regards,
Patrik
thanks for the information.
Im just wondering if it wouldn't be easier to implement (and teasier to understand for a user) if you would allow to set Saxon configurations in a validation scenario as well. Especially since there are use-cases when you don't have a transformation scenario at all. For instance I have some XSLT code that is only being executed from my custom Java code (be it as oXygen or DITA-OT plugin). Of course I could still just create a dummy transformation scenario that will never be executed and is just to handle the validation correctly - it just doesn't feel straight forward.
Regards,
Patrik
-
- Posts: 1016
- Joined: Wed Nov 16, 2005 11:11 am
Re: XSLT validation scenario with Saxon initializer class
Post by alex_jitianu »
Hi Patrik,
I agree. Having a Saxon configuration inside the validation scenario itself is the proper way to handle such situations. I've also added an issue for this feature but it's not going to make it in version 19 (development is currently frozen).
Best regards,
Alex
I agree. Having a Saxon configuration inside the validation scenario itself is the proper way to handle such situations. I've also added an issue for this feature but it's not going to make it in version 19 (development is currently frozen).
Best regards,
Alex
-
- Posts: 280
- Joined: Thu Nov 28, 2013 9:32 am
- Location: Hamburg/Germany
- Contact:
Re: XSLT validation scenario with Saxon initializer class
Just in case anybody else has this problem:
I found a nice way to handle custom extension functions: Just declare them in your xslt like this:
This has the great additional advantage that these functions will be supported by content completion...
Regards,
Patrik
I found a nice way to handle custom extension functions: Just declare them in your xslt like this:
Code: Select all
<xsl:function name="my:myCustomFunction" as="xs:string" use-when="not(function-available('my:myCustomFunction'))">
<xsl:param name="1stParameter" as="xs:string"/>
<xsl:param name="anotherParameter" as="xs:boolean"/>
<xsl:message terminate="yes">ERROR: Custom extension function 'my:myCustomFunction' not registered.</xsl:message>
</xsl:function>
Regards,
Patrik
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