Hi,
You mentioned a problem with the order of the elements. What type of XML content are you converting to JSON?
Follow these instructions to configure the XML to JSON transformation scenario in Oxygen:
1. Open an XML file (one that you would want to convert to JSON).
2. From the main menu invoke
Document -> Transformation -> "Configure Transformation Scenario(s)" (there's a corresponding button in the toolbar)
3. In the "
Configure Transformation Scenario(s)" dialog press
New and select "
XML transformation with XSLT" to create a new scenario.
4. Give it an appropriate name (e.g.
XML to JSON).
5. Leave the
XML URL field to its default value (
${currentFileURL}). This allows you to apply it on multiple XML files.
6. In the
XSL URL field browse for the
xml-to-json.xsl stylesheet you have saved from github.
7. In the
Transformer combo select
Saxon-PE (for XSLT 2.0).
8. In the
Output tab specify an output file in the "
Save As" field. Please note that the
"Save as" field must refer to a single file, NOT an output directory. Use the editor variables to compose a generic name instead of a fixed one.
e.g.
${cfd}/json-out/${cfn}.json
This will create in the folder where the XML (
${cfd}) is located a sub-folder named 'json-out' and place the output in a file of the same name as the input file (
${cfn}) and the '.json' extension.
9. Press OK in the editing dialog and "Save and close".
10. To apply this scenario to several XML files (batch) first add them (or their parent folder) to your Oxygen project, select them (or their folder) in the Project view and from the contextual menu (right click) choose
Transform -> "Transform with...", then select your scenario from the list and press
"Apply selected scenarios".
The transformation scenario will be applied by Oxygen separately for each XML file.
Regards,
Adrian