W3C home > Mailing lists > Public > public-xmlhypermedia@w3.org > June 2013

RE: document node attributes

From: David Lee <David.Lee@marklogic.com>
Date: Fri, 14 Jun 2013 21:47:36 +0000
To: "Rushforth, Peter" <Peter.Rushforth@NRCan-RNCan.gc.ca>, "liam@w3.org" <liam@w3.org>
CC: "public-xmlhypermedia@w3.org" <public-xmlhypermedia@w3.org>
Message-ID: <6AD72D76C2D6F04D8BE471B70D4B991E127F74@EXCHG10-BE02.marklogic.com>
> What do you think?
I guess I am very confused.  but this is what I am reading from you.

Suggestions

1) A new media type with metadata which is not part of the document body (outside the root)
--> As Liam mentioned this won't survive XPath/XSLT/XQuery/XProc etc.
--> As you agreed, that makes it not a good idea

2) Using something like automatic namespaces
--> IMHO the cart before the horse.  We first need to get *that* spec adopted and commonly used, then it might be great.

3) Discussion why namespaces are bad
--> IMHO this is how XML works, good or bad.  Namespaces were added specifically to help solve the copy/paste problem
even though they dont solve it perfectly its atleast better, IMHO, then no namespaces.
And also, IMHO, how many people actually hand edit XML in a non XML editor who are also ignorant of how XML works 
and would make this kind of mistake frequently ?
So I just dont see the issue here.   I assert that the intersection of people who edit XML in non-XML aware text editors ,
and people who dont understand the possible issues of namespaces, and people who would use this spec, and also 
are other namespaces that conflict in the prefix chosen is small.
I dont even write HTML anymore by hand.   For me missing a "/" or ">" or a '"'  is actually common occurrence when I hand
edit XML in a text editor.   Literally 1000x more than other types of mistakes.   If I am copy and pasting chunks of xml around
between documents, those documents are *always* of the same 'kind' ... and I make sure first that the namespace declaration are right at the root.   finding and fixing incorrect prefix problems is microscopic compared to more severe hand-editing mistakes.    

4) Discussion of micro xml.   
--> Micro xml didn't adopt the xml: namespace it got rid of *all* namespaces.  If we go that route then a Micro XML add-on 
might be useful.   But it's not XML.   






-----------------------------------------------------------------------------
David Lee
Lead Engineer
MarkLogic Corporation
dlee@marklogic.com
Phone: +1 812-482-5224
Cell:  +1 812-630-7622
www.marklogic.com



-----Original Message-----
From: Rushforth, Peter [mailto:Peter.Rushforth@NRCan-RNCan.gc.ca] 
Sent: Friday, June 14, 2013 3:32 PM
To: David Lee; liam@w3.org
Cc: public-xmlhypermedia@w3.org
Subject: 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 21:48:01 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:42:06 UTC