[Home] [By Thread] [By Date] [Recent Entries]

  • From: Liam R E Quin <liam@w...>
  • To: John Cowan <cowan@m...>
  • Date: Sun, 20 Mar 2011 23:12:31 +0100

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]


Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member