Re: [xsl] SGML to XML

Subject: Re: [xsl] SGML to XML
From: Kevin M Bray <kevin.bray@xxxxxxxxxxx>
Date: Wed, 25 Feb 2009 10:23:12 -0500
Another option is OpenSP:

http://openjade.sourceforge.net/doc/index.htm

In particular, look at the documentation on osx. I've been using this
to convert old "SGML-based" Open Financial Exchange (.ofx) files to
XML with good results.

Tip: the completeness of your DTD and SGML declaration will greatly
impact the quality of the output XML. osx will apply a default SGML
declaration if you don't specify one, but you may not get the results
you need, especially where omitted end tags and nesting are concerned.

If you need to make structural changes to the document in addtion to
converting to XML, then you could use XSLT for a subsequent XML-to-XML
step, eg:

SGML --(osx)--> "converted" XML --(XSLT)--> target XML

Kevin Bray


Quoting "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>:


At 2009-02-25 14:57 +0000, Graeme Kidd wrote:
Is it possible to convert a SGML file to XML using XSLT?

No, SGML is not a valid input to XSLT.


Currently I am using AltovaXML free XSLT 2.0 engine:
http://www.altova.com/altovaxml.html

I have a feeling it might not be able to read in SGML so does any
one have any suggestion on applications that can help me convert
SGML to XML?

There is a free one on our web site called "n2x" (for "nsgmls to XML"):


http://www.CraneSoftwrights.com/resources/#n2x

If applications like that do exist will they use XSLT to transform
or am I looking at some other language?

Some other language ... SGML is not a valid input to XSLT.


I hope this helps.

. . . . . . . . . Ken

Current Thread