Qualified attributes

Shawn Villaron shawnv at microsoft.com
Mon Jun 8 00:51:54 CEST 2009


Thanks, Jirka, this helps me understand the motivation for this change.

I do worry about how each of us are reacting to the proposed namespace change.  As I tried to explain in my "slippery slope" mail about a week ago, I worry that some people will interpret that change as a decree that since we're introducing one breaking change into strict, that we can introduce as many breaking changes as we'd like.  It's this logic that poses a substantial risk to the strict conformance class.  Every breaking change we make to strict raises the cost to implementers to switch over to strict.  If we really want to encourage implementers to switch, we need to be very careful with the changes we're making; if we're not, we could be actively discouraging the outcome that many of us would like to see.

Again, thanks for helping me understand your technical concerns here.

shawn

-----Original Message-----
From: Jirka Kosek [mailto:jirka at kosek.cz] 
Sent: Sunday, June 07, 2009 3:27 PM
To: Shawn Villaron
Cc: MURATA Makoto (FAMILY Given); SC 34 WG4
Subject: Re: Qualified attributes

Shawn Villaron wrote:

> Can someone explain to me why this is worthy of changing?  

Using unqualified attributes is common and it is sort of best practice.
>From top of my head I can't think of any XML vocabulary which I would consider well designed and which will be using qualified attributes.
(And I'm talking about "normal" vocabularies now, not about generic vocabularies like XLink which are intended to be used in combination with other vocabularies and thus they are using qualified attributes to prevent name clasehes.)

But apart from this common practice, there are plenty of another reasons. For example XML namespaces are designed in a way that usage of qualified attributes is discouraged. For example default namespace propagates only to elements, not to attributes. So for example you can use default namespace to simplify syntax of primitive WordML file:

<?xml version="1.0" encoding="UTF-8"?>
<document
xmlns="http://schemas.openxmlformats.org/wordprocessingml/2006/main">
  <body>
    <p>
      <r>
        <t>Hello World</w:t>
      </r>
    </p>
  </body>
</document>

But once you want to use attributes, you have to declare prefixes, because the following two documents are not the same:

<?xml version="1.0" encoding="UTF-8"?>
<w:document
xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main">
  <w:body>
    <w:p>
      <w:r>
        <w:rPr>
          <w:sz w:val="24"/>
        </w:rPr>
        <w:t>Hello World</w:t>
      </w:r>
    </w:p>
  </w:body>
</w:document>

and

<?xml version="1.0" encoding="UTF-8"?>
<document
xmlns="http://schemas.openxmlformats.org/wordprocessingml/2006/main">
  <body>
    <p>
      <r>
        <rPr>
          <sz val="24"/>
        </rPr>
        <t>Hello World</t>
      </r>
    </p>
  </body>
</document>

(the latter example doesn't have val attribute in WML namespace and it is currently invalid).

> I get that it's inconsistent, but I'm having trouble understanding what's bad about this ( said another way, how does this impact interoperability )?

Having qualified/unqualified attributes has zero impact to interop. But since namespace change for Strict will effectively change name of all elements and qualified attributes, backward compatibility is lost anyway, and we can make this additional change to make OOXML Strict nicer and more "XMLish".


--
------------------------------------------------------------------
  Jirka Kosek      e-mail: jirka at kosek.cz      http://xmlguru.cz
------------------------------------------------------------------
       Professional XML consulting and training services
  DocBook customization, custom XSLT/XSL-FO document processing
------------------------------------------------------------------
 OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 member
------------------------------------------------------------------




More information about the sc34wg4 mailing list