Action: XSLT Operation on processing-instruction
Post here questions and problems related to oXygen frameworks/document types.
-
- Posts: 42
- Joined: Wed Jun 20, 2018 11:30 am
Action: XSLT Operation on processing-instruction
Post by pieterjan_vdw »
Processing-instructions are visible and editable via custom CSS in my custom framework.
Now I would like to add an action (reply to comments) to a custom toolbar in my custom framework. These comments are stored as processing-instructions.
The is the workflow:
I adds the extra comment but it doesn't copy the annotation-ID of the selected processing-instruction in my new processing instruction.
How can I the copy the 'annotation-id' from my selected 'processing-instruction' into my newly created 'processing instruction'?
Now I would like to add an action (reply to comments) to a custom toolbar in my custom framework. These comments are stored as processing-instructions.
The is the workflow:
- I select an existing processing-instruction in author-mode and that processing-instruction has a certain 'attribute' being annotation-id.
For example
Code: Select all
<?annotation-start text="This is an example" annotation-id="a43d6702-5b17-4f11-a4f6-a040df50c88c" author-id="pieterjan.vandenweghe" timestamp=" 1603874838266 "?>
- In my toolbar, I select the action 'Reply' based on an XSLT operation that creates a new processing-instructions with the annotation-ID added from the processing-instruction selected in step 1. The value of this annotation-ID should in this case be added to the attribute reply-referenceid.
I adds the extra comment but it doesn't copy the annotation-ID of the selected processing-instruction in my new processing instruction.
How can I the copy the 'annotation-id' from my selected 'processing-instruction' into my newly created 'processing instruction'?
Code: Select all
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema" version="2.0"
xmlns:saxon="http://saxon.sf.net/"
xmlns:oxy="http://www.oxygenxml.com/ns/author/xpath-extension-functions"
exclude-result-prefixes="oxy">
<xsl:template match="*">
<xsl:variable name="annotationid" select="saxon:get-pseudo-attribute('annotation-id')"/>
<xsl:processing-instruction name="annotation-reply">
<xsl:text>text="${ask('Enter comment', input_type, '@WKFS: ')}" </xsl:text>
<xsl:text>annotation-id="${uuid}" </xsl:text>
<xsl:text>author-id="${author.name}" </xsl:text>
<xsl:text>reply-referenceid="</xsl:text><xsl:value-of select="$annotationid"/><xsl:text>"</xsl:text>
<xsl:text>timestamp="</xsl:text>
<xsl:sequence select="
(current-dateTime() - xs:dateTime('1970-01-01T00:00:00'))
div
xs:dayTimeDuration('PT1S') * 1000"/>
<xsl:text>"</xsl:text>
</xsl:processing-instruction>
</xsl:template>
</xsl:stylesheet>
You do not have the required permissions to view the files attached to this post.
-
- Posts: 78
- Joined: Wed Jun 22, 2016 2:48 pm
Re: Action: XSLT Operation on processing-instruction
Post by adrian_sorop »
Hi!
By changing template's match to I was able to properly get the value of the pseudo attribute "annotation-id" with .
With other words, the only change I've made was and the rest of your xsl remained the same.
Let me know how this works.
Best regards,
Adrian S.
By changing template's match to
Code: Select all
processing-instruction()
Code: Select all
saxon:get-pseudo-attribute('annotation-id')
With other words, the only change I've made was
Code: Select all
<xsl:template match="processing-instruction()">
Let me know how this works.
Best regards,
Adrian S.
Adrian Sorop
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
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)
- ↳ 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