Date: Sat, 29 Dec 2018 13:54:29 +0100 From: "Kristof Provost" <kristof@sigsegv.be> To: "Mark Saad" <nonesuch@longcount.org> Cc: "Chris Torek" <torek@elf.torek.net>, "FreeBSD Hackers" <freebsd-hackers@freebsd.org> Subject: Re: libxo question Message-ID: <C56AD0EF-2ADF-470F-BD28-1DFB46A917F5@sigsegv.be> In-Reply-To: <CAMXt9Na=%2BHvdUPsmHMWC5W=FTxNPj0y7_D28PSC3a=Q9KXrkSQ@mail.gmail.com> References: <CAMXt9NZOa0CRdAB2jERK7iP3VXB367g0Y0oYaL6q893RBr3aTw@mail.gmail.com> <201812282040.wBSKeWPL023999@elf.torek.net> <CAMXt9Na=%2BHvdUPsmHMWC5W=FTxNPj0y7_D28PSC3a=Q9KXrkSQ@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 28 Dec 2018, at 23:12, Mark Saad wrote: > On Fri, Dec 28, 2018 at 3:40 PM Chris Torek <torek@elf.torek.net> > wrote: >> >>> Attached is a copy of the xml. Any guidance would be helpful. >> >> Your attachment was stripped before it got here, but the problem >> is clear enough. Procstat / libxo is generating invalid XML. >> >> Here's a bit of sample "procstat --libxo xml" output, which >> I generated locally by running >> >> procstat --libxo xml -ta >> >> and hand massaging the result: >> >> <procstat version="1"> >> <threads> >> <0> >> <process_id>0</process_id> >> <command>kernel</command> >> <threads> >> <100000> >> <thread_id>100000</thread_id> >> <thread_name>swapper</thread_name> >> <cpu>-1</cpu> >> [snip] >> >> Valid XML tags must begin with an alphabetic character or an >> underscore (see https://www.w3schools.com/xml/xml_elements.asp), >> and neither <0> nor <100000> do so. >> >> A quick workaround is to use json instead. However, libxo >> probably should "work smarter" with tags. >> >> (XML is a terrible data-encoding language because of all of its >> special rules. If you think you've found them all, watch out for >> CDATA! JSON is better but still has some issues with encoding, >> requiring that arbitrary binary data be atob or base64 encoded or >> similar.) >> >> Chris > > I updated the patch form kb to work on 12 > https://mirrors.nycbug.org/pub/patches/procstat-libxo-12-STABLE.patch > > Here is the xml output as well > https://mirrors.nycbug.org/pub/patches/procstat.xml > > This works better then before and python's xml parser, mozilla and > edge think its valid xml. > > I think this should be fixed what should we do to make it happen ? > I’ve posted https://reviews.freebsd.org/D18679 as a more generic way of addressing this. It’s quite possible that there are other users of libxo with the same problem, and this will help all of them. Regards, Kristof
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?C56AD0EF-2ADF-470F-BD28-1DFB46A917F5>
