RE: document node attributes

Hi David,

In this thread I was asking if one could conceivably have fixed virtual/deemed attributes
associated with the document node of a new (hypothetical) media type which would be 
essentially a very simple subtype of XML (with it's hypothetical built-in hypermedia attributes).

Liam reminded me that if such a message got separated from its metadata, there would be 
no concrete attributes or other markup in the message to identify it as the subtype ("NeoXML").
The <?xml version=1.0?> would not help.  Of course the base URI of a message suffers
the same fate, and xml:base can be used to record where a document came from.

> <root hm:href="someplace" 
> xmlns:hm="http://www.hypermedia.org/XML/2013/hypermedia">
> stuff
> </root>
> 
> is that so bad ?

That is the same pattern as

<root xlink:href="someplace" xmlns:xlink="http://www.w3.org/1999/xlink">
...
</root> 

XLink starts there and gets a lot more complicated, which in itself is a problem.
It offers many features that are useful to few applications, and few features
that are useful to many applications.

I think putting the hypermedia attributes in a namespace is not desirable:  The namespace prefix
can be reassigned, hence the 'meme' effect is diluted; in order to use it correctly,
you have to actually remember/find the URI of the namespace -> also affecting the meme.  
You can't cut and paste elements carrying those attributes or the attributes themselves 
from one document to another without the possibility of namespace well-formedness errors, 
even if those elements are in no namespace to begin with.  These may sound like
small potatoes to an old XML hand, but I offer one more piece of evidence that
they are not minor problems: MicroXML was conceived because these are actual problems
that are well known.  (There may be other reasons for MicroXML, I forget them now).

But let's say we were going to write a competing standard to XLink, using
namespaces the way you're suggesting.  

We would hopefully have @href, @src, @type, @rel, @hreflang, possibly @method and 
hopefully possibly @tref / @tsrc or similar convention in support of RFC 6570.

I tried to illustrate an application
of this in the distributed extensibility page of the wiki.
http://www.w3.org/community/xmlhypermedia/wiki/Distributed_extensibility_/_automatic_namespaces

There we have an example document:

<sml:SingleMalts xmlns:sml="http://scotch.org/ScotchML" 
  xmlns:h="http://www.w3.org/2013/hypermedia">
  <sml:whisky>
    <sml:name>Glenfarclas</sml:name>
    <sml:history>
      <sml:p>Glenfarclas is the brand name of one of the finest Speyside malts available.  
        <sml:a h:href="http://en.wikipedia.org/wiki/Glenfarclas_Single_Malt">
          See wikipedia for more information
        </sml:a>
      </sml:p>
    </sml:history>
  <sml:whisky>
</sml:SingleMalts>

which even when reduced to a no-namespace version of itself with the hypermedia version of
the automatic namespaces proposal, reduces to this:

<SingleMalts h:href="http://scotch.org/ScotchML" h:rel="ns" h:type="application/namespaces+xml"
  xmlns:h="http://www.w3.org/2013/hypermedia">
  <whisky>
    <name>Glenfarclas</name>
    <history>
      <p>Glenfarclas is the brand name of one of the finest Speyside malts available.  
        <a href="http://en.wikipedia.org/wiki/Glenfarclas_Single_Malt">
         See wikipedia for more information
        </a>
      </p>
    </history>
  <whisky>
</SingleMalts>

Which I agree is close to what is desired.  If in fact the resource at http://www.w3.org/2013/hypermedia
would return the namespace file mapping the hypermedia attributes to that namespace,
you might be even be able to get away with the idea of having those properties default
to those values on application/nxml type messages i.e. not be physically present.  

But I think you might still have
the risk of having instance vocabularies re-assigning @href et al different semantics
in a different namespace URI (the XML namespace URI is actually hardcoded into parsers),
especially in regular xml files where one could use xml:href et al. without the limitations
mentioned above which helped give rise to MicroXML.

What do you think?

Cheers,
Peter

> -----Original Message-----
> From: David Lee [mailto:David.Lee@marklogic.com] 
> Sent: June 14, 2013 13:57
> To: Rushforth, Peter; liam@w3.org
> Cc: public-xmlhypermedia@w3.org
> Subject: RE: document node attributes
> 
> Trying to whip this horse one more time.  I *do* wish it would run :)
> 
> 
> <root hm:href="someplace" 
> xmlns:hm="http://www.hypermedia.org/XML/2013/hypermedia">
> stuff
> </root>
> 
> is that so bad ?
> 
> 

Received on Friday, 14 June 2013 19:32:20 UTC