Dynamic Markup Generation Through the Use of Static XML
Document Sample


Dynamic Markup
Generation Through the
Use of Static XML
Document Templates
Joseph Longo
Classical Three Tier Model
1st Tier 2nd Tier 3rd Tier
Client Webserver Data Store
(Browser) (Generator) (Relational Database)
TCP/IP
Contemporary n -Tier Model
Internet Internet
Resource Resource
Client Service Code Internet
(Browser) (Generator) Resource
Dynamic Markup generators
CGI Common Gateway Interface
ASP Active Server Pages
Java Servlets
JSP Java Server Pages
Target Markup Languages
VoxML Voice eXtensible Markup Language
WML Wireless Markup Language
HTML Hypertext Markup Language
Problems with dynamic
generation
Very difficult to determine what the target
markup will look like once the generator
runs
No uniform way to generate markup
No mechanize to ensure that the generated
markup is valid
XML Templates Solution
Create template markup languages (1 for
each target language) TML.
Use a validating XML parser to process the
templates.
Generate the dynamic markup by affixing
meaning to the TML elements (semantics).
TML Processing
Java Servlets generator
IBM’s XML4J Validating Parser
Java Web Server
XML Template features
valid XML documents
Based on the DTD for the target langauge
TML tags are namespace protected
TML Tags (example markup)
Variable Substitution:
<html>
Hello <tml:var name=“user”/> how are you?
</html>
TML Tags continued
Conditional:
<tml:if var=“age” cond=“GT” val=“17”>
markup for true case
<tml:else/>
markup for false case
</tml:if>
Tag Processing Options
DOM Document Object Model
SAX Simple API for XML
ElementHandler XML4J proprietary
Related docs
Get documents about "