oxy:current-element()
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 93
- Joined: Fri Mar 08, 2013 8:58 am
oxy:current-element()
The very helpful instructions at Built-in Author Mode Operations > XSLTOperation and XQueryOperation advises the use of oxy:current-element(), but I can't replicate the code example there without an error both in the XSLT (Cannot find a 0-argument function named Q{http://www.oxygenxml.com/ns/author/xpat ... nt-element()) and in the XML being edited in Author mode (Couldn't execute operation: 'ro.sync.ecss.extensions.commons.operations.XSLTOperation'
for action: 'Get LM data' because of:
class java.lang.RuntimeException - Internal error evaluating template rule at line 12 in module)
I'm sure there must be a setting or parameter that's missing, but the documentation doesn't tell me where to look. The zero-arity function doesn't show up anywhere else in the Web documentation.
for action: 'Get LM data' because of:
class java.lang.RuntimeException - Internal error evaluating template rule at line 12 in module)
I'm sure there must be a setting or parameter that's missing, but the documentation doesn't tell me where to look. The zero-arity function doesn't show up anywhere else in the Web documentation.
-
- Posts: 1016
- Joined: Wed Nov 16, 2005 11:11 am
Re: oxy:current-element()
Post by alex_jitianu »
Hello,
The oxy:current-element() was introduced in Oxygen version 21. What Oxygen version are you running?
Best regards,
Alex
The oxy:current-element() was introduced in Oxygen version 21. What Oxygen version are you running?
Best regards,
Alex
-
- Posts: 1016
- Joined: Wed Nov 16, 2005 11:11 am
Re: oxy:current-element()
Post by alex_jitianu »
Hello,
With want type of documents are you working? Have you customized a built-in framework, like the DITA framework, by editing the framework resources?
Each framework has a jar file with specific operations as well as the common operations, like the XSLTOPeration. If you've customized a built-in framework from an older version of Oxygen and didn't update this jar file (as well as other resources) when you migrated to a newer Oxygen version, then you don't have the newer, updated author operations. To see if this is the case, copy dita.jar (if your framework is DITA) from a pristine Oxygen into your framework and replace the existing one.
Actually, it is recommended to extend a framework (either from the GUI or with an extension script)so that when you pass to a newer Oxygen version the merging is done automatically.
Best regards,
Alex
With want type of documents are you working? Have you customized a built-in framework, like the DITA framework, by editing the framework resources?
Each framework has a jar file with specific operations as well as the common operations, like the XSLTOPeration. If you've customized a built-in framework from an older version of Oxygen and didn't update this jar file (as well as other resources) when you migrated to a newer Oxygen version, then you don't have the newer, updated author operations. To see if this is the case, copy dita.jar (if your framework is DITA) from a pristine Oxygen into your framework and replace the existing one.
Actually, it is recommended to extend a framework (either from the GUI or with an extension script)so that when you pass to a newer Oxygen version the merging is done automatically.
Best regards,
Alex
-
- Posts: 93
- Joined: Fri Mar 08, 2013 8:58 am
Re: oxy:current-element()
I have been able to replicate the oxy:current-element() example by creating a fresh project, a fresh external frameworks file, and a fresh author action. A second new author action based upon the XSLT that was giving my other external frameworks file problems also works fine.
Now, staying within the same fresh project, I tried to replicate the successful author action but as a part of the other external frameworks file. I got the familiar compile error.
So clearly this problem is related not to the project or to the XSLT file but to the external frameworks file. I've visually inspected the two frameworks files, which are just XML, and I can't see any mechanism that would dictate different results. Is it something in my global settings? Any other ideas? How does an external frameworks file get handled?
By the way, in the successful author action XSLT file, the line <xsl:apply-templates select="oxy:current-element()"/> is marked as invalid within Oxygen, even though it successfully drives the Author action.
Now, staying within the same fresh project, I tried to replicate the successful author action but as a part of the other external frameworks file. I got the familiar compile error.
So clearly this problem is related not to the project or to the XSLT file but to the external frameworks file. I've visually inspected the two frameworks files, which are just XML, and I can't see any mechanism that would dictate different results. Is it something in my global settings? Any other ideas? How does an external frameworks file get handled?
By the way, in the successful author action XSLT file, the line <xsl:apply-templates select="oxy:current-element()"/> is marked as invalid within Oxygen, even though it successfully drives the Author action.
-
- Posts: 1016
- Joined: Wed Nov 16, 2005 11:11 am
Re: oxy:current-element()
Post by alex_jitianu »
Hello,
Can you send me this problematic external framework on support@oxygenxml.com to have a look at it? Perhaps the project as well.
Best regards,
Alex
This extension function is installed only in the context of author actions, so its normal not to be recognized in an opened editor.By the way, in the successful author action XSLT file, the line <xsl:apply-templates select="oxy:current-element()"/> is marked as invalid within Oxygen, even though it successfully drives the Author action.
Can you send me this problematic external framework on support@oxygenxml.com to have a look at it? Perhaps the project as well.
Best regards,
Alex
-
- Posts: 93
- Joined: Fri Mar 08, 2013 8:58 am
Re: oxy:current-element()
Hi Alex, I figured it out.
An XML file with comments, process instructions, or CData appears to trip up the evalutaion of oxy:current-element().
Suppose a root element that wraps one comment followed by two elements. The cursor is in the first child element. When the action is applied, the second child element gets evaluated.
Now, inside that second child element create a new child element and put the cursor inside. When the author action is evaluated, you will get a compile/evaluation error.
If you remove the comment, the author action will perform as expected.
The errors above can be replicated by changing the comment with a processing instruction or CData.
An XML file with comments, process instructions, or CData appears to trip up the evalutaion of oxy:current-element().
Suppose a root element that wraps one comment followed by two elements. The cursor is in the first child element. When the action is applied, the second child element gets evaluated.
Now, inside that second child element create a new child element and put the cursor inside. When the author action is evaluated, you will get a compile/evaluation error.
If you remove the comment, the author action will perform as expected.
The errors above can be replicated by changing the comment with a processing instruction or CData.
-
- Posts: 1016
- Joined: Wed Nov 16, 2005 11:11 am
Re: oxy:current-element()
Post by alex_jitianu »
Hi,
Good catch! I've manage to reproduce the the problem and I've recorded an issue. We will let you know as soon as we release a version that contains the fix.
Best regards,
Alex
Good catch! I've manage to reproduce the the problem and I've recorded an issue. We will let you know as soon as we release a version that contains the fix.
Best regards,
Alex
-
- Posts: 1016
- Joined: Wed Nov 16, 2005 11:11 am
Re: oxy:current-element()
Post by alex_jitianu »
Hi,
Until we fix this situation, you can try using a different operation, like JSOperation, which has access to the current element and more by using the Java API.
Best regards,
Alex
Until we fix this situation, you can try using a different operation, like JSOperation, which has access to the current element and more by using the Java API.
Best regards,
Alex
-
- Site Admin
- Posts: 125
- Joined: Wed Dec 12, 2018 5:33 pm
Re: oxy:current-element()
Post by Cosmin Duna »
Hello,
I just wanted to let you know that Oxygen 24.0 is out now and it contains a fix for the issue you reported on this thread.
Best regards,
Cosmin
I just wanted to let you know that Oxygen 24.0 is out now and it contains a fix for the issue you reported on this thread.
Best regards,
Cosmin
Cosmin Duna
<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)
- ↳ 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