Open SVG conversion result
Post here questions and problems related to oXygen frameworks/document types.
-
- Posts: 37
- Joined: Mon Jan 23, 2017 11:20 am
Open SVG conversion result
Hi,
I' currently working on a framework for MEI (Music Encoding Initative) and I would like to include a rendering engine that generates SVGs from the XML encoding.
I tried two things so far
1) I successfully added a custom transformation scenario based on ant that executes a jar to generate the SVG and it will be opened in oxygen's text edit mode. Nevertheless it would be great to open it in Author Mode or in the SVG Viewer in order to see the image right away.
2) I defined custom Author actions that would launch the same command line call of the jar in order to generate the SVG. Is there a way to specify how to open the result of the action in oXygen. Opening it in system default is not what I want…
Many thanks!
Benjamin
I' currently working on a framework for MEI (Music Encoding Initative) and I would like to include a rendering engine that generates SVGs from the XML encoding.
I tried two things so far
1) I successfully added a custom transformation scenario based on ant that executes a jar to generate the SVG and it will be opened in oxygen's text edit mode. Nevertheless it would be great to open it in Author Mode or in the SVG Viewer in order to see the image right away.
2) I defined custom Author actions that would launch the same command line call of the jar in order to generate the SVG. Is there a way to specify how to open the result of the action in oXygen. Opening it in system default is not what I want…
Many thanks!
Benjamin
=====
oXygen XML Editor v24.1
macOS Monterey 12.3.1 Apple Silicon
oXygen XML Editor v24.1
macOS Monterey 12.3.1 Apple Silicon
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Open SVG conversion result
Hi Benjamin,
So:
I tried two things so far:
If in the "Document Type Association" preferences page you edit the "SVG" framework configuration (or you extend and edit it) you can force set the "Initial edit mode".
Unfortunately for ANT-based transformation scenarios we do not have an option in the "Output" tab to open a certain file in the Oxygen image previewer.
You can also force the open to be done in the Oxygen internal Image Preview view:
because otherwise the SVG is opened as regular XML content in the main editing area.
Also if you plan to create your own custom view to render the SVG, for ours we use the "org.apache.batik.swing.gvt.JGVTComponent" component included in the Batik libraries which are already shipped with Oxygen. Probably on the Apache Batik web site you can see samples for loading SVG images in these "JGVTComponent"'s.
Regards,
Radu
So:
So somehow convert XML to an SVG which shows the sheet music equivalent? Nice idea.I' currently working on a framework for MEI (Music Encoding Initative) and I would like to include a rendering engine that generates SVGs from the XML encoding.
I tried two things so far:
Somehow by default SVGs open in Oxygen in the Text editing mode.1) I successfully added a custom transformation scenario based on ant that executes a jar to generate the SVG and it will be opened in oxygen's text edit mode. Nevertheless it would be great to open it in Author Mode or in the SVG Viewer in order to see the image right away.
If in the "Document Type Association" preferences page you edit the "SVG" framework configuration (or you extend and edit it) you can force set the "Initial edit mode".
Unfortunately for ANT-based transformation scenarios we do not have an option in the "Output" tab to open a certain file in the Oxygen image previewer.
Actually we also have API to run pre-configured transformation scenarios like authorAccess.getEditorAccess().runTransformationScenarios(allNames, null);. So your custom author action could also invoke the pre-configured scenario and after it finishes maybe it could use our API to open the SVG in the main editing area, imposing also the Author editing page for it:2) I defined custom Author actions that would launch the same command line call of the jar in order to generate the SVG. Is there a way to specify how to open the result of the action in oXygen. Opening it in system default is not what I want…
Code: Select all
authorAccess.getEditorAccess().runTransformationScenarios(allNames, new TransformationFeedback() {
@Override
public void transformationStopped() {
//
}
@Override
public void transformationFinished(boolean success) {
PluginWorkspaceProvider.getPluginWorkspace().open(...., EditorPageConstants.PAGE_AUTHOR);
}
});
Code: Select all
authorAccess.getWorkspaceAccess().open(new URL("file:/D:/path/to/svg/batik3D.svg"), null, "application/image");
Also if you plan to create your own custom view to render the SVG, for ours we use the "org.apache.batik.swing.gvt.JGVTComponent" component included in the Batik libraries which are already shipped with Oxygen. Probably on the Apache Batik web site you can see samples for loading SVG images in these "JGVTComponent"'s.
Regards,
Radu
Radu Coravu
<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