Re: [xml-dev] XML -> SGML serialization. Any ideas ?

From
Tony Graham <>
To
Date
2018-07-13T10:07:38Z
ID
<>
Thread
Re: [xml-dev] XML -> SGML serialization. Any ideas ?
On 13/07/2018 11:00, Christophe Marchand wrote:
> I have to give data to a very old application, which can only read SGML.
> 
> My data structure is really simple (records of filename, title), but 

I hope that you don't have any empty elements.

> contains characters that are not ASCII. So I have to translate them to 
> use entities (I think SGML has a set of declared entities for characters 
> with accents, as &eacute;, @agrave;, and so on).
> 
> I'd like the file could be read by XML parsers too, and I'm looking for 
> a method to produce an XML that is also SGML. I think to use XSL with 
> characters map, but how could I define the embeded DTD, with all 
> entities defined ?

Use the "XML Entity Definitions for Characters":
https://www.w3.org/TR/xml-entity-names/

It also has an XSLT2 stylesheet for mapping from Unicode characters to
entity references.

Regards,


Tony Graham.
-- 
Senior Architect
XML Division
Antenna House, Inc.
----
Skerries, Ireland