Tuesday, June 20, 2006
EJAX page formatting
It's satisfying that my vapour ware already made it to the top 15 in Google. These guys are fast!
Let me discuss one of the design choices I've made. There are two ways to get at output a browser understands: the final HTML. One is to let an XSL style sheet generate it (or an Eiffel program, that's all the same), and the other is to take an existing HTML file and modify it before sending it to the browser.
The latter approach is superior for more general purpose toolkits. You can let a designer create the layout, and you only replace portions of the page that have to come from a database.
The RICO guys had a really simple, and therefore smart, way of doing that: if an HTML element has an id, you can replace it's contents with something else. That's the approach I'm using. You just put a div or span somewhere, give it an id. That's all the designer needs to do. The page formatter takes the HTML page and replaces the contents of an element with the contents found in another XML file. Simple, predictable, powerful.
Let me discuss one of the design choices I've made. There are two ways to get at output a browser understands: the final HTML. One is to let an XSL style sheet generate it (or an Eiffel program, that's all the same), and the other is to take an existing HTML file and modify it before sending it to the browser.
The latter approach is superior for more general purpose toolkits. You can let a designer create the layout, and you only replace portions of the page that have to come from a database.
The RICO guys had a really simple, and therefore smart, way of doing that: if an HTML element has an id, you can replace it's contents with something else. That's the approach I'm using. You just put a div or span somewhere, give it an id. That's all the designer needs to do. The page formatter takes the HTML page and replaces the contents of an element with the contents found in another XML file. Simple, predictable, powerful.
Comments:
<< Home
Neal, I think a lot of pages would require a lot of XSLT coding to get right, and in my experience you just end up putting the HTML in the XSLT style sheet anyway and inserting specifics at various points.
Changing things also requires XSLT knowledge. Many more people can edit an HTML than an XSLT file. Good for maintenance as these things can be handed over to juniors.
Post a Comment
Changing things also requires XSLT knowledge. Many more people can edit an HTML than an XSLT file. Good for maintenance as these things can be handed over to juniors.
<< Home