Information Center

Quick jump to:

SobiPro Templates & Design - The Template Language XSL

The Template Language XSL

Last updated: 11. December 2016

Refers to version: 1.3+

Introduction

SobiPro presents the shown data in a XML document and uses XSL to describe how the XML elements should be displayed. XSL stands for EXtensible Stylesheet Language. The XML document does NOT describe how the data are displayed. These information are within the XSL template files.

Like CSS is the style sheet language for HTML, XSL is the style sheet language for XML. But XSL is more than a style sheet language. XSL consists of several parts. The most important part for us here are XSLT, the language to transform our XML document (into (X)HTML or RSS feeds or any other kind of output), and XPath, the language for navigating in XML documents.

Access the XML data in a XSL template via such called nodes. A node consists of a node path (XPath) and an element or attribute (attributes are starting with @).
With XSLT (XSL Transformation) you can add/remove elements and attributes to or from the visible output. You can also rearrange and sort elements, perform tests and make decisions about which elements to hide and display, and a lot more.

XSLT uses XPath (node paths) to find information in an XML document. XPath navigates through elements and attributes in XML documents, using path expressions to select nodes or node-sets in the XML document. XML documents are treated as trees of nodes. There are several kinds of nodes available, the most important for us here are the element and attribute.

SobiPro templates - XML/XSL Processing screenshot

See also XSL(T) Languages on w3schools.com and XPath Syntax on w3schools.com to learn more about XSL and XPath.

Show the XML data in the Browser

To help you in understanding the XML data SobiPro produces, you can see the raw XML output by adding &xml=1to the URL in the browser's address bar. You have to set first the global configuration setting Raw XML Output to On. Do do so, go to the System SettingsGlobal ConfigurationDebug & Error Logging.

Don't forget to switch this off again if you do not longer need it, as it shows all information of your entry which you probably don't want to show to the public.

After you added &xml=1or /?xml=1if you have SEF URLs switched on, to the URL in the browser's address bar, you will see the raw XML data. To format the data in a readable way, take a look to the browser's source code while the raw data are shown.
The source code can be accessed by:

  • Firefox: Tools ➜ Web Developer ➜ Page Source = Ctrl-U (PC), Cmd-U (Mac)
  • Chrome: View ➜ Developer ➜ View Source = Ctrl-U (PC), Alt-Cmd-U (Mac)
  • Edge: Context menu ➜ Show Source (PC)
  • Safari: Develop ➜ Show Page Source = Alt-Cmd-U (Mac)

For some browsers you need to switch on first the web developer mode. If you are using another browser, please check the browser's manual or help pages on how to show the source code of a page.

Books and other Resources

There are several books available concerning XSLT.
Also there are a lot of web sites dealing with this topic. A good site is from w3schools.com. The description of XSLT in Wikipedia has a lot of additional links concerning this topic.

XSL Editors

You can use any text editor to create and edit XSL templates. But there are also several XSL editors available. Try also the Online Editor of w3schools.com.

Ot course you do not need to use an external editor, as SobiPro provides you with a powerful built-in code editor for your template files!

Copyright (C) 2006-2018 Sigsiu.NET GmbH (https://www.sigsiu.net). All rights reserved.

This documentation and all images therein are copyrighted and protected by law. You may not publish, distribute or sell them or parts of it without explicit written permission of Sigsiu.NET GmbH.

Published on Wednesday, 8 September 2010.
Visited 7114 times.
Powered by SobiPro
to Top