[Nitro] Nitro creating invalid XML
bryan.a.soto at gmail.com
Wed Feb 1 11:22:47 EST 2006
On 2/1/06, James Britt <james_b at neurogami.com> wrote:
> George Moschovitis wrote:
> >>I tried doubling up: "Thongs &amp; boxers"
> >>but something in the rendering code is far more clever than me, as it
> >>*still* emits the raw '&'
> >>How do I tell Nitro (which I gather is using REXML under the hood) to
> >>emit correct XML? This does not appear to be the default behavior of
> >>REXML, so I'm guessing that Nitro is telling the parser to do this.
> > I dont think Nitro does this. This is possibly REXML's fault, but I
> > will investigate this.
> Before posting, I tried a mall REXML app that simply read in and spit
> back some XML< and the ampersands were fine. I believe there is a way t
> tell REXML to not do certain character escaping (or to autoescape text
> when added) though, and perhaps there is something in Nitro doing this.
> > Anyone can help here?
> If no one knows offhand, I might be able to take a look.
You can see what Nitro does if you look at
nitro/lib/nitro/compiler/morphing.rb. Nitro calls REXML::
Document.parse_stream which converts the & to & and then calls the text
callback, which simply adds it to the buffer. Perhaps we should be doing
some entity escaping in the text callback?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Nitro-general