How to build a website with XML ?

Hello all.

I’m searching for input on how one would go ahead with building a website, using XML.

I see that there are several areas where XML can fit into the architecture, but I’d like some feedback on this, preferably from real life projects.

1. Presentation done with XSLT on top of XML.
- Benefits:
- Easy to add new interfaces.
- Separation of functionality & data

- Drawbacks:
- Need to learn XSLT
- Takes more work than hacking it up in ASP/PERL

2. Creating a website as a “thin” client using Javascript & DHTML to communication with XML services, and dynamically generate the presentation on the client.
- Benefits:
- All the benefits of Java applets without the heavy download
-
- Drawbacks:
- At the moment very few XML enabled browsers
- Back in the “write for every individual browser” paradigm

Anyway, I’d appreciate some feedback on these early ideas of how XML will fit into real life projects and architechtures.

Happy coding

Jens Jakob

http://www.tamino.com

The Software AG webshop
http://www.webshop.softwareag.com/
uses XML as the underlying data layer (the catalog,orders ,user profiles,…) are stored in a Tamino in XML.

The technique we used is the following :
- Presentation layer 1 : JSP pages calling Java Beans. These JavaBeans speak HTML (They deliver the data as HTML Tables, ect). So the web pages can be composed by the JSP people

- Presentation layer 2 : the XSLT layer. This is the JavaBeans layer that translate XML to HTML using the stylesheets. Of course the stylesheets have a big influence on the look and feel of the presentation1. This is where a problem can appear if your web designer doesn’t know about XSL. There are multiple solutions :
* based on a graphical prototype, let a XSL specialist write the XSL
* Use standardized XSL → HTML outputs on wich you can apply a CSS = combination of CSS and XSL.
* Use a tool that can help to create the XSL.

- Business Logic layer : these are Java components that speak XML. The Java Layer can integrate all functional systems.

- Data layer : a XML Information Server, integrating all Data Sources.

Indeed writing XSL is still a programmer task. But by using this technique your system will gain in flexibility. You should be able to revamp your website by just exchanging the XSL. This is certainly the case for portals like jetspeed http://java.apache.org/jetspeed/

JF

J-F Declercq
Software AG Belgium
+32-2.777.03.28

Hi,

take a look at the Apache Cocoon project for an open source solution.

On the commercial side you may want to have a look at http://sunshine.sundn.de

sunShine is our e:integration product built on top of Cocoon and offering portal,user authentication,a simple CMS and connectors to XML sources such as Tamino. All done with XML and XSL.

Best regards

Matthew Langham

An XML document will have your content eg


John
Duke


Food
3
500.55


Your XSL will select nodes within the XML Document for presentation in the web page. First you will need to import the Style sheet.

xsl:stylesheet
<xsl:apply-template match=“/”/> here you apply all the values from the nodes you select in the XML document.

Now you select each node in the XML document depending on you choice of ho to display.

<xsl:value-of select=“Customer/Name”/>

this will dis play all the customers on your page


NB remember to import the xsl page.