Re: Add JSON, XML, CSV to Baby X resource compiler

Liste des GroupesRevenir à l c 
Sujet : Re: Add JSON, XML, CSV to Baby X resource compiler
De : bc (at) *nospam* freeuk.com (bart)
Groupes : comp.lang.c
Date : 20. May 2024, 21:27:15
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v2g86i$53en$1@dont-email.me>
References : 1 2 3
User-Agent : Mozilla Thunderbird
On 20/05/2024 17:14, Scott Lurndal wrote:
bart <bc@freeuk.com> writes:
On 19/05/2024 11:16, Malcolm McLean wrote:
The Baby X resource compiler takes data - fonts, images, audio, strings
- and converts them into C source so that they can be read by C programs
without relying on external data files.
>
An obvious extension is to take in structured data. Adding SQL and
querying a database would unfortuately mean extending the program so
that it could only run on a large machine with a SQL server running, and
isn't really a viable proposition. However JSON, XML, and CSV are
commonly used to pass small to medium amounts of data about.
>
I've made a start on supporting CSV with the "<dataframe>" tag. CSV data
is tabular and two dimensional, and lends itself to an arrray of simple
structures. JSON And XML can of course represent more complex data, with
hierarchy. The dataframe tag is still very experimental. I've never used
it for anything practical.
>
So what would be the best approach to putting in JSON and XML support?
>
I've only briefly used XML.
 That's clear from what you write below.
I have enough experience to know that it CAN represent disparate data just like I said, since I've had to generate exactly such files as input into another application that required such data.

Even if the file does represent a simple list of records for example,
you won't know that without reading it and analysing it.
 Study XML Schema.
I have no interest in studying XML or every using again. I already stated in an earlier post that it's more complicated than it looks.
    https://en.wikipedia.org/wiki/XML_Schema_(W3C)
 Then study XSL.     https://en.wikipedia.org/wiki/XSLT
 XML is a markup language.   A subset of SGML.  HTML is a non-proper
and non-regular subset of XML.
 It's far more flexible and useful than a set of comma-separated-values.
And, therefore, 'chaotic' it what can be represented, even if technically it can be described by a recursively defined syntax.
Or you need to know is that XML can represent the syntactic structure of most programming languages, and we all know how easy that is to represent as a fixed set of initialised C data structures hardcoded into a source file.

>
I looked online at an XML to CSV converter, which I thought would do
something clever, but it seems to just turn each XML line into one
string per line.
 You use stylesheets (XSL) with a stylesheet processor to make
arbitrary transformations to an XML document.  The output can
be XML, HTML, CSV, or any custom format required for an application.
The OP wanted to be able to directly process XML; I suggest that it first be transformed into something more regular.

Date Sujet#  Auteur
19 May 24 * Add JSON, XML, CSV to Baby X resource compiler10Malcolm McLean
20 May 24 `* Re: Add JSON, XML, CSV to Baby X resource compiler9bart
20 May 24  +- Re: Add JSON, XML, CSV to Baby X resource compiler1Michael S
20 May 24  +* Re: Add JSON, XML, CSV to Baby X resource compiler3Mikko
20 May 24  i`* Re: Add JSON, XML, CSV to Baby X resource compiler2Malcolm McLean
21 May 24  i `- Re: Add JSON, XML, CSV to Baby X resource compiler1Mikko
20 May 24  `* Re: Add JSON, XML, CSV to Baby X resource compiler4bart
21 May 24   +* Re: Add JSON, XML, CSV to Baby X resource compiler2Malcolm McLean
22 May 24   i`- Re: Add JSON, XML, CSV to Baby X resource compiler1Ben Bacarisse
25 May 24   `- Re: Add JSON, XML, CSV to Baby X resource compiler1Malcolm McLean

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal