Brad Fitzpatrick ([info]bradfitz) wrote in [info]lj_dev,

noindex advertisement in Atom feeds now

As originally posted here, we're now advertising noindex in Atom feeds for Google's blogsearch.

Example:
http://www.livejournal.com/users/davetest/data/atom

(look at the feed element.... view source if your browser prettifies XML)

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    Your reply will be screened

    Your IP address will be recorded 

  • 18 comments

[info]evan

September 26 2005, 18:42:56 UTC 6 years ago

wow, i didn't realize that urns are legal xml namespaces.

[info]bradfitz

September 26 2005, 19:17:12 UTC 6 years ago

I didn't think about it. expat doesn't complain, in any case.... says it's well-formed.

[info]evan

September 26 2005, 19:50:56 UTC 6 years ago

I don't think expat is exactly the pinnacle of well-formedness testing. ;)

(But that doesn't necessarily mean it's wrong. xmllint doesn't seem to mind, though the --valid flag causes it to complain about a missing DTD.)

[info]crschmidt

September 26 2005, 20:18:30 UTC 6 years ago

Yeah, it's allowed. I've seen it done a couple times in the past. (Not that that's the reason I think it is: I've read so in XML introductory documentation.)

[info]ruakh

September 26 2005, 21:21:32 UTC 6 years ago

Totally. The Namespaces in XML recommendation even implies that URNs are ideal for this:

[Definition:] The attribute's value, a URI reference, is the namespace name identifying the namespace. The namespace name, to serve its intended purpose, should have the characteristics of uniqueness and persistence. It is not a goal that it be directly usable for retrieval of a schema (if any exists). An example of a syntax that is designed with these goals in mind is that for Uniform Resource Names [RFC2141]. However, it should be noted that ordinary URLs can be managed in such a way as to achieve these same goals.

(Granted, that's from the days of XML 1.0, and the Namespaces in XML 1.1 doesn't seem to have preserved that statement; however, both documents use URNs as XML namespaces in examples they give.)

[info]njyoder

September 26 2005, 18:49:55 UTC 6 years ago

The log message for the CVS update describing the new format is wrong. Bad brad, bad.

[info]bradfitz

September 26 2005, 19:15:49 UTC 6 years ago

How so? What are you talking about?

[info]njyoder

September 26 2005, 19:20:03 UTC 6 years ago

The log says: for the 'record', on an Atom document:

[feed xmlns='http://www.w3.org/2005/Atom' indexing:index="no" xmlns:indexing="urn:atom-extension:indexing"]


But the actual modification to the Atom document by the code is to idx:index.

[info]njyoder

September 26 2005, 19:35:58 UTC 6 years ago

To clarify, the code is modifying the idx:index attribute instead of the indexing:index attribute as specified by the log message.

[info]evan

September 26 2005, 19:47:58 UTC 6 years ago

They're equivalent. That's how XML namespaces work.

[info]njyoder

September 26 2005, 19:58:23 UTC 6 years ago

You can substitute "indexing" for "idx" in any arbitrary xml document without specifying some equivalence? What part of the standard specifies an equivalence between the two? I know you can create new namespaces for anything, but you shouldn't be inconsistent with which ones you use.

[info]njyoder

September 26 2005, 20:12:43 UTC 6 years ago

Oooh, it looks like he changed xmlns:indexing=xmlns:idx too, so he is consistent, even if it doesn't actually reflect what the log message says for the name of the namespace. I'd find it weird if the XML standard actually had some 'hard coded' part of it that actually said you could just arbitrarily substitute specific strings like idx=indexing as if they were the same namespace.

[info]crschmidt

September 26 2005, 20:24:01 UTC 6 years ago

The whole point of XML namespaces is that the prefix doesn't matter. What matters is the Namespace URI "urn:atom-extension:indexing" -- when you get the attribute, you're going to do element.getAttribute("urn:atom-extension:indexing", "indexing"), so the idx/indexing will never play into it. He could change it tomorrow to "njyoder", and it wouldn't matter any more in that case.

(Granted, not all code is smart enough to use namespaces: but the whole point of extensions like this is to be based on the URI, so code that breaks because of a prefix differences has absolutely no business in anything that people should expect to work reliably.)

[info]njyoder

September 26 2005, 20:27:30 UTC 6 years ago

Oh so it's just a temporary label associated with the actual namespace? That makes more sense.

[info]crschmidt

September 26 2005, 21:02:58 UTC 6 years ago

Yep. That's the way XML namespaces (and the prefixes associated with them) work. As I said, applications can (and often do, in simple cases) just use the NS binding, especially if it's a popular/well known one (foaf, for example, will probably always refer to http://xmlns.com/foaf/0.1/), but that's not the ideal way of dealing with XML namespaced content.

[info]evan

September 26 2005, 21:17:20 UTC 6 years ago

sadly, i've seen code that does exactly that wrong thing. sorta makes me wanna arbitrarily rename all of my namespaces just to break peoples' broken software, but i don't think i've ever had a use for xml namespaces...

[info]crschmidt

September 26 2005, 21:32:46 UTC 6 years ago

Yeah, and much of my code does the wrong thing, but I've never written code, involving XML, that was for distribution. So I don't feel *too* bad about it.

I do change namespaces in my RDF docs just to fuck with people though: usually using the null namespace prefix where people don't expect it.

[info]dvae

September 27 2005, 16:11:02 UTC 6 years ago

Atom change may have broken feed reading in Thunderbird

Is this change why Thunderbird 1.0.6 feed reader now says my LJ atom feeds are invalid? Was working last week, but is now broken. So definately coincidental to this change.

Maybe Thunderbird can't handle namespaces in atom? Any idea how to investigate further?
Create an Account
Forgot your login or password?
Facebook Twitter More login options
English • Español • Deutsch • Русский…