The moose likes XML and Related Technologies and the fly likes Layout framework design Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Layout framework design" Watch "Layout framework design" New topic

Layout framework design

Peter van Rensburg

Joined: Jan 11, 2003
Posts: 2
Hi all,
I'm new to XML/XSLT and as practice I've fiddling around today with the idea to create a basic rendering and layout 'framework'.
The goal is modularity and maintainability, not so much performance right now.
Basically the thought I had was to have three components here:
1. Source XML, lets say created in a servlet with JDOM from a database.
2. A layout transformation, either done in the same servlet or in a filter.
3. A formatting transformation, either as a filter or part of a filter chain with 2.
Perhaps I can illustrate with an example:
Source XML
Layout Transformation -> View the source
HTML substituting/formatting -> View the source
So basically, the source XML will contain no layout or formatting data, as the target audience might vary. The layout transformation will create the basic layout of the document, it will use a mixture of html tags and xml tags, for instance <box>. This will keep things a lot cleaner, instead of pages and pages of repeating HTML. This transformation should probably output XHTML.
The second transformation will take the output from the first transformation and substitute our custom XML tags with the relevant HTML code.
If you got this far in my post, thank you
I have a few questions:
1. Is this a good idea, are these the right technologies to use for the job?
2. Should I just put the full HTML code in the first style sheet instead of using custom XML tags?
3. Should I rather use taglibs or something and avoid the second transformation?
4. Does my stylesheets, especially the second one, look ok? It seems to work using my container's (Resin) builtin XSL classes but not using some commandline xslt processor (libxslt's xsltproc).
Any comments/advice/criticism/ideas very welcome.
Thank you,
Peter van Rensburg

Joined: Jan 11, 2003
Posts: 2
*bump*. Any thoughts anyone ?
I agree. Here's the link:
subject: Layout framework design
It's not a secret anymore!