[Nitro] Nitro creating invalid XML

James Britt james_b at neurogami.com
Mon Jan 30 15:09:05 EST 2006


The ruby-doc home page has this bit of XHTML:

<a href="http://www.rubystuff.com/undies.html">Thongs &amp; boxers</a>

Raw ampersands are not allowed in XML, and so are disallowed in XHTML as 
well.  Hence the use of the entity reference.

But the rendered page gives me "Thongs & boxers", replacing the entity 
with the raw ampersand.  This is a Bad Thing.

I tried doubling up:  "Thongs &amp;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 think in the meantime I'll be using 'and' in place of the nicer '&' )

Thanks

-- 
James Britt

http://www.ruby-doc.org       - Ruby Help & Documentation
http://www.artima.com/rubycs/ - The Journal By & For Rubyists
http://www.rubystuff.com      - The Ruby Store for Ruby Stuff
http://www.jamesbritt.com     - Playing with Better Toys
http://www.30secondrule.com   - Building Better Tools



More information about the Nitro-general mailing list