[WINEHQ] Lots of buggy < and >

Jeremy Newman jnewman at codeweavers.com
Thu Jul 28 14:47:28 CDT 2005


Yeah, this is a long standing issue of using HTML output in an XML
document. In reality, you should not embed HTML in XML. I've done some
tricks in our parser to get it to work, but it still fails in certain
areas. The XML parser will convert any &lt; to < and that is returned to
the browser. Any text in between < and > is ignored by your browser. It
assumes it is an HTML tag. What I do is convert &lt; to &amp;lt;. This
then allows the parser to return &lt; Messy, very messy.

I used to have this in the parser, then I removed it thinking I didn't
need it anymore. Wrong, this is still needed so I re-added back to our
code.

IIRC, this trick still causes errors with other things needing &'s. I
checked and at least it does not break any URLs with & as delimiters.

If there is a better way to do this, I'd love to know how.

On Thu, 2005-07-28 at 13:06 +0200, Francois Gouget wrote:
> Reading WWN 284 I noticed the following line:
> 
> > stabilizing for release &.
> 
> And sure enough the source XML is buggy:
> 
> > stabilizing for release &amp;&lt;g&amp;&gt;.
> 
> I believe the intent was the following to deal with the double parsing:
> 
> > stabilizing for release &amp;lt;g&amp;gt;.
> 
> 
> But really this double parsing is a major pain. Can't we get rid of it?
> Because it's causing a lot of bugs:
> 
> $ egrep "&lt;.*&gt;" wwn/*.sgml | grep -v "who=" | wc -l
> 190
> 
> 
> And it's not just missing grins either. For instance in WWN 125:
> 
> > gdb &lt;gdb remote protocol&gt; winedbg &lt;Win32 debug API&gt; wineserver
> 
> and all the reader sees is:
> 
> > gdb  winedbg  wineserver
> 
> which is totally wrong of course.
> 
> 
> And in WWN 149:
> 
> > #include &lt;comcat.h&gt; <br />
> > #include &lt;oaidl.h&gt;<br />
> > #include &lt;objbase.h&gt;<br />
> > #include &lt;objidl.h&gt;<br />
> ...
> 
> all the reader sees is:
> > #include
> > #include
> > #include
> > #include
> ...
> 
> Not very informative!
> 
> 




More information about the wine-devel mailing list