Json transformation fails due to default xsl files
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 12
- Joined: Fri Nov 13, 2020 9:24 pm
Json transformation fails due to default xsl files
Hello,
I am trying to publish the topics in my ditamap to a single xml or json file to be used by a help gadget that is embedded in the product. The file will contain topics that each have unique reference IDs which are used to created context-sensitive tool tips.
Anyway, I have created a new transformation DITA-OT json transformation scenario using the stock settings, but keep getting the following fatal errors:
I haven't modified any of these .xsl files.
Also, my expectation is that this would generate a single json file with all the topics. My team could just as easily use an .xml file with all the resolved topics in raw XML. Is there a better way to do this?
Thanks in advance!
I am trying to publish the topics in my ditamap to a single xml or json file to be used by a help gadget that is embedded in the product. The file will contain topics that each have unique reference IDs which are used to created context-sensitive tool tips.
Anyway, I have created a new transformation DITA-OT json transformation scenario using the stock settings, but keep getting the following fatal errors:
Code: Select all
System ID: C:\Program Files\Oxygen XML Editor 20\frameworks\dita\DITA-OT2.x\plugins\org.dita-community.common.xslt\xsl\dita-support-lib.xsl
Scenario: OxygenIntro (json)
Input file: C:\dita-tech-enablement\Oxygen-training\Class-files\5-8-2020\Jesse\OxygenIntro.ditamap
Engine name: XSLT
Severity: fatal
Description: Required item type of first argument of matches() is xs:string; supplied value has item type xs:boolean
Start location: 40:5
System ID: C:\Program Files\Oxygen XML Editor 20\frameworks\dita\DITA-OT2.x\plugins\org.dita4publishers.common.xslt\xsl\map2graphicMap.xsl
Scenario: OxygenIntro (json)
Input file: C:\dita-tech-enablement\Oxygen-training\Class-files\5-8-2020\Jesse\OxygenIntro.ditamap
Engine name: XSLT
Severity: fatal
Description: XPath syntax error at char 23 on line 345 in {relpath:toUrl($inputdir)}:
Start location: 345:7
System ID: C:\dita-tech-enablement\Oxygen-training\Class-files\5-8-2020\Jesse\OxygenIntro.ditamap
Scenario: OxygenIntro (json)
Input file: C:\dita-tech-enablement\Oxygen-training\Class-files\5-8-2020\Jesse\OxygenIntro.ditamap
Engine name: DITA-OT
Severity: fatal
Description: Transformation failed. C:\Program Files\Oxygen XML Editor 20\frameworks\dita\DITA-OT2.x\plugins\org.dita4publishers.json\build_transtype-json.xml:24: javax.xml.transform.TransformerConfigurationException: Failed to compile stylesheet. 4 errors detected.
Also, my expectation is that this would generate a single json file with all the topics. My team could just as easily use an .xml file with all the resolved topics in raw XML. Is there a better way to do this?
Thanks in advance!
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Json transformation fails due to default xsl files
Hi,
I'm not sure what the problem is, can you maybe send us (support@oxygenxml.com) a link to download the DITA OT plugin and test it on our side? Does your plugin come with Java libraries or is it pure XSLT?
About this remark:
Another option would be to use the "DITA-OT2.x/plugins/com.oxygenxml.merged" plugin which comes pre-installed and which outputs a single merged XML document. Maybe you can modify the plugin to also apply an XSLT stylesheet over the merged XML and produce the JSON.
Regards,
Radu
I'm not sure what the problem is, can you maybe send us (support@oxygenxml.com) a link to download the DITA OT plugin and test it on our side? Does your plugin come with Java libraries or is it pure XSLT?
About this remark:
One option would be to set on the main DITA Map <map> root element the "chunk='to-content'" attribute.Also, my expectation is that this would generate a single json file with all the topics. My team could just as easily use an .xml file with all the resolved topics in raw XML. Is there a better way to do this?
Another option would be to use the "DITA-OT2.x/plugins/com.oxygenxml.merged" plugin which comes pre-installed and which outputs a single merged XML document. Maybe you can modify the plugin to also apply an XSLT stylesheet over the merged XML and produce the JSON.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 12
- Joined: Fri Nov 13, 2020 9:24 pm
Re: Json transformation fails due to default xsl files
Hi Radu,
I'm using what I think is just a default transformation scenario in the toolkit. I went to Transformation Scenarios > New > DITA OT transformation > json. The thing is - I don't think I need a stylesheet because I just want the raw xml from the topics to be compiled in a single file.
Thanks!
-Jesse
I'm using what I think is just a default transformation scenario in the toolkit. I went to Transformation Scenarios > New > DITA OT transformation > json. The thing is - I don't think I need a stylesheet because I just want the raw xml from the topics to be compiled in a single file.
I'd love to learn more about this. I actually already have the chunk='to-content" attribute set on the map tag. How do I find the xml.merged transform? I don't see the option.One option would be to set on the main DITA Map <map> root element the "chunk='to-content'" attribute.
Another option would be to use the "DITA-OT2.x/plugins/com.oxygenxml.merged" plugin which comes pre-installed and which outputs a single merged XML document. Maybe you can modify the plugin to also apply an XSLT stylesheet over the merged XML and produce the JSON.
Thanks!
-Jesse
-
- Posts: 12
- Joined: Fri Nov 13, 2020 9:24 pm
Re: Json transformation fails due to default xsl files
Radu,
I'm thinking I might need to install this plug-in (in 20.1):
https://github.com/oxygenxml/dita-merged
I'm not sure how to do that though.
Thanks,
Jesse
I'm thinking I might need to install this plug-in (in 20.1):
https://github.com/oxygenxml/dita-merged
I'm not sure how to do that though.
Thanks,
Jesse
-
- Posts: 12
- Joined: Fri Nov 13, 2020 9:24 pm
Re: Json transformation fails due to default xsl files
Radu,
As followup, I was able to use the Merge DITA content to single file transform to make the xml and then the convert it to json in Oxygen (downloaded the plug-in for that). Very slick!
Thanks again for your help.
-Jesse
As followup, I was able to use the Merge DITA content to single file transform to make the xml and then the convert it to json in Oxygen (downloaded the plug-in for that). Very slick!
Thanks again for your help.
-Jesse
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Json transformation fails due to default xsl files
Hi Jesse,
Great, I should have given you more details about how to create a new merge transformation by using in the Transformation Scenario dialog "New->DITA-OT" and choosing Merge DITA content to single file so sorry about that.
Out of curiosity what are your plans with the JSON file afterwards? Do you need to obtain a very specific JSON structure and thus need to process the XML further before the conversion to JSON?
Regards,
Radu
Great, I should have given you more details about how to create a new merge transformation by using in the Transformation Scenario dialog "New->DITA-OT" and choosing Merge DITA content to single file so sorry about that.
Out of curiosity what are your plans with the JSON file afterwards? Do you need to obtain a very specific JSON structure and thus need to process the XML further before the conversion to JSON?
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 12
- Joined: Fri Nov 13, 2020 9:24 pm
Re: Json transformation fails due to default xsl files
Radu,
No worries. I might suggest, however, changing "Merge DITA content to single file" in the UI to something like, "Merge DITA content to single XML file" so that it's more clear that that's what you are doing.
The json file is going to be sitting in our company's main software build, and its contents will be called to populate little pop-up help snippets (basically tool tips), and those snippets may link out to our greater, Drupal-based (but DITA-sourced) help center. Each topic has a unique reference ID that is used to link the topic to its appropriate location in the UI.
I have passed the json file off to the development team for testing. It remains to be seen if they will need further formatting, but I will keep you posted.
Thanks again for your help!
-Jesse
No worries. I might suggest, however, changing "Merge DITA content to single file" in the UI to something like, "Merge DITA content to single XML file" so that it's more clear that that's what you are doing.

The json file is going to be sitting in our company's main software build, and its contents will be called to populate little pop-up help snippets (basically tool tips), and those snippets may link out to our greater, Drupal-based (but DITA-sourced) help center. Each topic has a unique reference ID that is used to link the topic to its appropriate location in the UI.
I have passed the json file off to the development team for testing. It remains to be seen if they will need further formatting, but I will keep you posted.
Thanks again for your help!
-Jesse
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Json transformation fails due to default xsl files
Hi Jesse,
Thanks for the feedback, I'll add an internal issue to rename the DITA to merged XML transformation type description so that it more accurately states that an XML file is obtained.
Regards,
Radu
Thanks for the feedback, I'll add an internal issue to rename the DITA to merged XML transformation type description so that it more accurately states that an XML file is obtained.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Json transformation fails due to default xsl files
Hi,
As an update, in the Oxygen 23.1 version we just released the transformation type is named "Merge DITA content to single XML file".
Regards,
Radu
As an update, in the Oxygen 23.1 version we just released the transformation type is named "Merge DITA content to single XML file".
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Return to “DITA (Editing and Publishing DITA Content)”
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