Ditamap error says invalid element name in yaml file
Having trouble installing Oxygen? Got a bug to report? Post it all here.
Ditamap error says invalid element name in yaml file
Hi, we have a ditamap to include Swagger content in our docs through yaml files. In Oxygen one of the yaml files (Files.yaml) is causing the following error and we've no idea why it's different to the rest. Please can you explain what the following error means?
Here's a snippet from the map:
<topicref href="MSDK/r_rest_catalog.dita#files" toc="yes" linking="none"
navtitle="Files API" format="dita"/>
<topicref format="openapi-to-dita" href="MSDK/json/Files.yaml" toc="no" linking="none"/>
- Yaml_error.png (75.96 KiB) Viewed 1180 times
<topicref href="MSDK/r_rest_catalog.dita#files" toc="yes" linking="none"
navtitle="Files API" format="dita"/>
<topicref format="openapi-to-dita" href="MSDK/json/Files.yaml" toc="no" linking="none"/>
-
- Site Admin
- Posts: 123
- Joined: Wed Dec 12, 2018 5:33 pm
Re: Ditamap error says invalid element name in yaml file
Post by Cosmin Duna »
Hi,
When you include these topic references to non-DITA documents, Oxygen converts them into the background for presenting the titles in the DITA map tree.
Could you try to convert the document to DITA using the OpenAPI to DITA conversion from the Batch Documents Converter add-on: https://www.oxygenxml.com/doc/versions/ ... addon.html? You should uncheck the "Create DITA maps from OpenAPI documents" option from the conversion dialog to obtain the same result as in the background conversion.
And after that, could you try to validate the resulting DITA document and send us the errors you found? I expected to be a problem in our conversion.
Best regards,
Cosmin
When you include these topic references to non-DITA documents, Oxygen converts them into the background for presenting the titles in the DITA map tree.
Could you try to convert the document to DITA using the OpenAPI to DITA conversion from the Batch Documents Converter add-on: https://www.oxygenxml.com/doc/versions/ ... addon.html? You should uncheck the "Create DITA maps from OpenAPI documents" option from the conversion dialog to obtain the same result as in the background conversion.
And after that, could you try to validate the resulting DITA document and send us the errors you found? I expected to be a problem in our conversion.
Best regards,
Cosmin
Cosmin Duna
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Re: Ditamap error says invalid element name in yaml file
Hello Cosmin, I tried following your instructions. It created the output folder but no files. A message flashed up and disappeared too quickly to read. So I'm attaching the Files.yaml file here in a zip.
By the way, I tried running the batch converter on another yaml file that doesn't cause problems, but that also produced no output.
By the way, I tried running the batch converter on another yaml file that doesn't cause problems, but that also produced no output.
- Files.yaml.zip
- (2.97 KiB) Downloaded 180 times
Last edited by AnnetteSo on Thu Mar 02, 2023 7:34 pm, edited 1 time in total.
-
- Site Admin
- Posts: 123
- Joined: Wed Dec 12, 2018 5:33 pm
Re: Ditamap error says invalid element name in yaml file
Post by Cosmin Duna »
Hi,
Thank you for this sample. I analyzed it and the conversion problem is caused by the "*/*" MIME type. The converter tries to create an XML element with an invalid name without escaping the "*" character.
I registered an internal issue for this and the fix will be included in the next version of Oxygen (25.1) that will be released in the following weeks.
I also have a workaround for this. Please follow these steps:
Best regards,
Cosmin
Thank you for this sample. I analyzed it and the conversion problem is caused by the "*/*" MIME type. The converter tries to create an XML element with an invalid name without escaping the "*" character.
I registered an internal issue for this and the fix will be included in the next version of Oxygen (25.1) that will be released in the following weeks.
I also have a workaround for this. Please follow these steps:
- Open the following jar file into the "Archive Browser" view from Oxygen: "Oxygen_installation_directory\frameworks\dita\DITA-OT3.x\plugins\com.oxygenxml.dynamic.resources.converter\lib\oxygen-batch-converter-core.jar"
- In the view, search for the "stylesheets/open-api/openAPI_v2.0_to_v3.0.xsl" file and open it in the main editor
- Replace the function named "f:escapeInvalidCharsFromMimeTypes" from line 183 with this one:
Code: Select all
<xsl:function name="f:escapeInvalidCharsFromMimeTypes" as="xs:string"> <xsl:param name="toEscape" as="xs:string"/> <xsl:variable name="aux0" select="replace(xs:string($toEscape), '/', '_X2f_')"/> <xsl:variable name="aux1" select="replace($aux0, '\+', '_X2b_')"/> <xsl:variable name="aux2" select="replace($aux1, ' ', '_X20_')"/> <xsl:variable name="aux3" select="replace($aux2, ';', '_X3b_')"/> <xsl:variable name="aux4" select="replace($aux3, '=', '_X3d_')"/> <xsl:variable name="aux5" select="replace($aux4, '\*', '_X2a_')"/> <xsl:value-of select="$aux5"/> </xsl:function>
- Save the document and restart Oxygen
Best regards,
Cosmin
Cosmin Duna
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Site Admin
- Posts: 123
- Joined: Wed Dec 12, 2018 5:33 pm
Re: Ditamap error says invalid element name in yaml file
Post by Cosmin Duna »
Hi,
As an update, we released Oxygen 25.1 and it contains a fix for this problem.
Best regards,
Cosmin
As an update, we released Oxygen 25.1 and it contains a fix for this problem.
Best regards,
Cosmin
Cosmin Duna
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
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