[uf-discuss] hAtom look-see

Robert Bachmann rbach at rbach.priv.at
Wed Mar 22 09:36:22 PST 2006


Hi Chris,

Thanks for your feedback.
Please note that feed title, feed updated, feed id and feed link
aren't covered by hAtom 0.1.
So we (the stylesheet authors) needed to come up with our own extraction
methods, which I'll outline with some pseudo-code.

Chris Casciano wrote:
> In Example 1:
> 
> Error 1: Field Feed-updated is an empty tag -- TOOL error
(see below)

> Error 2: Field Feed-id is an enpty tag -- TOOL error

 # $source-uri is an <xsl:param> for the stylesheet

 IF $hfeed-level/a:[@rel="bookmark"]
	FEED-ID = $feed-level/a:[@rel="bookmark"]/@href
 ELSE IF $hfeed-element[@id != ""]
	FEED-ID = $source-uri + "#" + @id
 ELSE
	FEED-ID = $source-uri

Note: The proxy had a bug, it didn't pass $source-uri to the XSL - this
is fixed now.


> Error 3: Fields  Entry-id is an empty tag -- AUTHOR error
> Error 4: Fields entry-author is an empty tag -- AUTHOR error (must use
> ADDRESS outside of entries)

> Warning 1: Field Feed-Title is empty -- would be TOOL


  IF $hfeed-level/*[@class="feed-title"]
	FEED-TITLE = $hfeed-level/*[@class="feed-title"]
  ELSE IF $hfeed-level/h1|h2|h3|h4|h5|h6
	FEED-TITLE = $hfeed-level/h1|h2|h3|h4|h5|h6
  ELSE
	FEED-TITLE = ""

I think this could be extended to
  # ...
  ELSE IF nearest-in-parent(*[@class="feed-title"])
	FEED-TITLE = nearest-in-parent(*[@class="feed-title"][1])
  ELSE IF nearest-in-parent(h1|h2|h3|h4|h5|h6)
	FEED-TITLE = nearest-in-parent(h1|h2|h3|h4|h5|h6)
  ELSE
	FEED-TITLE = /html/head/title

> Warning 2: Feed Missing atom:link with rel="self" -- would be TOOL
So what should that link look like?
<link
      rel="self"
      href="http://someproxy.org/?url=http://example.com/bar" />

> In Example 2:

> Error 2: Field Feed- id must be a full and valid URL --  TOOL error
> Error 3: Field entry - id must be a full and valid URL --  TOOL error
This was caused by the bug mentioned above.

> Error 4: field entry updated must be an RFC-3339 date-time --  TOOL error
Currently we just do copy the string from the input to the output.
Future versions will try to re-format (and add needed extra specificity)
to the input, for example:

 20031213               -> 2003-12-13T18:30:00-00:00
 2003-12-13             -> 2003-12-13T18:30:00-00:00
 2003-12-13 18:30+01    -> 2003-12-13T18:30:00+01:00
 2003-12-13 18:30:02+01 -> 2003-12-13T18:30:02+01:00

> Things the hatom
> parser should do but isn't:
> 
> * Value the feed - updated timestamp based off document statistics

Future versions will perhaps do something like this
	
	A = array();
	FOR EACH $d IN $entry-updated
		A.add( pad-datetime($d) )
	FOR EACH $d IN $entry-published
		A.add( pad-datetime($d) )
	A.sort_by ( datetime-to-utc($element) )
	FEED-TITLE = A[0];

Robert
-- 
Robert Bachmann <rbach at rbach.priv.at> (OpenPGP KeyID: 0x4A5CCF10)


More information about the microformats-discuss mailing list