Mail Archives: geda-user/2015/09/14/07:04:18
This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
--8323329-454723429-1442228614=:2811
Content-Type: TEXT/PLAIN; format=flowed; charset=UTF-8
Content-Transfer-Encoding: 8BIT
On Sat, 12 Sep 2015, DJ Delorie wrote:
> Scripts wouldn't *need* to use pcb's parser, they could use any old
> parser library, since the scripts already know what the parts of the
> schema they're interested in look like. Read file, fiddle with the
> parts you know, write file leaving everything else intact.
That's easier said than done. With an XML file, you have basically no
choice but to use an existing parser library; the format is just too
complex (and XML parser bugs are a popular exploit vector). But these
parsers aren't designed to tell you which parts of the file are which so
you would know what to change. You could, of course, write the parsed
data back into an XML, but to do that without losing information, you
would again need context information about the file format which you want
to avoid in the first place. For example, you would need to know in which
parts of the file whitespace is significant so you can add or remove tags
while still keeping the file human-readable. And there are XML processing
instructions, CDATA sections, and so on…
--8323329-454723429-1442228614=:2811--
- Raw text -