From: Bob Hutchison Date: 2007-12-08T04:18:16+09:00 Subject: Re: REXML: parsing a string with unescaped ampersand entities Hi, On 7-Dec-07, at 1:12 PM, Frank Reiff wrote: > Hi, > > REXML seems to SOMETIMES choke on parsing ampersands within entities, > e.g. > > string = ' encoding="UTF-8"?>hello&world' > doc = Document.new(string) > puts "#{doc}" > > works fine (output below): > hello&world > > BUT: > > string = 'hello& > world' > doc = Document.new(string) > puts "#{doc}" > [ snip] > > What is going on? and how can I fix this? Neither is legal XML, both should fail. You can either escape the content or use a CDATA block. Cheers, Bob > > > Best regards, > > Frank > -- > Posted via http://www.ruby-forum.com/. > ---- Bob Hutchison -- tumblelog at http://www.recursive.ca/so/ Recursive Design Inc. -- weblog at http://www.recursive.ca/hutch http://www.recursive.ca/ -- works on http://www.raconteur.info/cms-for-static-content/home/