custom functions/instructions in xslt content completion
Post here questions and problems related to oXygen frameworks/document types.
-
- Posts: 280
- Joined: Thu Nov 28, 2013 9:32 am
- Location: Hamburg/Germany
- Contact:
custom functions/instructions in xslt content completion
Hi,
I have implemented some custom functions for saxon xslt and will add some custom instructions as well. Is there any way I can add these to the content completion?
I noticed that the custom functions in the saxon namespace are already included while the saxon instructions are not!?
Thanks and regards,
Patrik
I have implemented some custom functions for saxon xslt and will add some custom instructions as well. Is there any way I can add these to the content completion?
I noticed that the custom functions in the saxon namespace are already included while the saxon instructions are not!?
Thanks and regards,
Patrik
-
- Posts: 2881
- Joined: Tue May 17, 2005 4:01 pm
Re: custom functions/instructions in xslt content completion
Hi,
It is possible, but the mechanism wasn't really designed with customization in mind. This requires patching via the Oxygen/lib/endorsed/builtin folder (as we discussed on another thread for Schematron stylesheets).
The builtin custom functions from the Saxon namespace are found in oxygen.jar/builtin/xsl-annotations/functions/. Extract these files in the appropriate folder, Oxygen/lib/endorsed/builtin/xsl-annotations/functions/ and modify them there (or copy them there afterwards).
Regards,
Adrian
It is possible, but the mechanism wasn't really designed with customization in mind. This requires patching via the Oxygen/lib/endorsed/builtin folder (as we discussed on another thread for Schematron stylesheets).
The builtin custom functions from the Saxon namespace are found in oxygen.jar/builtin/xsl-annotations/functions/. Extract these files in the appropriate folder, Oxygen/lib/endorsed/builtin/xsl-annotations/functions/ and modify them there (or copy them there afterwards).
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 280
- Joined: Thu Nov 28, 2013 9:32 am
- Location: Hamburg/Germany
- Contact:
Re: custom functions/instructions in xslt content completion
Hi Adrian,
this seems to work only for functions within the saxon namespace. I added the folowing code for testing:
Both test-functions are only recognized in the saxon-namespace: When typing "saxon:test-" both entries are suggested. After "test:" there is no suggestion by content completion. So the namespace-element in the file appears to be ignored.
However, custom extension functions for saxon need a different namespace identifying the responsible java class. Thus, I can't register them this way.
Any other idea?
To "register" extension elements I guess I have to overwrite the xml schemas "XSL2.0Schema.xsd", ...?
Thanks and regards,
Patrik
this seems to work only for functions within the saxon namespace. I added the folowing code for testing:
Code: Select all
<function>
<name>saxon:test-saxon</name>
<namespace>http://saxon.sf.net/</namespace>
<signature>
<return>xs:string*</return>
</signature>
<description xml:space="preserve">Test-Function in saxon namespace 'http://saxon.sf.net/'</description>
</function>
<function>
<name>test:test-test</name>
<namespace>http://www.test.de</namespace>
<signature>
<return>xs:string*</return>
</signature>
<description xml:space="preserve">Test-Function in test namespace 'http://www.test.de'</description>
</function>
However, custom extension functions for saxon need a different namespace identifying the responsible java class. Thus, I can't register them this way.
Any other idea?
To "register" extension elements I guess I have to overwrite the xml schemas "XSL2.0Schema.xsd", ...?
Thanks and regards,
Patrik
-
- Posts: 404
- Joined: Thu Aug 21, 2003 11:36 am
- Location: Craiova
- Contact:
Re: custom functions/instructions in xslt content completion
Post by radu_pisoi »
As Adrian already said, there is no special mechanism designed for adding Saxon extension functions or instructions.Patrik wrote: Both test-functions are only recognized in the saxon-namespace: When typing "saxon:test-" both entries are suggested. After "test:" there is no suggestion by content completion. So the namespace-element in the file appears to be ignored.
We thought that adding new functions to oxygen.jar/builtin/xsl-annotations/functions/saxon-functions.xml will be an workaround for this problem.
I've investigated a bit more this situation and I've discovered that this workaround doesn't work because all of these extension functions are considered to be in a fixed namespace: 'http://saxon.sf.net/'.
I'm afraid that there is no solution/workaround to update the list displayed by the content completion by adding custom Saxon extension functions.
Yes, this is an workaround. But it will work only when you are editing XSLT 2.0 stylesheets. For XSLT 3.0, you should update the 'xslt3.0.rng' schema.Patrik wrote: Any other idea?
To "register" extension elements I guess I have to overwrite the xml schemas "XSL2.0Schema.xsd", ...?
I will add a feature request on our side to allow an user to customize the list proposed by the content completion assistant with custom Saxon functions or instructions.
Radu Pisoi
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 280
- Joined: Thu Nov 28, 2013 9:32 am
- Location: Hamburg/Germany
- Contact:
Re: custom functions/instructions in xslt content completion
Thanks for you efforts.
Regards,
Patrik
Regards,
Patrik
-
- Posts: 2
- Joined: Tue Aug 25, 2009 4:06 pm
Re: custom functions/instructions in xslt content completion
Any news on this ?
I would love to have the ability to define what functions are used in when completing XSLT in select="".
I have a lot of Java extension objects that defines many functions used in my stylesheets e.g.:
and
And being able to just start writing select="sql:" and then getting a list of declared functions would be very valueable.
I do not want Oxygen XML to try and find the functions directly from java code. I would like to be able to define a list of function names and arguments.
Best regards
Christoffer Bruun
I would love to have the ability to define what functions are used in when completing XSLT in select="".
I have a lot of Java extension objects that defines many functions used in my stylesheets e.g.:
Code: Select all
<xsl:if test="json:putBool($typeRoot,'singleClickExpand','true')"/>
Code: Select all
<xsl:choose>
<xsl:when test="sql:ExecuteQuery()">
<xsl:for-each select="sql:ResultSet()">
I do not want Oxygen XML to try and find the functions directly from java code. I would like to be able to define a list of function names and arguments.
Best regards
Christoffer Bruun
-
- Posts: 404
- Joined: Thu Aug 21, 2003 11:36 am
- Location: Craiova
- Contact:
Re: custom functions/instructions in xslt content completion
Post by radu_pisoi »
Hi Christoffer,
Unfortunately, this feature was not implemented yet. I will add your vote and increase its priority.
Unfortunately, this feature was not implemented yet. I will add your vote and increase its priority.
Radu Pisoi
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Return to “SDK-API, Frameworks - Document Types”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ 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