On Mon, Aug 07, 2006 at 11:42:29PM +0200, Arjan Oosting <[EMAIL PROTECTED]> was 
heard to say:
> Hi Daniel,
> 
> Thanks for your bugreport. I am CC'ing Malcolm so he can give input as
> well.
> 
> Op zo, 06-08-2006 te 16:57 -0400, schreef Daniel Burrows:
> >   For instance, see the attached program.  HaXML doesn't escape either
> > the double-quote in an attribute value or the brackets in text data,
> > leading to an invalid HTML document.
> I agree this behaviour can be quite annoying.
> 
> >   It might be that "literal" is intended to do this -- but an
> > abstraction for XML I/O really should provide a simple mechanism for
> > generating valid XML by default, and I can't find a way to get the
> > desired result without escaping everything by hand.
> I don't know whether this behaviour is intended, but you can work around
> it quite easily. Basically you map the xmlEscape function over the
> generated Content list. See attached code below.
> 
> Malcolm, do the combinators functions, such as literal and replaceAttrs
> in the attached file, intentionally refrain from escaping special
> caracters?
> 
> Second question, could you export escapeContent function in the Escape
> module? It can be useful in cases like this.

  Hmm, perhaps the philosophy of HaXML is to store the actual content
values in the XML tree structure and to escape them later? (as is done
in your example)  That makes sense, but I wonder in that case if it
wouldn't be better for the pretty-printer to escape implicitly, as I don't
see any good reason to ever print non-escaped (= potentially invalid) XML.

  Daniel


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to