Subject: Deterministic content models (conflict with Atom Publishing Protocol?)

From: Thomas Broyer <[email-masked]>
Date: Sun, 22 May 2005 00:34:53 +0200

I'm sorry to raise this "issue" back again but...

The Atom Publishing Protocol defines SOAP bindings. This (in my mind) 
means there will be WSDL files over there. WSDL rely on XML Schema which 
in turn are limited to deterministic content models.

Will the APP limit "Atom entries in SOAP envelopes" content model to fit 
WSDL/XML Schema constraints (actually, the APP will already need to 
limit Atom entries to have a mandatory atom:content I think)?

Or should the Atom Syndication Format use deterministic content models 
to allow XML Schema, thus such uses as WSDL for Web Services?

I'm personally in favor of the second one, as it also simplifies Atom 
parser/processor development.

-- 
Thomas Broyer

---

From: Martin Duerst <[email-masked]>
Date: Mon, 23 May 2005 18:35:34 +0900

Hello Thomas,

 >The Atom Publishing Protocol defines SOAP bindings. This (in my mind) 
means there will be WSDL files over there. WSDL rely on XML Schema which in 
turn are limited to deterministic content models.
 >Will the APP limit "Atom entries in SOAP envelopes" content model to fit 
WSDL/XML Schema constraints (actually, the APP will already need to limit 
Atom entries to have a mandatory atom:content I think)?
 >
 >Or should the Atom Syndication Format use deterministic content models to 
allow XML Schema, thus such uses as WSDL for Web Services?

Are you speaking about potential non-determinism or actual non-determinism?
Is such non-determinism in the core of the Atom format, in potential extensions,
or in payloads (e.g. XHTML,...)?

If there is actual non-determinism now in the Atom core, that would be
a reason for concern. If there is potential non-determinism in the
payloads or extensions, it should be possible to handle that by a more
open content model in XML Schema.

Regards,    Martin.

---

From: "Thomas Broyer" <[email-masked]>
Date: Mon, 23 May 2005 12:04:24 +0200 (CEST)

Martin Duerst wrote:
>  >means there will be WSDL files over there. WSDL rely on XML Schema
>  >which in turn are limited to deterministic content models.
>  >
>  >Will the APP limit "Atom entries in SOAP envelopes" content model to
>  >fit WSDL/XML Schema constraints (actually, the APP will already need
>  >to limit  Atom entries to have a mandatory atom:content I think)?
>  >

Atom core uses interleaved content models, which are not "compatible" with
XML Schema (or DTD). I call them "non-deterministic".

I know that RelaxNG as well as other schema languages have been created
partly because of this limitation of XML Schema, though I don't think we
need interleaving in the case of Atom.

If Atom aim to be used on devices/systems with small capabilities, having
a "clear" content model makes the parsing easier, e.g. using a state
machine based on SAX.

The SOAP->WSDL->XML Schema is another approach of the problem, which is
more likely to b a big concern as it is part of Atom (here, the protocol)

> Is such non-determinism in the core of the Atom format,
> in potential extensions, or in payloads (e.g. XHTML,...)?

Payloads will most likely be parsed as "black boxes" to retrieve XML
document fragments or the "raw XML" as string.

Extensions are a concern but as they're part of core (hey, they are
extensions ;o) ) Atom processors might just skip them.

-- 
Thomas Broyer

---

From: Norman Walsh <[email-masked]>
Date: Sun, 22 May 2005 18:34:08 +0200

/ Thomas Broyer <[email-masked]> was heard to say:
| I'm sorry to raise this "issue" back again but...
|
| The Atom Publishing Protocol defines SOAP bindings. This (in my mind)
| means there will be WSDL files over there. WSDL rely on XML Schema
| which in turn are limited to deterministic content models.
|
| Will the APP limit "Atom entries in SOAP envelopes" content model to
| fit WSDL/XML Schema constraints (actually, the APP will already need
| to limit Atom entries to have a mandatory atom:content I think)?
|
| Or should the Atom Syndication Format use deterministic content models
| to allow XML Schema, thus such uses as WSDL for Web Services?
|
| I'm personally in favor of the second one, as it also simplifies Atom
| parser/processor development.

