Portus Version 2018-08-24
 

Creating a Stylesheet for your Portus Data

XSL stands for EXtensible Stylesheet Language, and is a style sheet language for XML documents. XSLT stands for XSL Transformations.

XSLT can be applied to the response payload of Portus REST requests.

It is commonly used, but not restricted, to creating HTML pages based on the REST response.

When configured to use XSLT, a Portus service will (by default) return an XML stylesheet processing instruction embedded in the XML.

Therefore, the client consuming this data should be able to load the XSL link, and apply the XSLT to the payload.

In some cases, the client may not have the ability to understand XML processing instructions (browsers on mobile devices are a good example). In this case, Portus has the ability to apply the XSLT on the server side, and send the transformed results. In this case, providing the __xslTransform=server option on the REST request will tell Portus to apply the XSLT before sending the payload, and no XML stylesheet instruction will be included, e.g.

http://host/Service?LIST&ID=*&__xslTransform=server

Create HTML page from City XML

This tutorial will outline how to apply XSLT to a MySQL service. Without any transformation, the service will return raw XML, and we will apply an XSLT to display this in a HTML table.

Ostia
www.ostiasolutions.com
Copyright @ 2006-2018 Ostia Software Solutions Limited.