The core use I have for XSLT at work is when I interface with my Java middleware system using SOAP. The data I get back is encoded in XML and I needed to put these into reasonably complex HTML templates.
What I didn't do was just do XML->HTML. What I did instead was use XSLT to make a file that Data::Dumper could read and then eval() that.
I know its a bit perverse but I had a morning to render some data which would have taken me hours to figure out using XPATH.
With this example in mind, it should indicate that I had data from one system that I needed to translate into another form. Both the data and the translation language followed a set of rules that everyone knows so producing said translation was just a matter of leg work.
To me that is the power of XSLT. Provided at least one side speaks XML then you can translate into almost anything. In my case, into something that made it easier to use within HTML::Template.
Of course XSLT (with XPATH et al) is a little verbose and ugly and some of the query statements are profane. But like most other technologies, you use it when its best to and don't when its not.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.