Is it possible to display inline documentation for custom XPath/XSLT functions?
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 7
- Joined: Wed Jan 11, 2017 12:26 pm
Is it possible to display inline documentation for custom XPath/XSLT functions?
When you enter a function from the standard XPath library in XSLT, a pop-up appears with syntax rules and a brief explanation. Where is this documentation coming from, and is it possible to add documentation for my custom functions?
Thanks.
Thanks.
-
- Posts: 9446
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Is it possible to display inline documentation for custom XPath/XSLT functions?
Hi,
We have some XML configuration files in the main Oxygen library which provide annotations for each XSLT function.
About your custom XSLT functions, are they defined as xsl:functions in the XSLT stylesheet or are they defined in Java extensions?
Regards,
Radu
We have some XML configuration files in the main Oxygen library which provide annotations for each XSLT function.
About your custom XSLT functions, are they defined as xsl:functions in the XSLT stylesheet or are they defined in Java extensions?
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 7
- Joined: Wed Jan 11, 2017 12:26 pm
Re: Is it possible to display inline documentation for custom XPath/XSLT functions?
Hi,
These would be simple xsl:function elements that I would put in an XSL file.
Are these .xml files located in a folder somewhere or would I need to dig in a java archive?
Thanks.
These would be simple xsl:function elements that I would put in an XSL file.
Are these .xml files located in a folder somewhere or would I need to dig in a java archive?
Thanks.
-
- Posts: 9446
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Is it possible to display inline documentation for custom XPath/XSLT functions?
Hi,
So:
Oxygen should pick up the documentation and use it when proposing the function in the content completion window.
Right now it does not do that so I added an improvement request for it in our internal issues list.
You can extract such a file (for example xpath-30-functions.xml) outside of Oxygen, and if in the "OXYGEN_INSTALL_DIR\lib\" folder you create a folder structure like this "endorsed/builtin/xsl-annotations/functions/xpath-30-functions.xml", Oxygen should prefer loading the XML from the external location instead of its main JAR library.
Also I'm not sure if just adding the function description there will work or not, this needs to be tested.
Regards,
Radu
So:
Ideally if the xsl:function would have documentation above it like:These would be simple xsl:function elements that I would put in an XSL file.
Code: Select all
<xsldoc:doc xmlns:xsldoc="http://www.oxygenxml.com/ns/doc/xsl">
<xsldoc:desc>Add two params</xsldoc:desc>
<xsldoc:param name="p1">The first param</xsldoc:param>
<xsldoc:param name="p2">The second param</xsldoc:param>
</xsldoc:doc>
<xsl:function name="abc:add" xmlns:abc="ns">
<xsl:param name="p1"/>
<xsl:param name="p2"/>
<xsl:value-of select="$p1 + $p2"/>
</xsl:function>
Right now it does not do that so I added an improvement request for it in our internal issues list.
Dig in the main JAR library I'm afraid, open the main "OXYGEN_INSTALL_DIR\lib\oxygen.jar", look for the folder "builtin/xsl-annotations/functions" and it has XML files used depending on the XSLT version.Are these .xml files located in a folder somewhere or would I need to dig in a java archive?
You can extract such a file (for example xpath-30-functions.xml) outside of Oxygen, and if in the "OXYGEN_INSTALL_DIR\lib\" folder you create a folder structure like this "endorsed/builtin/xsl-annotations/functions/xpath-30-functions.xml", Oxygen should prefer loading the XML from the external location instead of its main JAR library.
Also I'm not sure if just adding the function description there will work or not, this needs to be tested.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 7
- Joined: Wed Jan 11, 2017 12:26 pm
Re: Is it possible to display inline documentation for custom XPath/XSLT functions?
Hi Radu,
I tried adding an extra function to the XML file in the JAR, and that does seem to work.
But that's obviously far from convenient, so I'll either wait until the proposed fix is added, or find an alternative way of documenting my things.
Thanks.
I tried adding an extra function to the XML file in the JAR, and that does seem to work.
But that's obviously far from convenient, so I'll either wait until the proposed fix is added, or find an alternative way of documenting my things.
Thanks.
-
- Posts: 9446
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Is it possible to display inline documentation for custom XPath/XSLT functions?
Hi,
Agreed. You could start documenting your functions and template using the xd:doc notation:
https://www.oxygenxml.com/doc/versions/ ... pport.html
and at least Oxygen will help you generate HTML documentation from your XSLT (Tools->Generate Documentation) so that you can share it with others.
Regards,
Radu
Agreed. You could start documenting your functions and template using the xd:doc notation:
https://www.oxygenxml.com/doc/versions/ ... pport.html
and at least Oxygen will help you generate HTML documentation from your XSLT (Tools->Generate Documentation) so that you can share it with others.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 9446
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Is it possible to display inline documentation for custom XPath/XSLT functions?
Hi,
Just to update this thread, we released Oxygen XML Editor version 20 and it should present the documentation for functions in the content completion window based on the xs:doc annotations.
Regards,
Radu
Just to update this thread, we released Oxygen XML Editor version 20 and it should present the documentation for functions in the content completion window based on the xs:doc annotations.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
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