abdera-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Garrett Rooney" <roo...@electricjellyfish.net>
Subject Re: problems setting entry content
Date Mon, 02 Apr 2007 13:37:04 GMT
On 3/31/07, Brian Moseley <bcm@osafoundation.org> wrote:
> On 3/31/07, Adam Constabaris <adam@clownsinmycoffee.net> wrote:
>
> > If you are going to use an XML content type, then the content has to be
> > a well-formed fragment; so change that to
> > entry.setContent("<foo>foo</foo>", "application/eim+xml") and you should
> > see results.  What's happening is that your content is passed through an
> > XML parser when you call setContent, and the code in 0.2.2 and trunk
> > silently swallows (most? all?) parsing exceptions.
>
> ah, it wasn't immediately clear that my string was being parsed as
> xml. my string actually is an xml document, which i believe is well
> formed, so i'm not sure what specifically could be going wrong with
> the parsing. i guess i'll need to step through with a debugger to see.
>
> here's something interesting: i'm now trying to set a json string
> value with the media type "application/eim+json", and it's also
> failing in exactly the same way.
>
> i finally found something that works. instead of calling
> setContent(Content, String), i'm calling setContent(String, String).
> this has exactly the effect i want. i guess my original problem was in
> misusing the abdera Content class.

Hmm.  So I guess that means you were calling:

Content setContent(Element element, String mediaType) throws
MimeTypeParseException;

Right?  Perhaps the docs on that could be improved to better describe
its intended use case, so people don't stumble down that path again?
Or, if it should have worked (I'm not really sure, James?) there may
just be a bug there.

-garrett

Mime
View raw message