Author: Sam Shieh
October 2007
Situation:
You have multiple customers who want similar data displayed in vastly different situations. The ability to quickly adapt display as business rules change is a must. The potential pitfall is maintaining multiple page files for each customer with essentially the same functionality.
Solution:
Create a single backend XML generator to collect the data and then run the output through XSL transformation. Allow configuration to control which *.xsl is used for a given customer.
Tips and Tricks:
XSL has many tools to allow you to do anything from dynamically generating entire pages on the fly to page fragments for a specific section.
The conditional tags such as
For example say we have the following XML data:
<customer>
<url>http://www.rossgroupinc.com</url>
</customer>
Using the following XSL we can select a configuration for a given customer:
When the condition matches, as it does in this case, the statements inside of the if block will be executed. This can be anything from a simple “yes” or “no” condition to another template. Any tag in HTML can be dynamically generated in XSL. For example, below is the XSL for a dynamically generated link:
If you need more information, contact Gary Codeluppi at 937-431-1026 x123 or visit the Ross Group Inc web site at www.rossgroupinc.com.
