From owner-freebsd-stable@FreeBSD.ORG Thu Dec 12 07:07:38 2013 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 89E202F4; Thu, 12 Dec 2013 07:07:38 +0000 (UTC) Received: from cain.gsoft.com.au (cain.gsoft.com.au [203.31.81.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0A38612AD; Thu, 12 Dec 2013 07:07:37 +0000 (UTC) Received: from ur.gsoft.com.au (Ur.gsoft.com.au [203.31.81.31]) (authenticated bits=0) by cain.gsoft.com.au (8.14.4/8.14.3) with ESMTP id rBC778Al043366 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Thu, 12 Dec 2013 17:37:14 +1030 (CST) (envelope-from doconnor@gsoft.com.au) Subject: Re: BIND segway -> python -> first-class ports Mime-Version: 1.0 (Mac OS X Mail 7.0 \(1822\)) Content-Type: text/plain; charset=us-ascii From: "Daniel O'Connor" In-Reply-To: <5A92C643-0BA6-4D15-AB54-DB78BE00583A@fisglobal.com> Date: Thu, 12 Dec 2013 17:37:08 +1030 Content-Transfer-Encoding: quoted-printable Message-Id: <6052F96E-0CD3-4C56-A619-8337C4ED890C@gsoft.com.au> References: <20131210023615.GR55638@funkthat.com> <52A68141.6010003@mu.org> <622122.74675.bm@smtp120.sbc.mail.gq1.yahoo.com> <20131210224915.GA55638@funkthat.com> <52A82099.9080100@bluerosetech.com> <0EC3A50D-A6BE-4F3B-87D6-AB0470F0BA64@gsoft.com.au> <4174A92E-F202-4FFB-BFED-C38A9D0A7F91@fisglobal.com> <0D92E13A-F869-492C-852B-37A0BFB1674C@gsoft.com.au> <38856510-A2D9-41E6-8CDC-ED282BDA933A@gsoft.com.au> <5A92C643-0BA6-4D15-AB54-DB78BE00583A@fisglobal.com> To: Devin Teske X-Mailer: Apple Mail (2.1822) X-Spam-Score: -4.001 () ALL_TRUSTED,BAYES_00,RP_MATCHES_RCVD X-Scanned-By: MIMEDefang 2.67 on 203.31.81.10 Cc: Kevin Oberman , "freebsd-stable@freebsd.org Stable" , "Teske, Devin" , Darren Pilgrim X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2013 07:07:38 -0000 On 12 Dec 2013, at 17:32, Teske, Devin = wrote: > On Dec 11, 2013, at 9:46 PM, Daniel O'Connor wrote: >> On 12 Dec 2013, at 12:24, Teske, Devin = wrote: >>>> Thanks, if only I'd know about this 6 months ago :) >>>=20 >>> I just wrote it from scratch, so didn't exist until today ;D >>=20 >> Hah nice, although I imagine there is plenty of legal XML it can't = parse. >>=20 >> 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). >>=20 >=20 > 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. >=20 > 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 "" (for example) > from prematurely terminating the property borking the XML > valiation. (my guess would be that it would be encoded fully as > "</name>". >=20 > 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