📜 ⬆️ ⬇️

XSLT - a mechanism for beginners

Greetings Habr.
I am very pleased with the emergence of a blog dedicated to XSLT technology.
Many are very afraid of starting to learn XSLT due to the small number of CMS using this technology as a template.
This article will provide an example of the XSLT connection mechanism on hosting with PHP4, PHP5.

At one time, after reading about xslt technology, I could not test it for a long time because my knowledge of php was not very strong, there were no free CMS offering it as a template engine at that time.
Not long "googling" in the network, I found a mechanism that completely suited me.
It will allow beginners to test technology for taste.
Understand the examples.
Arm it and begin to use it vigorously.


This script, for example, will easily allow beginners to make an xml photo gallery,
with its output to the site via xslt.

Archive Description
xslt-php4-to-php5.php - adapter ("jumper") for different versions of php.
class_xslt.php - the class itself
index.php - call example
main.xml - XML ​​example
menu.xsl - XSLT example
')

Call:
<? php

startTransform ('main.xml', 'menu.xsl');
startTransform ('path_to_xml', 'path_to_xslt);
?>


I hope this mechanism will allow beginners to master XSLT
Archive can be downloaded here.
Examples for training can be taken from http://www.w3schools.com/xsl/default.asp
Use, try ...

Source: https://habr.com/ru/post/57515/


All Articles