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 Sat, 31 Mar 2007 14:13:39 GMT
On 3/31/07, Adam Constabaris <adam@clownsinmycoffee.net> wrote:
> Brian Moseley wrote:
> >
> > setting content as Content with type
> > ==========================
> >
> > Content content = factory.newContent();
> > content.setValue("foo");
> > content.setMimeType("application/eim+xml");
> > entry.setContent(content, "application/eim+xml");
> >
> > after doing this, entry.getContent() returns null, and when i ouput
> > the entry document, the content element is empty (but once again has
> > the correct type).
> >
> > any ideas?
>
> 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.

Hmm, if that's the case that seems, well, bad to me.  Perhaps we
should define some specific exception type to throw in that sort of
case...

-garrett

Mime
View raw message