Re: [xml] Is there a solution to have newline delimited output for xmllint ?



I have a program I pre-process and post-process all my XML.  One of the main
thing it does is fix CR/LF versus CR versus LF ... in some cases where
people send me XML all in one string (UGLY) I simply load it and write it
back out with libxml2 ... now it is formatted pretty with correct CR/LF :-)

Often it is easier to work around a problem than try and get the kitchen
sink into something like libxml2.  Particularly since in our case we have
customers doing it every way it is possible and some that are not.  One
company (a big box) puts attributes all crammed together with no white space
(should be a space between each attribute) -- we can't change them so my
pre-processor does it.  Another puts & at the end of each line (I expect
their software has a black box to output and they are doing it as if it was
a URL which use & as a separator).  Yeah -- they become LF on our Unix box.
We even wrote ours to accept any case mix (because they are too dumb to read
specs and see orderNumber instead of OrderNumber -- as long as the XML is
valid we just ignore case on the test.  Saves a lot of support calls.  With
thousands of customers sending in XML I think I've seen most boneheaded
things and just fixing it to allow for boneheads reduces support a lot!

I do have a standalone program to do the CR/LF stuff and XML formatting ...
you are welcome to it.  It won't work directly because it uses some
libraries I have I can't easily separate out -- but you could easily figure
it out (example we have a function to read command line switches as probably
everyone does).

Let me know if you want it.

Eric

-----Original Message-----
From: xml [mailto:xml-bounces gnome org] On Behalf Of
gilles quenot sputnick fr
Sent: Sunday, September 23, 2018 6:13 AM
To: Nick Wellnhofer <wellnhofer aevum de>
Cc: xml gnome org
Subject: Re: [xml] Is there a solution to have newline delimited output for
xmllint ?

On 20/03/2018 16:45, Nick Wellnhofer wrote:
This should be resolved now:


https://gitlab.gnome.org/GNOME/libxml2/commit/da35eeae5b92b88d8ebdb64b
4b327ac1c2cf1bce


Nice, thanks.

This is the official libxml repository I guess(?).

Do you know if a Debian package will be packaged ?

I will contact Archlinux mainteners to update package, last update 2016.

Regards,
Gilles Quenot
_______________________________________________
xml mailing list, project page  http://xmlsoft.org/ xml gnome org
https://mail.gnome.org/mailman/listinfo/xml




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]