caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Bünzli Daniel" <daniel.buenzli@erratique.ch>
To: Alain Frisch <alain@frisch.fr>
Cc: caml-list List <caml-list@inria.fr>
Subject: Re: [Caml-list] xmlm and names(paces)
Date: Wed, 6 Feb 2008 23:56:46 +0100	[thread overview]
Message-ID: <B227B75D-06FC-4F8F-9880-38FE4D32FF1F@erratique.ch> (raw)
In-Reply-To: <47AA2C33.70902@frisch.fr>


Le 6 févr. 08 à 22:52, Alain Frisch a écrit :

> The problem with expanded names is that it makes it quite tedious to  
> pattern-match on element/attribute names (uri are long!).

Agreed.

> Another option is to let the client provide a mapping from uri to  
> fixed prefixes. (PXP can do that kind of prefix normalization.)

In xmlm you can do that yourself on input when you get callbacked and  
do the reverse translation just before outputing
start tags. Of course this means more work for the client, but it  
makes the basic interface simpler and it allows the client
to use variants instead of simply shorter prefixes.

> It is also a good idea to be able to parse XML documents that conform
> to the XML spec but not the XML Namespaces spec.

But don't you automatically get that ?

A document that has no xmlns namespace declarations and no prefixes if  
parsed according to the xmlns spec will result in names with empty  
namespace names.

The other problem I see is if there are external prefix declarations,  
but for that, as I did for external entity references, I have a  
callback that allows you to bind an undeclared prefix to an uri.

> What about something like that:
>
> type name = string * [`N of string * string|`U of string * string|`X]
[...]

Too heavy weight for my taste. With xmlm I try to give a reasonable  
default for xml IO, not the full blown complexity. So I think going  
with qualified names only is ok, the client can transform its own way  
if it whishes (e.g. uri replacement).

> Also, it is necessary to give the client a way to know the namespace  
> bindings in scope at any node. Some XML languages like XML-Schema  
> need this information. A possible way to do it is just to keep the  
> xmlns declarations as regular attributes.

I was planning on keeping the xmlns declarations, but I ignored some  
languages actually *need* this information, what is it used for in xml- 
schema ?

Thanks for the comments,

Daniel

  reply	other threads:[~2008-02-06 22:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-06 20:44 Bünzli Daniel
2008-02-06 20:59 ` [Caml-list] " David Teller
2008-02-06 21:26   ` Bünzli Daniel
2008-02-06 21:52 ` Alain Frisch
2008-02-06 22:56   ` Bünzli Daniel [this message]
2008-02-06 23:51     ` Bünzli Daniel
2008-02-07 22:03     ` Alain Frisch
2008-02-07  8:13 oleg
2008-02-07  8:59 ` [Caml-list] " Bünzli Daniel

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

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

  git send-email \
    --in-reply-to=B227B75D-06FC-4F8F-9880-38FE4D32FF1F@erratique.ch \
    --to=daniel.buenzli@erratique.ch \
    --cc=alain@frisch.fr \
    --cc=caml-list@inria.fr \
    /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.
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 NNTP newsgroup(s).