Title: 6-404 Create Document/View Web Applications with XML
1Create Document/View Web Applications With
XML Dino EspositoWrox Press 6-404
2(No Transcript)
3Agenda
- Documents and views
- XML and ASP
- HTML and XMLDOM
- XML and MFC
4Doc/View Background
- Model-View-Controller architecture
- Foundation of SmallTalk 25 yrs ago
- MFC Doc/View model simplification
- Separation between data and presentation
5XML And XSL
- Two distinct files Data and presentation
- XSL applies transformations to XML data
- XSL knows about the XML code structure
6Doc-View On The Web
Win32 - MFC
IE 5.0
XSL
XSL
XSL
CView
CView
CView
XML Data
CDocument
HTML Page
7Three Scenarios For XML/XSL
- Different stylesheets via ASP
- Different stylesheets via XMLDOM and Dynamic HTML
- Different stylesheets via MFC classes
8Agenda
- Documents and views
- XML and ASP
- HTML and XMLDOM
- XML and MFC
9XSL Selection Via ASP
- Frame-based page
- Surrounding graphics and controls
- An ltIFRAMEgt window gets the XML text through an
ASP page
10Ex. 1 Web Doc-View
Stylesheets
ltIFRAME srccontent.asp?XSLgt
11Using ASP Trade-Offs
- Easy to design and code
- Everything happens on the server
- Serious overhead
- XML data is continuously downloaded
- Each representation requires a new page with the
same data
12Agenda
- Documents and views
- XML and ASP
- HTML and XMLDOM
- XML and MFC
13Using Data-Islands
- The HTML page embeds the XML code to display
- The ltxmlgt tag in IE5.0
- Retrieve the data-island text through the
Dynamic HTML DOM - Apply the necessary transformation on the client
14Whats A Data-Island?
lthtmlgt ltbodygt ltxml idMyDatagt lt Enter ASP
code to produce XML data gt lt/xmlgt lt!-- Rest
of the page --gt lt/bodygt lt/htmlgt
- The ltxmlgt tag supports the src attribute
- ltxmlgt is IE50-specific
- Use DHTML
15Ex. 2 Using XMLDOM
Stylesheets
ltDIVgt filled at runtime via XMLDOM
transformations
16Using XMLDOM
Request for Page.asp
Web Server
Browser (IE 5.0)
HTML page with embedded XML code
Instantiate XMLDOM, convert to HTML and
use Dynamic HTML to display the final code
17Using XMLDOM Trade-Offs
- Browser-dependent
- Everything takes place on the client
- XML data downloads only once
- Only additional XSLs download
- DHTML script code on the client
18Agenda
- Documents and views
- XML and ASP
- HTML and XMLDOM
- XML and MFC
19Using MFC And CHtmlView
- A MFC application using CHtmlView
- Internet Explorer 5.0 gives you automatic
support for XML and XSL - Force WebBrowser to display XML
- Use temp files
- Everything takes place locally
20Ex. 3 Using CHtmlView
Load OLE DB data and convert to XML
Stylesheets
WebBrowser displays a temporary XML file
21Using MFC Trade-Offs
- A familiar programming model
- WebBrowser (IE 5.0) dependent
- Everything takes place on the client
- Take advantage of XML support in SQL Server 2000
22(No Transcript)