From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.6 required=5.0 tests=AWL,NO_REAL_NAME,SPF_FAIL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id B5C56BC6C for ; Thu, 7 Feb 2008 09:16:33 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAMNNqkfAXQInh2dsb2JhbACPPXUBAQEICimBFZor X-IronPort-AV: E=Sophos;i="4.25,315,1199660400"; d="scan'208";a="22336442" Received: from concorde.inria.fr ([192.93.2.39]) by mail4-smtp-sop.national.inria.fr with ESMTP; 07 Feb 2008 09:16:17 +0100 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id m178GCKq024851 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Thu, 7 Feb 2008 09:16:17 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAEpNqkfAEKcglWdsb2JhbACPPXUBAQEBBwoRGIEVmiw X-IronPort-AV: E=Sophos;i="4.25,315,1199660400"; d="scan'208";a="7035909" Received: from selenite.metnet.navy.mil ([192.16.167.32]) by mail2-smtp-roc.national.inria.fr with ESMTP; 07 Feb 2008 09:16:11 +0100 Received: (qmail 4955 invoked by uid 107); 7 Feb 2008 08:16:10 -0000 Received: from unknown (HELO Adric.metnet.fnmoc.navy.mil) (10.100.105.152) by selenite.metnet.navy.mil with SMTP; 7 Feb 2008 08:16:10 -0000 Received: by Adric.metnet.fnmoc.navy.mil (Postfix, from userid 760) id DD110A99B; Thu, 7 Feb 2008 00:13:37 -0800 (PST) From: oleg@okmij.org To: caml-list@inria.fr Subject: xmlm and names(paces) Reply-To: oleg@pobox.com Errors-To: oleg@okmij.org Message-Id: <20080207081337.DD110A99B@Adric.metnet.fnmoc.navy.mil> Date: Thu, 7 Feb 2008 00:13:37 -0800 (PST) X-Miltered: at concorde with ID 47AABE4D.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; oleg:01 buenzli:01 invokes:01 parser:01 parser:01 specifies:01 extensively:01 namespaces:01 callbacks:01 defaults:01 callbacks:01 parsed:01 wrote:01 wrote:01 ideally:01 Buenzli Daniel wrote: > As I previously said on this list I'm adding better namespace support to > xmlm. Up to now xmlm just parsed qualified names into their prefix and > local part (prefix, local). Now I'd like to provide the client with > expanded names (uri, local). > > Initially I planned to give the client choice between getting qualified > names or expanded names. However the prefix of qualified names is really > meaningless (it can be alpha converted) and thus cannot be used to > recognize anything in a document. One of the aim of xmlm is simplicity, > as such I think xmlm should only provide expanded names. It should be mentioned that the prefixes of qualified names cannot just be alpha-converted. It is quite common to see the following, quoted from http://www.w3.org/TR/xmlschema-0/ ... One can plainly see that the prefix, xsd, appears inside a quoted string! If one wishes to rename the prefix xsd into just 's', one has to look inside quoted strings (of course, not every occurrence of xsd inside quoted string is the prefix. A quoted string, the content of an attribute, may just as well be an opaque quoted string). One may really wonder what kind of people wrote all those voluminous XML recommendations. So, ideally one may wish to keep the original prefix (in addition to its corresponding URL). It is also reasonable for a user to specify a `shortcut'. Unlike the prefix, which is chosen by the author of the document, a shortcut is chosen by the person who invokes a parser. In the SSAX parser, the user specifies the association of URI with shortcuts. The parser, having resolved the QName prefix to a URI, maps that URI to the user-specified shortcut, if present. The shortcuts are extensively discussed in http://okmij.org/ftp/Scheme/SXML.html#Namespaces Incidentally, some of the design decisions of SSAX (despite being produced by an enemy) might be pertinent to this discussion. SSAX is actually a SAX parser, or a big macro that builds a parser out of user-provided callbacks and reasonable defaults. One can use SSAX to parse XML on the fly or to convert XML to anything one chooses. There is also an instantiation of SSAX with reasonable callbacks that make SSAX a DOM parser, converting XML into one particular output format, SXML. Experience shows that this particular instantiation satisfies most of the users. Still I have come across several users who needed the full SSAX (e.g., for streaming conversion of XML into something else).