abdera-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James M Snell <jasn...@gmail.com>
Subject Re: extensionfactory to handle bad namespace
Date Wed, 31 Oct 2007 20:04:33 GMT
Ok, this is actually somewhat difficult right now but definitely
possible.  What you'd need to do is create a custom ExtensionFactory
implementation (that does not extend AbstractExtensionFactory) and use
that to create the appropriate objects.  The getElementWrapper method is
not required to return an instance of an actual ElementWrapper subclass.

It would take a bit of work to do, because the internal element passed
in to getElementWrapper would need to be used to create a new instance
of the appropriate FOM impl.

It's entirely possible that this could be made easier.

- James

Woody Anderson wrote:
> hello,
> 
> i'm getting an errant namespace in responses from various servers.
> 
> e.g.
> <?xml version="1.0" encoding="utf-8"?>
> <entry xmlns="http://purl.org/atom/ns#">
>   <title xmlns="http://purl.org/atom/ns#">Example Title</title>
>   <summary xmlns="http://purl.org/atom/ns#">Example Text</summary>
>   <content xmlns="http://purl.org/atom/ns#" mode="xml">
>     <div xmlns="http://www.w3.org/1999/xhtml">Example Text</div>
>   </content>
>   <id xmlns="http://purl.org/atom/ns#">urn:lj:livejournal.com:atom1:username:number</id>
>   <link xmlns="http://purl.org/atom/ns#" type="application/x.atom+xml"
> rel="service.edit"
> href="http://www.livejournal.com/interface/atom/edit/3" title="Example
> Title"/>
>   <link xmlns="http://purl.org/atom/ns#" type="text/html"
> rel="alternate" href="http://username.livejournal.com/number.html"
> title="Example Title"/>
> </entry>
> 
> i want to handle this as though it were a correctly namespaced entry.
> all types of elements from this server comeback with this namespace,
> so i need this for each of the model elements.
> 
> I'm a bit confused about how i do this for all elements. I've been
> looking at AbstractExtensionFactory.
> and ExtensionFactory docs, but it is unclear what getElementWrapper()
> is supposed to do to make it all "work".
> 
> i would hope that it's fairly simple to consume this bogus namespace.
> 
> i found an old example doing something *similar* that extended
> FOMExtensionFactory (which no longer exists..) to handle an Atom03
> feed. This example doesn't work anymore and was still pretty confusing
> as it seemed to work for Feed only.
> 
> is there a simple way to handle this errant ns?
> thanks
> -w
> 

Mime
View raw message