From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: RE: online conversion support from xsd to rng? Date: Thu, 9 Dec 2010 17:47:55 -0800 Message-ID: References: <87hbep8psi.fsf@stupidchicken.com> <8739q9jbic.fsf@ambire.localdomain><87mxoggsz1.fsf@ambire.localdomain> <87mxoe5w50.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1291995912 18938 80.91.229.12 (10 Dec 2010 15:45:12 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 10 Dec 2010 15:45:12 +0000 (UTC) Cc: joakim@verona.se, 'Chong Yidong' , 'Thien-Thi Nguyen' , "'Andrew W. Nosenko'" , 'Emacs developers' To: "=?iso-8859-2?Q?'=A9tep=E1n_Nemec'?=" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Dec 10 16:45:06 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PR59a-0006MB-Tc for ged-emacs-devel@m.gmane.org; Fri, 10 Dec 2010 16:45:05 +0100 Original-Received: from localhost ([127.0.0.1]:48462 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PR59Y-00063j-Eu for ged-emacs-devel@m.gmane.org; Fri, 10 Dec 2010 10:45:00 -0500 Original-Received: from [140.186.70.92] (port=44356 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQs6Y-0008SO-CG for emacs-devel@gnu.org; Thu, 09 Dec 2010 20:49:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PQs62-0001by-T8 for emacs-devel@gnu.org; Thu, 09 Dec 2010 20:48:54 -0500 Original-Received: from rcsinet10.oracle.com ([148.87.113.121]:21396) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PQs62-0001bY-Nq for emacs-devel@gnu.org; Thu, 09 Dec 2010 20:48:30 -0500 Original-Received: from rcsinet13.oracle.com (rcsinet13.oracle.com [148.87.113.125]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id oBA1mQno031110 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 10 Dec 2010 01:48:27 GMT Original-Received: from acsmt355.oracle.com (acsmt355.oracle.com [141.146.40.155]) by rcsinet13.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id oBA1mN5c013000; Fri, 10 Dec 2010 01:48:25 GMT Original-Received: from abhmt018.oracle.com by acsmt355.oracle.com with ESMTP id 841858451291945675; Thu, 09 Dec 2010 17:47:55 -0800 Original-Received: from dradamslap1 (/130.35.178.194) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 09 Dec 2010 17:47:55 -0800 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <87mxoe5w50.fsf@gmail.com> Thread-Index: AcuX/mV3uCPc44TdQpG0lUXJMjjAVAAB44Rg X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5994 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:133571 Archived-At: >>> I think there are two areas of primary concern: >>> (a) conversion between XML and Lisp trees (nested lists) >>> (b) routines for manipulating the tree > > > > Once you've converted XML to Lisp you lose all XML-level > > access, transformation, etc. IOW, once in Lispland, no > > XPath, XQuery, XSLT,... If your processing of > > XML also involves, well, XML processing (e.g. XQuery > > transformations) that is part of the given, then you've lost that. > > > > IOW, conversion to conses and processing using Lisp can be > > useful, but depending on your context there can be a cost. > > This is nonsense. XPath and friends are not bound to the external > representation of the data in any way. They operate on the > DOM tree. Precisely - XPath and friends operate on a DOM or streaming SAX events or PSVI or XQDM or... They don't operate on conses. Unless those conses map to a DOM, PSVI, etc. No one said anything about using an external representation of the data - except you. > So as long as your XML conversion to sexp format is lossless (which it > should be, of course), Well sure, if you build a Lisp DOM or the equivalent, so that nothing is lost. That's not the impression I got from the (admittedly meager) description given. I think we are partly saying the same thing - we are both saying, I guess, that unless you have a full, lossless representation you are losing out on something. You are supposing such a representation; I wasn't hearing that. And even a perfectly faithful representation is not much without faithful access. By that I mean access faithful to the existing (standard) XML processing languages - IOW support for them. I suppose (hope) that's what you mean by saying that you "need an XPath etc. implementation for your language". > you lose nothing, only gain the advantages of > saner format (i.e. sexp) both for humans and the machine -- you just > need an XPath etc. implementation for your language. Sure. "Etc." Y'a qu'a... A Lisp DOM API, for example ("(b) routines for manipulating the tree"). Or a Lisp PSVI. Or an XQuery Data Model. Or all of the above. Etc. A fairly far cry from "ad-hoc car/cdr climbing for (b)" (depending on what was meant). Don't get me wrong. I'm certainly not against the idea. Just pointing out that Lisp is not XML (for better or for worse), and for XML processing you need a representation of XML (nodes - I'm not talking text anymore than you are). And to be really helpful you need interfaces with (support for) XML languages (e.g. XQuery). That is, *IF* you want to take advantage of existing code in such languages and support those languages with a Lisp API (yes, Virginia, there is lots of existing XML processing code). If not - if you just build your own Lispy access etc. (e.g. car/cdr climbing) without support for XML languages, then yes, you forego existing code and applications written in them. I'm not familiar with `xml2sexp' - maybe that's truly all that's needed. But this description didn't really inspire confidence: "The idea is to flee the angry brackets into the loving parens immediately. (I briefly looked at the pattern matching / transform primitives of XSLT and was horrified.)" That doesn't give me the impression that "you just need an XPath etc. implementation for your language." It gives me the impression that the idea is to not use (support) XPath, XQuery, XSLT, DOM, or any of the rest. Hence my comment that dropping all of that represents a loss. Or, as I said: > > IOW, conversion to conses and processing using Lisp can be useful, ^^^^^^^^^^^^^^^ > > but depending on your context there can be a cost. It can be useful, but it is not the same thing as supporting XQuery code, XSLT code, etc.