Custom XML to Responsive Webhelp Index Page discarding HTML entities

Post here questions and problems related to editing and publishing DITA content.
remip
Posts: 6
Joined: Thu Jan 18, 2018 5:47 pm

Custom XML to Responsive Webhelp Index Page discarding HTML entities

Post by remip »

Hello,
We are using custom XML fragment files when producing responsible webhelp with the oXygen webhelp plugin (19.1).
Unfortunately, it seems that the HTML entities either are discarded or prevent the parsing of the file.

By default, our localization software will convert any special characters to HTML entities to avoid malformed code in XML files.
Oxygen not parsing these entities is therefore an issue.

For instance:
  • > is discarded and the content is displayed without the ">" character

    Code: Select all

    「<b>ヘルプ > 最新情報</b>」より、いつでもご覧になれます。</p> 
  • &ndash; prevents the file to be rendered

    Code: Select all

    <p>© 2013&ndash;2017
Do you plan to expand the support for HTML entities in the XML fragments?

Regards,
Rémi
alin
Site Admin
Posts: 268
Joined: Thu Dec 24, 2009 11:21 am

Re: Custom XML to Responsive Webhelp Index Page discarding HTML entities

Post by alin »

Hello,

The XML fragment files should be well-formed in order to be parsed by the WebHelp Plugin. The only entities allowed in an well-formed XML file are the predefined entities ("&", "&apos;", """ , ">", "<") and the character entities ("&# decimal number ;" or "&#x Hexadecimal number ;").
The HTML entities you are referring to are named entities and they must be declared in the document prolog or in a DTD file in order for an XML parser to be able to recognize them.
For example if you want to use the "&ndash;" entity your XML fragment should look like this:

Code: Select all


<!DOCTYPE fragment [
<!ENTITY ndash "-">
]>
<p>© 2013&ndash;2017</p>
For more about XML Well-Formedness you may read this article from our User Guide: https://www.oxygenxml.com/doc/ug-editor ... formedness

Regards,
Alin
Alin Balasa
Software Developer
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply