Altova StyleVision 2024 Basic Edition

ASPX Interface for Web Applications

Home Prev Top Next

If an HTML report of DB or XML data for the Internet is to be created with an SPS, then the usual procedure for creating the report with StyleVision would be as follows:

 

1.If the source data is in a DB, then, with the finished SPS active in StyleVision, generate an XML file from the DB. (If the source data is in an XML file, then this step is not required.)

2.Also from the SPS, generate the XSLT-for-HTML file.

3.Transform the XML file using the generated XSLT-for-HTML file.

4.Place the resulting HTML file on the server.

 

For a web application, the HTML file could become outdated if the source (DB or XML) data is modified. Updating the HTML file on the Web server with the new data would require: (i) for DB-based data, the re-generation of the XML file, (ii) transforming the new XML file using the XSLT-for-HTML, and (iii) placing the result HTML file on the server.

 

StyleVision provides a solution to quickly update HTML web pages. This is a feature for automatically generating an ASPX application. All the required ASPX application files (the .aspx file, XSLT file, and the code files) are generated by StyleVision. These files can then be placed on the server together with the source DB file or XML file and the XSLT-for-HTML file. Each time the .aspx file—which is the web interface file—is refreshed, the following happens: (i) for DB-based data, a new XML file is generated from the DB; for XML-based data, this step is not required; (ii) the XML file is transformed using the XSLT-for-HTML file that is on the server; and (iii) the output of the transformation is displayed in the web interface page. In this way, the web interface page will quickly display the latest and up-to-date DB or XML data.

 

Generating files for an ASPX solution

After creating the DB-based SPS or XML-based SPS, do the following to create an ASPX solution:

 

1.With the SPS active in StyleVision, generate the ASPX files by clicking the command, File | Web Design | Generate ASPX Web Application. The ASPX application files will be created in the folder location you specify. The folder in which you generate the ASPX application will contain the following files among others:

 

Readme.doc

SPSFilename.aspx

SPSFilename.xslt

SPSFilename.cs

 

2.Place the DB file or XML file on the server, in the same folder as the ASPX application. The .aspx file is the entry point of the application. Refreshing this file will cause the DB or XML data that is displayed in it to be updated.

 

Note:You will need to have Altova's RaptorXML application installed in order for the XSLT transformation to run correctly. If you have problems with the transformation, see the ReadMe.doc file for details about setting up RaptorXML.

 

How it works

The folder in which you generate the ASPX application will contain the following files among others:

 

Readme.doc

SPSFilename.aspx

SPSFilename.xslt

SPSFilename.cs

 

SPSFilename.aspx is the URL of the output document. SPSFilename.aspx executes C# code stored in the file SPSFilename.cs. This C# code reads the XML content (from files or a database as required) and passes it to RaptorXML, together with the SPSFilename.xslt file. (RaptorXML contains Altova’s XSLT transformation engine. It can be downloaded from the Altova website.) RaptorXML performs a transformation of the XML content, using the provided XSLT file. The result is an HTML document, which the web application then displays in the browser. When the XML content changes, for example because of changes made to the database, browsing to SPSFilename.aspx (or refreshing the page in the browser) will automatically fetch the most recent data from the database or XML file and render an updated document.

 

 

© 2017-2023 Altova GmbH