XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] Abandon the (mistaken) belief that XML attributesprovide "metadata" and set yourself free to explore capability-based designs

On Sun, 2011-03-20 at 17:51 -0400, John Cowan wrote:
> Liam R E Quin scripsit:
> 
> > The more abstract pattern is that Schema has avoided the idea of a
> > descendent changing the meaning of an element.
> 
> Rather, of changing its content model -- not the same thing.

I was deliberately vague about meaning - for XSD it's not only about
content models.

Indeed, conditional type assignment and unions are both steps in the
direction of a content model (in the DTD sense) depending on children.

Perhaps a clearer example might be SimpleType vs ComplexType - it would
be possible just to use Type, and say that e.g. if there's an attribute
defined, it's a complex type. But there are lots of additional
constraints on where complex types can appear that would then become
much harder to understand. And, of course XSLT/XPath/XQuery/XForms would
have problems...

Or, in C,
  short s = (65535 + 17);
on a system where short is 16-bit, doesn't declare a sufficiently large
variable to hold the value :-)

I think we are actually probably agreeing, but I am trying to find
alternate expressions to be clearer.

To go back to attributes, some people have strong aversion to syntax
like,
<p>
  <attributes>
    <attribute>
      <name>type</name>
      <value>body_t</value>
    </attribute>
    <attribute>
      <name>id</name
      <type>xml:id</type>
      <value>p16</value>
    </attribute>
  </attributes>
  <content>Hello world</content>
</p>
rather than
<p type="body_t" xml:id="p16">Hello world</p>
and not only because of verbosity but because of the
children-affecting-parents nature.

Since I'm not myself strongly in that camp, I might be misrepresenting
it a little; I'd be perfectly happy to see <xml:attributes> as an
alternate syntax, as it happens, in some putative world in which
everyone immediately rewrote all their XML APIs...

Best,

Liam

-- 
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://www.fromoldbooks.org/
Occasional blog: http://www.barefootliam.org/
The barefoot typographer





[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS