[Mono-bugs] [Bug 489687] Code render tag not working

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Mar 31 11:12:58 EDT 2009


User mhabersack at novell.com added comment

Marek Habersack <mhabersack at novell.com> changed:

           What    |Removed                     |Added
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #2 from Marek Habersack <mhabersack at novell.com>  2009-03-31 09:12:57 MDT ---
This bug is fixed in svn commits 130665 and 130667, both trunk.

Commit 130667 requires some explanation. Comment #1 above was a genuine bug in
Mono, dealt with in commit 130665, but comment #2 is also behavior exhibited by
NET. The reason for this is that .NET doesn't use a dedicated HTML/ASP parser
for .as?x files but instead it uses a series of regular expressions. The
expressions are anchored on < character and match tags, expressions etc
So, in the case of code from DefaultWsdlHelpGenerator.aspx:

<link rel="alternate" type="text/xml" href="<%=Request.FilePath%>?disco"/>

the tag regexp anchored on the first < will match a syntactically correct, and
the contents of the href attribute will not be processed, only output verbatim
to the generated source file (and then html-encoded on output to the client
browser). The result will be the same as in comment #2. The way to make it work
on .NET would be to use tag which is NOT syntactically correct:

<link rel="alternate" type="text/xml" href="<%=Request.FilePath + "?disco"%>"/>

In this instance, the .NET parsing engine will anchor on the first <, attempt
to match the tag regexp which will fail. So it will attempt to match other
regexps, which will fail as well. After that the engine will use another regexp
to find the 2nd < above, which marks the start of expression. Tag regexp will
fail as well, but expression regexp will match. At this point, .NET will decide
that text between the first < (included) and the 2nd < (excluded) constitutes
verbatim text and will be output to the source as such. The expression inside
the href attribute will be processed and its value output to the client browser
as well, followed by verbatim '"/>'.
Mono's ASP.NET parser is a validating one and will fail to parse the
syntactically incorrect tag, that's why the workaround in commit 130667 is

Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

More information about the mono-bugs mailing list