createXQueryUpdateTransformer API
Posted: Tue Mar 09, 2021 12:27 pm
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