libxo question
Mark Saad
nonesuch at longcount.org
Fri Dec 28 22:12:57 UTC 2018
On Fri, Dec 28, 2018 at 3:40 PM Chris Torek <torek at 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 ?
--
mark saad | nonesuch at longcount.org
More information about the freebsd-hackers
mailing list