Re: [xsl] Correcting misplaced spaces in XML documents

Subject: Re: [xsl] Correcting misplaced spaces in XML documents
From: "Liam R. E. Quin liam@xxxxxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 27 Mar 2023 21:39:26 -0000
On Mon, 2023-03-27 at 20:00 +0000, Eliot Kimber
eliot.kimber@xxxxxxxxxxxxxx wrote:
>
> You can also use XQuery databases like BaseX to do the updating but
> that takes a bit more work to set up the writing of the result back
> out and the database may not always preserve all the document details
> the way Oxygen or Saxon will.

You don't have to use a database - or even have a database server
running - to use BaseX for this. Although if you do ahve a server
running, you can avoid the Java runtime startup time, of course.

Just use doc() and, if needed, file:write() and serialize().

I think these days BaseX no longer strips whitespace-only text nodes by
default, thankfully.

liam


--
Liam Quin,B https://www.delightfulcomputing.com/
Available for XML/Document/Information Architecture/XSLT/
XSL/XQuery/Web/Text Processing/A11Y training, work & consulting.
Barefoot Web-slave, antique illustrations: B http://www.fromoldbooks.org

Current Thread