|
From: Joseph O. <jo...@en...> - 2003-02-25 11:48:47
|
Argh, belay that: I won't put any change in. The writer builds the
sequence using the 'about' - and the item is stored with <link>, as the
spec shows.
Here's the relevant code to build handle the items (while building the
channel):
if(items!=null && items.size()>0) {
addItemsRef(channel, items);
Iterator iter=items.iterator();
while(iter.hasNext()) {
Item item=(Item)iter.next();
Element itemElt=addItem(root, item, "about");
addElement(itemElt, "title", item.getTitle(), true);
addElement(itemElt, "link", item.getLink(), true);
addElement(itemElt, "description", item.getDescription(),
true);
addDublinCore(itemElt, item);
}
}
And here's the code for addItem() and addItemsRef():
protected Element addItem(Element root, Item item, String resource) {
Element itemElt=null;
if(item!=null) {
itemElt=root.addElement("item");
addNSAttribute(itemElt, "rdf", resource, item.getAbout(),
false);
}
return itemElt;
}
private void addItemsRef(Element channel, List is) {
if(is!=null && is.size()>0) {
Element items=channel.addElement("items");
Element seq=items.addElement("rdf", "Seq");
Iterator iter=is.iterator();
while(iter.hasNext()) {
Item item=(Item)iter.next();
addItem(seq, item, "resource");
}
}
}
Now, the only remaining question is: "Should the <item> have its rdf:about
value matching the sequence's rdf:resource?" Right now, it does. I'm not
sure if the spec mandates it.
On Tue, 25 Feb 2003, Joseph
Ottinger wrote:
> Ahh, I see. I'll put the change in in a few hours or so.
>
> On Tue, 25 Feb 2003, Danny Ayers wrote:
>
> >
> > > Joe, the only issue with applying this patch is that I'm not sure what
> > > it's solving. You're adding the item to the sequence, and the *main*
> > > difference I see is that you're using the item LINK instead of the item
> > > ABOUT data... and those should be the same reference. Am I missing
> > > something?
> >
> > The resource in the seq should the the same as the 'about', see :
> > http://web.resource.org/rss/1.0/spec#s5.3.5
> >
> > According to the spec : "{item_uri} should be identical to the value of the
> > <link> sub-element of the <item> element, if possible.". So
> > although in most circumstances the 'about' will be the same as the <link>,
> > this isn't necessarily always the case (this was discussed a while ago on
> > rss-dev).
> >
> > (Personally I'd prefer that the specs made the <link> element optional, so
> > that self-contained items like many on blog posts were covered better, the
> > thing being described being the 'about' resource, without reference to any
> > external URL).
> >
> > Cheers,
> > DAnny.
> >
> >
> >
>
> ---------------------------------------------------------
> Joseph B. Ottinger jo...@en...
> http://enigmastation.com IT Consultant
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Rsslibj-developer mailing list
> Rss...@li...
> https://lists.sourceforge.net/lists/listinfo/rsslibj-developer
>
---------------------------------------------------------
Joseph B. Ottinger jo...@en...
http://enigmastation.com IT Consultant
|