Ian GRAHAM Senior Manager, eSolutions Group Emfisys, Bank of Montreal E: ian.graham@bmo.com or utoronto.ca} W: http://www.utoronto.ca/ian/talks/ T: 416.513.5656 / F: 416.513.5590
Talk Outline
Introduction
Browsers and XHTML Server-side data management Dynamic content generation Conclusions
Navigator 1--6 Opera 3--6 Lynx IE 3--5.5 ... Basically every browser
XML channel
Only 5 XML-standard predefined general entities (lt, gt, amp, apos, and quot) No default XHTML formatting properties (exception: Mozilla/Navigator 6) No support No support (some support in Mozilla)
Supports internal DTD subsets and arbitrary entity declarations, both internal and (sometimes) external Supports DTD-based (and sometimes schema-based) validation Supports CDATA sections Supports an XML declaration Supports namespaces
Mozilla/NN6
IE 5/5.5
No special support for XHTML (use CSS+XML) No standardized support for functional markup Transform XML into HTML: XML+XSLT HTML
Browser Conclusions:
XHTML as text/html
<head> <title> ... </title> <meta http-equiv= "content-type" content= "text/html;charset=utf-8" /> </head> <body> ..... whitespace </body> before slash </html>
DOCTYPE Switching
quirks mode -- (reproduces various CSS and other layout errors of older browsers) standards mode -- (correct behavior, no quirks [supposedly!] )
DOCTYPE Switching
All XHTML DTDs get standard mode. Thus the following rule:
quirks mode: strict mode:
Summary
Have to deal with most anyway (e.g., quirky vs. strict) patching often easy to automate
Benefits
Reduced markup errors (well-formedness) Migration path to future delivery channels
Markup Guidelines
Use external scripts and CSS style sheets Avoid CDATA sections External script, style sheet files On output, auto-adjust syntax:
insert space at end of empty-element tags duplicate lang-related attributes strip/insert appropriate DOCTYPE declaration strip XML declaration
Talk Outline
Introduction Browsers and XHTML Server-side data management Dynamic content generation Conclusions
Server-Side Management
Problems
Issues:
Processing Content
Problem detected
A)
Author / edit
Publish content
B)
Author / edit
Convert to XHTML
Publish content
Alternatives
Talk Outline
Introduction Browsers and XHTML Server-side data management Dynamic content generation Conclusions
Dynamic Content
SQL, XML, files (plain text or XML fragments) Either via structured markup generating functions or true XML-based tools
Server-Side Management
text strings XHTML Fragment XHTML Fragment XHTML Fragment HTML / XHTML page template HTML / XHTML to browser
XHTML Fragments
Checking fragment well-formedness ensures well-formedness of composed content Even if template is not well-formed, wellformedness of fragments increases rendering reliability of composed product Easier to control fragment authoring
Fragment creation
Many individual writers; requires little markup knowledge; WYSIWYG often not as important Fewer, more technically skilled people; can enforce well-formedness
Fragment Creation
Subset of XHTML (e.g., p, a, br, h3, b, i, img, em) few attributes Easy to write Easy to dynamically correct markup
Advantages
Centralized code Single interface
Disadvantages
Crappy editor Need to know markup to write content
Future Alternatives
http://standardbrains.editthispage.com/
Content Assembly
Server-Side Management
XSLT processor
XHTML Fragment text strings XSLT fragment template XHTML Fragment XHTML Fragment
XSLT Advantages
XSLT
(2)
Output (2)
XSLT
XSLT
(1)
Output (1)
XSLT Caveats
Non-trivial language
Unclean separation between designer and programmer Lack of easy integration to common editing tools
Alternative Approach
Prototype-based transformations
Markup Model
...regular markup .... <xsl:prototype> <table> ... Example table content goes here ... </table> </xsl:prototype> ... More XHTML markup ....
Talk Outline
Introduction Browsers and XHTML Server-side data management Dynamic content generation Conclusions
Conclusions
Ian GRAHAM Senior Manager, eSolutions Group Emfisys, Bank of Montreal E: ian.graham@{bmo.com or utoronto.ca} W: http://www.utoronto.ca/ian/talks/ T: 416.513.5656 / F: 416.513.5590