Re: A thought about profiles

On Wed, 2012-07-04 at 00:46 +0100, Henry S. Thompson wrote:
> [yes, I know, I have real editors' work to do on this spec., but this
> came up in another context]
> 
> What does anyone think of the following:
> 
>    An infoset is a single-rooted, directed graph with node labels (item
>    types) and edge labels (properties), where we treat literals (strings,
>    integers, URIs, [anything else?]) (which are always leaves) as nodes
>    of type Literal.  The graph may contain cycles (courtesy of the
>    [references] property on attributes and the [attributes] property on
>    elements.

I take it you are proposing introducing (formally, that is) and defining
the term "infoset". But shouldn't that be done in the XML Information
Set specification?

> 
>    We can define a *profile* (sc. for infosets) as a set of node labels N
>    (which always contains at least Literal) and a set of edge labels E,
>    and a *profiled infoset* P of an infoset I wrt such a profile as
>    follows:

Not sure what sc. is abbreviating here.
"always contains at least one Literal"?

>     If Document is not in N, then the empty graph
> 
>     Otherwise, the Document node from I (call it d), plus all nodes in I
>     whose labels are in N which are reachable from d by at least one path
>     all of whose edge labels are in E and all of whose node labels are in
>     N
> 
>    Or alternatively, by construction:
> 
>     If 'Document' is in N, then the Document node of I is in P;
> 
>     If a node n is in P, then
>       each node
>        a) which is connected from n by an edge whose label is in E, and
>        b) whose own label is in N
>       is in P.
> 
>    If two XML documents D1 and D2 have identical profiled infosets for
>    some profile P, then any application which specifies P as its input
>    profile SHOULD treat D1 and D2 indistinguishably.
> 
> I feel like it might be helpful to include this, as it sort of answers
> the question "what are profiles _for_?" in a different and possibly
> useful way. . .
> 
Useful for whom?  One of the strengths of XML is that it enables
non-programmers to work with text... I'm in favour of including formal
definitions, but I don't think this definition answers the question,
what are profiles for. It gives a possible answer to, How might profiles
be defined? and as such may be a useful part of the spec.

I submit that a useful answer to "what are profiles for" might be, "so
that people who write or distribute XML software can describe their XML
processors in a standard way - e.g. it does XInclude and RelaxNG but not
XSD or DTD validation. But that doesn't make your definition
inappropriate.

Liam

-- 
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/

Received on Wednesday, 4 July 2012 02:32:12 UTC