Subject: RE: PaceLinkRelMechanism

From: "David Orchard" <[email-masked]>
Date: Mon, 11 Oct 2004 09:24:18 -0700

In general, I agree that qnames in content are bad.  But there are some
advantages to authors.  It can be very painful to write lots o' URIs in
attributes.  

Any use of Qnames requires gaining freedom from significant authoring
pain, which I haven't yet seen for rel values.

Dave

> -----Original Message-----
> From: [email-masked] [mailto:owner-atom-
> [email-masked]] On Behalf Of Dare Obasanjo
> Sent: Friday, October 08, 2004 12:22 PM
> To: Danny Ayers; Graham
> Cc: Atom Syntax
> Subject: Re: PaceLinkRelMechanism
> 
> 
> 
> --- Danny Ayers <[email-masked]> wrote:
> >
> > You will then have noticed Norm's remark - "The
> > announcement that the
> > next version of HTML is going to use QNames in rel
> > puts this question
> > to bed, I think. Using anything else in Atom would
> > be hard to defend."
> 
> Having QNames in content causes a ridiculous amount of
> problems in XML processing. It's unfortunate that we
> are stuck with them in core XML technologies like XSLT
> and W3C XML Schema but it doesn't mean this should be
> allowed to spread unchecked in the XML world.
> 
> Even the W3C TAG frowns on the practice but admits the
> cat is already out of the bag
> 
>   http://www.w3.org/2001/tag/doc/qnameids.html
> 
> =====
> THINGS TO DO IF I BECOME AN EVIL OVERLORD #23
> I will keep a special cache of low-tech weapons and train my troops in
> their use. That way -- even if the heroes manage to neutralize my
power
> generator and/or render the standard-issue energy weapons useless --
my
> troops will not be overrun by a handful of savages armed with spears
and
> rocks.
> 
> 
> 
> _______________________________
> Do you Yahoo!?
> Declare Yourself - Register online to vote today!
> http://vote.yahoo.com

---

From: Dare Obasanjo <[email-masked]>
Date: Mon, 11 Oct 2004 09:41:02 -0700 (PDT)

> advantages to authors.  It can be very painful to

Atom feeds are primarily going to be machine
generated. Adding the significant pain in downstream
processing caused by QNames in content for the 0.0001%
of Atom users who will hand write their feeds does not
seem to be a good cost/benefit trade off. 

=====
THINGS TO DO IF I BECOME AN EVIL OVERLORD #23
I will keep a special cache of low-tech weapons and train my troops in their use. That way -- even if the heroes manage to neutralize my power generator and/or render the standard-issue energy weapons useless -- my troops will not be overrun by a handful of savages armed with spears and rocks.

---

From: Bjoern Hoehrmann <[email-masked]>
Date: Mon, 11 Oct 2004 19:43:07 +0200

>seem to be a good cost/benefit trade off. 

Hmm, rather than using a.Value directly you wrap a into a function call
for which the function is three or four lines of code, how is that pain
or significant in a meaningful way? Also, how did you derive the 0.0001%
here? And why is this only relevant for "hand writing" Atom documents?

---

From: Dare Obasanjo <[email-masked]>
Date: Mon, 11 Oct 2004 11:23:32 -0700 (PDT)

> here? And why is this only relevant for "hand

The problem with QNames in content is that most XML
APIs do not provide easy ways to process or transmit
in-scope namespace declarations. In the .NET Framework
neither XmlDocument nor XmlReader do while
XPathNavigator does but the API is cumbersome.
Specifically a lot of APIs particularly fall apart
when transmiting a fragment from an XML document with
QNames in content since they don't know to serialize
the in-scope namespaces at the root of the fragment. 

Example 

 <root xmlns:ex="http://www.example.org">
   <parent>
     <child>ex:value</child>
   </parent>
 </root>

Grab your favorite DOM or SAX implementation in your
language of choice, position yourself on the <parent>
element then write the node to a stream or pass it
along to another API. How well do the in-scope
namespaces travel along with the node? 

=====

---

From: Bjoern Hoehrmann <[email-masked]>
Date: Mon, 11 Oct 2004 20:53:28 +0200

>XPathNavigator does but the API is cumbersome.

So what is XmlNode::GetNamespaceOfPrefix(...) about?
I would have thought something like

  static String URIFromQName(XmlAttribute a)
  {
    String[] s = a.Value.Split(':');
    return a.GetNamespaceOfPrefix(s[0]) + s[1];
  }

plus some error checking would do?

---

From: Dare Obasanjo <[email-masked]>
Date: Mon, 11 Oct 2004 13:49:16 -0700 (PDT)

> I would have thought something like

I forgot about that method. I just looked at the code
with our dev lead. It's buggy so we filed some bugs
about it related to a few edge cases that shouldn't
affect Atom scenarios if the entire feed is loaded
into the XmlDocument. 

This won't help me in RSS Bandit though since I use
XmlReader for processing feeds not the XmlDocument. 

=====

---

From: Bjoern Hoehrmann <[email-masked]>
Date: Tue, 12 Oct 2004 00:10:04 +0200

>XmlReader for processing feeds not the XmlDocument. 

Ok, so, how about using XmlReader.LookupNamespace(...)?

---

From: Dare Obasanjo <[email-masked]>
Date: Tue, 12 Oct 2004 07:26:38 -0700 (PDT)

--- Bjoern Hoehrmann <[email-masked]> wrote:

> * Dare Obasanjo wrote:
> >> So what is XmlNode::GetNamespaceOfPrefix(...)
> >

Yeah, that works. I was thinking about places in the
code where I go from XmlReader to XmlNode to handle
elements I don't understand using
XmlDocument.ReadNode(). However this is probably a
peculiarity in RSS Bandit. 

So I was wrong, all the XML APIs in the .NET Framework
provide mechanisms for correctly processing QNames in
content. The places where they fall apart will most
likely be uncommon amongst applications processing
Atom feeds. 

Thanks for correcting me Bjoern. 

=====