[XML-SIG] Problem with entities

Thomas B. Passin tpassin@comcast.net
Tue, 16 Apr 2002 20:00:16 -0400


[Lars Marius Garshol]

>
> I was off travelling when this was posted, but feel it's worth
> returning to.
>
> ...
> Of course, that would give you the 'oe' character as output, and you
> seem to want the entity.
>
> The first answer to that is: you shouldn't represent characters using
> entities. It's just The Wrong Thing.
>
> The second answer is that a very strong desire to do The Wrong Thing
> is very widespread, and so perhaps we should support it. There are two
> ways to do that:
>
>  - add a entity(self, name) method
>
>  - add a literal_text(self, text) method
>
> Comments on this?
>

This is strictly a matter for a serializer.  There are a lot of things
people seem to want to do that belong in the serializer domain.  Let's not
just hack at this.  Maybe there is something systematic we add to the basic
serializer design to provide a hook for people to modify the output stream.
Not to change the way the tree is traversed (or virtually traversed in case
there is no actual tree), but just to hook in.

This way, one essentially could plug in a post-processor with no
modifications to standard code and standard interfaces.  The plug-in could
enumerate its capabilities, perhaps.  If we want an entity replacer, we
couldn't easily replace them with the original entity names, but we could
supply a translation dictionary form characters to entities.  If we want to
change element names to upper case, we can do that.  And so on...

Cheers,

Tom P