I'm operating on about two-hours of sleep in the last 48 and
time-shifted across six time zones. I say that by way of explanation
in case what I'm about to say is more than usually stupid.

There is no 1:1 correspondence between schemas and documents. You can
have as many schemas as you want. If your application demands
additional constraints, such as determinism, you can define your own
schema that enforces them. Then your system will reject documents that
it can't handle.

I would strongly oppose any attempt to make the schema deterministic
without simultaneously making the normative prose deterimistic. I
didn't make the RELAX NG grammar impossible to translate literally
into W3C XML Schemas because I thought it would be fun, I attempted to
model the constraints in the normative prose as closely as possible
and that was the result.

I would prefer to leave things as they are because I think it makes it
easier for authors. But you can make a solid argument that determinism
is easier for authors too, so I wouldn't object to making Atom
deterministic in the normative prose, I suppose.

                                        Be seeing you,
                                          norm

-- 
Norman Walsh <[email-masked]> | There has never been a perfect
http://nwalsh.com/            | government, because men have passions;
                              | and if they did not have passions,
                              | there would be no need for
                              | government.-- Voltaire

---

From: Thomas Broyer <[email-masked]>
Date: Mon, 23 May 2005 20:12:59 +0200

Norman Walsh wrote:

>  schema that enforces them. Then your system will reject documents
>  that it can't handle.

Won't that cause interoperability problems?

Well, actually, I misunderstood WSDL a bit: you're actually not forced 
to use XML Schema in WSLD (would it be 1.0, 1.1 or 2.0), though I think 
(I have no figure about that) XML Schema is the most widely supported 
schema language in WSDL implementations, and providing no interop with 
XML Schema might still cause interop problems.

>  without simultaneously making the normative prose deterimistic.

Sure!

I wasn't actually strictly speaking of schemas.

>  I would prefer to leave things as they are because I think it makes
>  it easier for authors.

I Agree, though many HTML pages which I've looked at the source has 
their "HEAD" content in the form:

    * TITLE
    * META
    * LINK
    * STYLE or SCRIPT
    * SCRIPT or STYLE

so a deterministic content model would be a pain I think...

>  But you can make a solid argument that
>  determinism is easier for authors too, so I wouldn't object to making
>  Atom deterministic in the normative prose, I suppose.

Hmm, I can't see any such argument...

-- 
Thomas Broyer

---

From: Thomas Broyer <[email-masked]>
Date: Mon, 23 May 2005 23:14:05 +0200

> so a deterministic content model would be a pain I think...

Wow! Sorry, it would NOT be  pain (hey hey you might be the only one 
needing some rest ;o)

-- 
Thomas Broyer

---

From: Norman Walsh <[email-masked]>
Date: Tue, 24 May 2005 12:08:17 +0200

/ Martin Duerst <[email-masked]> was heard to say:
| If there is actual non-determinism now in the Atom core, that would be
| a reason for concern. If there is potential non-determinism in the

Look at the content model for entry: it's a bag o' stuff some of which
is required and some of which is optional (and optionally repeatable)
and it's all allowed to occur in any order.

I've forgotten the details of XSD's support for "&" content models,
but I'm pretty sure that's beyond them.

                                        Be seeing you,
                                          norm

-- 
Norman Walsh <[email-masked]> | We are more ready to try the untried
http://nwalsh.com/            | when what we do is inconsequential.
                              | Hence the fact that many inventions had
                              | their birth as toys.--Eric Hoffer

---

From: "Thomas Broyer" <[email-masked]>
Date: Tue, 24 May 2005 14:39:01 +0200 (CEST)

Norman Walsh wrote:
> I've forgotten the details of XSD's support for "&" content models, but
> I'm pretty sure that's beyond them.

From "XML Schema Part 1 : Structures (Second Edition)", section "3.8.1 The
Model Group Schema Component" [1]:
"(all) contain all and only exactly zero or one of each element specified
in {particles}. The elements can occur in any order. In this case, to
reduce implementation complexity, {particles} is restricted to contain
local and top-level element declarations only, with {min occurs}=0 or 1,
{max occurs}=1."

[1] http://www.w3.org/TR/xmlschema-1/#Model_Group_details

-- 
Thomas Broyer