abdera-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Elias Torres" <el...@torrez.us>
Subject Re: Graceful handling of non-atom 1.0 feeds
Date Sun, 11 Jun 2006 21:22:41 GMT
On 6/11/06, James M Snell <jasnell@gmail.com> wrote:
> There's actually a very practical use for this arbitrary XML parsing
> mechanism that's already in the code.  When you call
> content.setValue(...) on an atom:content with XML content, you can pass
> in an XML string.  The parser will parse it to create the appropriate
> ExtensionElement object to set as the child of the content object. This
> also works when setting XHTML content on the Content and Text objects,
> making it very simple for us to construct XML and XHTML nodes.
>
> The API is something like...
>
>   entry.setContentAsXml("<a><b><c/></b></a>", baseUri);

Sure, but that's not as important. That's also the XML parser's job. :)

>
> Regarding spec compliance, I had been kicking around the idea of a
> Validator.INSTANCE.validate(...) mechanism.  You could pass in any of
> the FOM objects and have it validate against the spec.  This would also
> allow us to configure validators of various strengths and purposes (e.g.
> StrictValidator, LiberalValidator, UlterliberalValidator,
> MyGdataValidator, Atom03Validator, etc).  It also provides a clean
> separation between the parser and the validator.
>

This is more like what I was looking for, except maybe I'd rather have
this at parsing time, no? It'd be too slow to parse, then walk the FOM
for validation. Maybe it's the other way around, too slow to do it at
parse time, but if we have validation modes, then we would skip
validation. Hopefully this is something that can set Abdera apart, a
pluggable Atom validation scheme.

-Elias

Mime
View raw message