XSLT Stylesheet Component Documentation Support
Oxygen XML Developer Eclipse plugin offers built-in support for documenting XSLT stylesheets. If the
expanded QName of the element has a
non-null namespace URI, the <xsl:stylesheet>
element may contain any element
not from the XSLT namespace. Such elements are referenced as user-defined data elements. Such
elements can contain the documentation for the stylesheet and its elements (top-level elements
whose names are in the XSLT namespace). Oxygen XML Developer Eclipse plugin offers its own XML schema that
defines such documentation elements. The schema is named
stylesheet_documentation.xsd and can be found in [OXYGEN_INSTALL_DIR]/frameworks/stylesheet_documentation. The user can also specify a custom schema
in XSL Content Completion
options.
Content Completion
When content completion is invoked inside an XSLT editor by pressing Ctrl + Space, it offers elements from the XSLT documentation schema (either the built-in one or one specified by user).
Adding Documentation Blocks
In Text mode, to add documentation blocks, press Ctrl + Alt + D (Command + Option + D on macOS) or select Add component documentation from the contextual menu.
If the cursor is positioned inside the <xsl:stylesheet>
element context,
documentation blocks are generated for all XSLT elements. If the cursor is positioned inside
a specific XSLT element (such as a template or function), a documentation block is generated
for that element only.
<xd:doc>
<xd:desc>
<xd:p>Search inside parameter <xd:i>string</xd:i>
for the last occurrence of parameter
<xd:i>searched</xd:i>. The substring starting from the 0 position
to the identified last occurrence will be returned.
<xd:ref name="f:substring-after-last" type="function"
xmlns:f="http://www.oxygenxml.com/doc/xsl/functions">See also
</xd:ref>
</xd:p>
</xd:desc>
<xd:param name="string">
<xd:p>String to be analyzed</xd:p>
</xd:param>
<xd:param name="searched">
<xd:p>Marker string. Its last occurrence will be identified</xd:p>
</xd:param>
<xd:return>
<xd:p>A substring starting from the beginning of <xd:i>string</xd:i>
to the last occurrence of <xd:i>searched</xd:i>.
If no occurrence is found an empty string will be returned.
</xd:p>
</xd:return>
</xd:doc>
XSLT Documentation Links
Oxygen XML Developer Eclipse plugin includes support for links inside XSLT documentation blocks. Using a
construct like <xd:a docid="user-defined-id">TEXT</xd:a>
will cause
the browser to scroll to the particular anchor (the defined ID) in the current document.
Using a construct like <xd:a
href="http://www.my-web-site">TEXT</xd:a>
or <xd:a
href="local-file-path/filename">TEXT</xd:a>
will open the referenced link in a
new tab.
Example: Documentation Links
<xd:doc xmlns:xd="http://www.oxygenxml.com/ns/doc/xsl" id="thisDoc">
<xd:desc>
<xd:p>
<xd:ref name="test" type="variable">My test variable</xd:ref>
<xd:a docid="thisDoc">Link to this documentation, see
the the id="thisDoc" above</xd:a>
<xd:a docid="otherDocID" href="included.xsl">Link to
otherDocID defined in included.xsl</xd:a>
</xd:p>
</xd:desc>
</xd:doc>