[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Abandon the (mistaken) belief that XML attributesprovide "

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

Re:  Abandon the (mistaken) belief that XML attributesprovide "
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]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.