BIND segway -> python -> first-class ports

Daniel O'Connor doconnor at gsoft.com.au
Thu Dec 12 07:07:38 UTC 2013


On 12 Dec 2013, at 17:32, Teske, Devin <Devin.Teske at fisglobal.com> wrote:
> On Dec 11, 2013, at 9:46 PM, Daniel O'Connor wrote:
>> On 12 Dec 2013, at 12:24, Teske, Devin <Devin.Teske at fisglobal.com> wrote:
>>>> Thanks, if only I'd know about this 6 months ago :)
>>> 
>>> I just wrote it from scratch, so didn't exist until today ;D
>> 
>> Hah nice, although I imagine there is plenty of legal XML it can't parse.
>> 
>> That plays to another point about this sort of work - it's very hard to write shell script that will work properly in all cases (things like spaces, or even newlines and unprintable characters in filenames).
>> 
> 
> If I had spent more time on it, then it would be able to parse any
> XML. However, it wasn't worth going further without first having
> a look at the C code that produces the output.
> 
> For example, different XML encoding libraries may encode the
> property values more or less strictly (for example, are values
> properly encoded to prevent a value of "</name>" (for example)
> from prematurely terminating the property borking the XML
> valiation. (my guess would be that it would be encoded fully as
> "<name></name></name>".
> 
> Just a matter of extending the extract_data() and extract_attr()
> functions and then generalizing a little more.

I think looking at what produces it is 'cheating' and can end up biting you in the ass later on.

Basically my point is that there needs to be _some_ interchange format where you can reliably parse output from tools generating it (which by and by might be written by different people with different assumptions etc). So a core extremely robust parser is necessary.

Perhaps there could be a base tool which can take such output and convert it to a set of struct commands. That is really my second choice, but I think that it is politically infeasible to modify our /bin/sh to parse XML (or any other useful interchange format).

--
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
"The nice thing about standards is that there
are so many of them to choose from."
  -- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C








More information about the freebsd-stable mailing list