On 6/11/06, James M Snell <[EMAIL PROTECTED]> 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
