Bug 17850 - When generating namespace pages, monodoc does not ignore CDATA-enclosed code blocks, leading to blank pages or exceptions
Summary: When generating namespace pages, monodoc does not ignore CDATA-enclosed code ...
Status: RESOLVED FIXED
Alias: None
Product: Tools
Classification: Mono
Component: Doctools ()
Version: unspecified
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Joel Martinez
URL:
Depends on:
Blocks:
 
Reported: 2014-02-18 13:16 UTC by Larry O'Brien
Modified: 2015-11-04 10:40 UTC (History)
1 user (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Larry O'Brien 2014-02-18 13:16:42 UTC
On namespace summary pages, such as http://iosapi.xamarin.com/?link=N%3aMonoTouch.CoreLocation, monodoc iterates over all members of that namespace (in order to extract data for its listing of members).  During that iteration, it attempts to parse the EcmaDoc XML files, **including** <code> elements whose contents have been marked as "do not parse" with a <![CDATA[...]]> block.

The upshot is that if there is code that uses restricted characters (in particular '<'), for instance, `List<T>` it may break the code at this point:

at Monodoc.Generators.Html.Ecma2Html.Htmlize (System.Xml.XmlReader ecma_xml, System.Xml.Xsl.XsltArgumentList args) [0x0000b] in /Volumes/Documents/src/xamarin/mono/mcs/class/monodoc/Monodoc/generators/html/Ecma2Html.cs:69 
  at Monodoc.Generators.Html.Ecma2Html.Htmlize (System.Xml.XmlReader ecma_xml, System.Collections.Generic.Dictionary`2 extraArgs) [0x000a1] in /Volumes/Documents/src/xamarin/mono/mcs/class/monodoc/Monodoc/generators/html/Ecma2Html.cs:61 
  at Monodoc.Generators.Html.Ecma2Html.Export (System.IO.Stream stream, System.Collections.Generic.Dictionary`2 extraArgs) [0x00000] in /Volumes/Documents/src/xamarin/mono/mcs/class/monodoc/Monodoc/generators/html/Ecma2Html.cs:84 
  at Monodoc.Generators.HtmlGenerator.Generate (Monodoc.HelpSource hs, System.String id, System.Collections.Generic.Dictionary`2 context) [0x00182] in /Volumes/Documents/src/xamarin/mono/mcs/class/monodoc/Monodoc/generators/HtmlGenerator.cs:81 
  at Monodoc.RootTree.RenderUrl[String] (System.String url, IDocGenerator`1 generator, Monodoc.Node& node, Monodoc.HelpSource hintSource) [0x00016] in /Volumes/Documents/src/xamarin/mono/mcs/class/monodoc/Monodoc/RootTree.cs:365 
  at macdoc.DocTools.GetHtml (System.String url, Monodoc.HelpSource helpSource, Monodoc.Node& match) [0x0001b] in /Volumes/Documents/src/xamarin/monomac/samples/macdoc/DocTools.cs:30 


if the GetHtml URL is of the form "N:MonoTouch.CoreLocation"

---

To reproduce: look at ios-api-docs commit 54a3af5063f1f52384cd6a627869661678411c84 (2014-02-18) and you'll see how two '<' in CDATA-escaped samples break the MonoTouch.CoreLocation namespace summary 

---

Once/while this bug is addressed, we (I) should sweep the EcmaDoc so that code examples are all escaped with CDATA. 

This defect should probably be assigned to jmartinez.
Comment 1 Joel Martinez 2015-11-04 10:40:21 UTC
I'm fairly certain this one was resolved long ago.