You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@abdera.apache.org by Erlend Hamnaberg <ng...@gmail.com> on 2010/04/07 21:08:46 UTC

escaping XML

Hey list.

I am wondering why Abdera isn't escaping all xml entities in text values.

example:

Entry entry = factory.newEntry();
entry.setTitle("something was < & > but this was cool.");

if i then call:

String title = entry.getTitle();

This yields: "something was &lt; &amp; > but this was cool.");

Why isn't the > escaped to &gt; ?


-- Erlend

Re: escaping XML

Posted by Erlend Hamnaberg <ng...@gmail.com>.
That is true, but most other XML libraries out there escape > as well, so
for consistency it would be good.

-- 
Erlend

On Wed, Apr 7, 2010 at 9:16 PM, Andreas Veithen
<an...@gmail.com>wrote:

> Because it's not necessary.
>
> Andreas
>
> On Wed, Apr 7, 2010 at 21:08, Erlend Hamnaberg <ng...@gmail.com> wrote:
> > Hey list.
> >
> > I am wondering why Abdera isn't escaping all xml entities in text values.
> >
> > example:
> >
> > Entry entry = factory.newEntry();
> > entry.setTitle("something was < & > but this was cool.");
> >
> > if i then call:
> >
> > String title = entry.getTitle();
> >
> > This yields: "something was &lt; &amp; > but this was cool.");
> >
> > Why isn't the > escaped to &gt; ?
> >
> >
> > -- Erlend
> >
>

Re: escaping XML

Posted by Andreas Veithen <an...@gmail.com>.
Because it's not necessary.

Andreas

On Wed, Apr 7, 2010 at 21:08, Erlend Hamnaberg <ng...@gmail.com> wrote:
> Hey list.
>
> I am wondering why Abdera isn't escaping all xml entities in text values.
>
> example:
>
> Entry entry = factory.newEntry();
> entry.setTitle("something was < & > but this was cool.");
>
> if i then call:
>
> String title = entry.getTitle();
>
> This yields: "something was &lt; &amp; > but this was cool.");
>
> Why isn't the > escaped to &gt; ?
>
>
> -- Erlend
>