Re: [xsl] Combining entity references into a single document

Subject: Re: [xsl] Combining entity references into a single document
From: "Peter Flynn peter@xxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 3 Dec 2021 18:07:06 -0000
On 03/12/2021 17:25, rick@xxxxxxxxxxxxxx wrote:> I have an XML document
generated from an Adobe FrameMaker book. It
> creates multiple XML files and refers to them with entities in the
> main XML file. Is there an XSLT 3 mechanism for combining everything
> into a single XML document? Any pointers would be appreciated.

As Michael describes, this is the job of a parser.

The old osgmlnorm utility (part of the opensp package) does exactly
this. Assuming your file is called main.xml, you can type

$ osgmlnorm -wxml sgmlxml.dec main.xml

The -wxml switches from SGML to XML, and you will need a copy of the
SGML Declaration for XML (there's a copy at
http://xml.silmaril.ie/downloads/sgmlxml.dec if you can't find one
elsewhere).

This will write to standard output, so you can redirect it into a file
or a subsequent process.

Downside: it IS a normalizer, so all REQUIRED attributes will be
included, but the output will be a single XML file.

Peter

Current Thread