unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "'Štepán Nemec'" <stepnem@gmail.com>
Cc: joakim@verona.se, 'Chong Yidong' <cyd@stupidchicken.com>,
	'Thien-Thi Nguyen' <ttn@gnuvola.org>,
	"'Andrew W. Nosenko'" <andrew.w.nosenko@gmail.com>,
	'Emacs developers' <emacs-devel@gnu.org>
Subject: RE: online conversion support from xsd to rng?
Date: Thu, 9 Dec 2010 17:47:55 -0800	[thread overview]
Message-ID: <E1A542F4A5C74E85BECADEA076E30694@us.oracle.com> (raw)
In-Reply-To: <87mxoe5w50.fsf@gmail.com>

>>> 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.





  parent reply	other threads:[~2010-12-10  1:47 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-30  9:37 online conversion support from xsd to rng? joakim
2010-12-01  9:57 ` joakim
2010-12-07 17:18 ` Chong Yidong
2010-12-07 22:42   ` joakim
2010-12-08  1:31     ` Thien-Thi Nguyen
2010-12-08  8:19       ` joakim
2010-12-08 15:58         ` Thien-Thi Nguyen
2010-12-08 10:45       ` Andrew W. Nosenko
2010-12-08 15:54         ` Thien-Thi Nguyen
2010-12-09 16:19           ` Drew Adams
2010-12-10  0:06             ` Štěpán Němec
2010-12-10  1:10               ` Lennart Borgman
2010-12-10  1:47               ` Drew Adams [this message]
2010-12-10  1:52               ` Stephen J. Turnbull
2010-12-10  6:49                 ` Štěpán Němec
2010-12-11  2:17                   ` Stephen J. Turnbull

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1A542F4A5C74E85BECADEA076E30694@us.oracle.com \
    --to=drew.adams@oracle.com \
    --cc=andrew.w.nosenko@gmail.com \
    --cc=cyd@stupidchicken.com \
    --cc=emacs-devel@gnu.org \
    --cc=joakim@verona.se \
    --cc=stepnem@gmail.com \
    --cc=ttn@gnuvola.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).