Antranig - July 17, 2008

MathML Support and DOCTYPES

mjnsakai: Is there a way in RSF to add additional DOCTYPES, or change the default DOCTYPE emitted by the HTML rendering of RSF?
AntranigBasman: Well, you can always just create your own ContentTypeInfo record
mjnsakai: I've been looking at MathML and it calls for name space extensions to XHTML.
AntranigBasman: To use your own content types, simply arrange at startup somehow a call to the static ContentTypeInfoRegistry.addContentTypeInfo() registry with your new content types
AntranigBasman: And you can also use this to override the core framework definitions
mjnsakai: That sounds right.
AntranigBasman: It is somewhat unSpringlike, but pretty simple (tongue)
mjnsakai: I like simple.
mjnsakai: Have a look a this:
mjnsakai:

<?xml version="1.0"?> 
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN"  
                "http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd" [ 
   <!ENTITY mathml "http://www.w3.org/1998/Math/MathML"> 
 ]> 

mjnsakai: Note the entity inclusion.
AntranigBasman: wacky (tongue)
mjnsakai: It's legitimate XML.
mjnsakai: Its a kind of escape mechanism.
mjnsakai: it allows mathml to be defined locally as an entity.
mjnsakai: based on the DTD referenced.
mjnsakai: Could I do this with ContentTypeInfoRegistry?
AntranigBasman: Yes
mjnsakai: cool
mjnsakai: SVG works the same way, btw.
mjnsakai: I might not leverage this stuff, because it only works in Mozilla. IE requires a plugin.