createXQueryUpdateTransformer API
Post here questions and problems related to oXygen frameworks/document types.
createXQueryUpdateTransformer API
Hello,
As I can read in release note for v23 (https://www.oxygenxml.com/xml_editor/whatisnew23.0.html) the API for creating XSLT and XQuery transformers (using the XMLUtilAccess interface) can no longer be used to create processors for Saxon Professional Edition (PE) or Saxon Enterprise Edition (EE).
So I have a problem, because I have an action in my framework using ro.sync.ecss.extensions.commons.operations.JSOperation operation with the following script to chain XQueryUpdate scripts. It doesn't work anymore because I use createXQueryUpdateTransformer.
I think that a workaround can be :
- create a ro.sync.ecss.extensions.commons.operations.XQueryUpdateOperation operation for each steps
- create a ro.sync.ecss.extensions.commons.operations.ExecuteMultipleActionsOperation operation to chain them
What do you think about this workaround?
Thanks
As I can read in release note for v23 (https://www.oxygenxml.com/xml_editor/whatisnew23.0.html) the API for creating XSLT and XQuery transformers (using the XMLUtilAccess interface) can no longer be used to create processors for Saxon Professional Edition (PE) or Saxon Enterprise Edition (EE).
So I have a problem, because I have an action in my framework using ro.sync.ecss.extensions.commons.operations.JSOperation operation with the following script to chain XQueryUpdate scripts. It doesn't work anymore because I use createXQueryUpdateTransformer.
Code: Select all
function doOperation(){
//get current framework path
frameworkDir = authorAccess.getUtilAccess().expandEditorVariables("${frameworkDir}", null);
//desactivate tracking change if necessary
myReviewController = authorAccess.getReviewController();
trackingChangesState = myReviewController.isTrackingChanges();
if(trackingChangesState){
myReviewController.toggleTrackChanges();
}
//step 1
performXQueryUpdate(frameworkDir + "/actions/step1.xq");
//step 2
performXQueryUpdate(frameworkDir + "/actions/step2.xq");
//step 3
performXQueryUpdate(frameworkDir + "/actions/step3.xq");
//activate tracking change if necessary
if(trackingChangesState){
myReviewController.toggleTrackChanges();
}
}
function performXQueryUpdate(xqueryPath){
// Create an XQuery update enable processor.
queryTransformer = authorAccess.getXMLUtilAccess().createXQueryUpdateTransformer(
new Packages.javax.xml.transform.stream.StreamSource(new Packages.java.io.FileInputStream(xqueryPath)),
null);
// Create a special author model source.
s = new Packages.ro.sync.ecss.dom.wrappers.mutable.AuthorSource(authorAccess);
writer = new Packages.java.io.StringWriter();
result = new Packages.javax.xml.transform.stream.StreamResult(writer);
queryTransformer.transform(s, result);
}
- create a ro.sync.ecss.extensions.commons.operations.XQueryUpdateOperation operation for each steps
- create a ro.sync.ecss.extensions.commons.operations.ExecuteMultipleActionsOperation operation to chain them
What do you think about this workaround?
Thanks
Nicolas Delobel
AmeXio
nicolas.delobel at group.amexio.net
AmeXio
nicolas.delobel at group.amexio.net
Re: createXQueryUpdateTransformer API
Hi Nicolas,
You can probably try to build those "XQueryUpdateOperation" in the Javascript and see how that goes.
Or switch to using XSLT to process the content.
Regards,
Radu
You can probably try to build those "XQueryUpdateOperation" in the Javascript and see how that goes.
Or switch to using XSLT to process the content.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Re: createXQueryUpdateTransformer API
Hi Radu,
Thanks for these informations.
Could you say me if it's possible, in javascript, to call/execute a specific custom action using his ID?
If yes, could you provide me a sample?
Thanks.
Thanks for these informations.
Could you say me if it's possible, in javascript, to call/execute a specific custom action using his ID?
If yes, could you provide me a sample?
Thanks.
Nicolas Delobel
AmeXio
nicolas.delobel at group.amexio.net
AmeXio
nicolas.delobel at group.amexio.net
Re: createXQueryUpdateTransformer API
Hi Nicolas,
You can do that using our APIs:
but there is a problem, an action does not take parameters, an action already knows what do do depending on the caret position and on the parameters which have already been configured in its Author operations.
Regards,
Radu
You can do that using our APIs:
Code: Select all
Object action = authorAccess.getEditorAccess().getActionsProvider().getAuthorExtensionActions().get("action.id.defined.in.framework");
authorAccess.getEditorAccess().getActionsProvider().invokeAction(action);
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Re: createXQueryUpdateTransformer API
Hi Radu,
Thanks a lot for your help.
I created 3 author actions corresponding to my 3 XQuery Update steps and I call them in javascript with their ID:
Thanks a lot for your help.
I created 3 author actions corresponding to my 3 XQuery Update steps and I call them in javascript with their ID:
Code: Select all
function doOperation(){
//desactivate tracking change if necessary
myReviewController = authorAccess.getReviewController();
trackingChangesState = myReviewController.isTrackingChanges();
if(trackingChangesState){
myReviewController.toggleTrackChanges();
}
//step 1
performAction("xquery-update-step1");
//step 2
performAction("xquery-update-step2");
//step 3
performAction("xquery-update-step3");
//activate tracking change if necessary
if(trackingChangesState){
myReviewController.toggleTrackChanges();
}
}
function performAction(actionID){
// Create an action
myAction = authorAccess.getEditorAccess().getActionsProvider().getAuthorExtensionActions().get(actionID);
authorAccess.getEditorAccess().getActionsProvider().invokeAction(myAction);
}
Nicolas Delobel
AmeXio
nicolas.delobel at group.amexio.net
AmeXio
nicolas.delobel at group.amexio.net
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