|
|
|
|
|
|
| |
| Page 1 of 4
|
  |
Case Study: Data-Driven XSL
Introduction
As business to business commerce and inter-enterprise communication
via XML continues to explode, developers will continually be faced
with situations where they must convert XML documents from an
incoming structure to the structure they use internally. It is this
translation requirement that we will use as premise for this case
study.
For an example situation where you might want to carry out such
translations, consider converting an invoice sent by a field office
into a format that is used by central office. The central office
computer would have an application, or a web page, that could load
the incoming invoice, extract only the information required by
central office, and present it in a way that is relevant to the
staff at central office, that is, with its data labels changed.
Such a utility would save much time and trouble sifting through
lots of data just to pick out the snippets of useful
information.
In this case study we will show how to use ASP to create an XSL
file dynamically, and we will data-drive the process using an XML
file to define the contents of the XSL file. It is not the intent
of this case-study to provide the ultimate translation tool. In
fact, this is a simple translation tool that will only map elements
to other elements, working within a fixed container/item structure.
The mapping process that takes place could be achieved by a simple
XSL transformation, which is effectively what we are doing, with
the exception that the XSL is being generated on demand.
Our example consists of the following pieces:
|
File name
|
Description
|
|
incoming.xml
|
In-bound XML that needs to be translated
|
|
default.asp
|
Client-side test page that shows the translation at work
|
|
interpreter.asp
|
The ASP page that generates the XSL
|
The pieces are related to each other as shown below:

1999 Wrox Press Limited, US
and UK.
| Page 1 of 4 |
  |
|
|
|
|
|
|
|
|
|