Posts

Showing posts with the label xpath

Structuring the XML output.

Note: This post will be used as reference for several posts on XSLT. If you just want to do a simple transformation where you do the same thing over and over again when a template hits, you don't really need to call templates. Say you have a long list of records (the music kind) and you want to extract the ones by Michael Jackson, you can simply perform an if-statement inside the template. <!-- Given a structure like this one... --> < recordCollection > < record > < artist > Madonna </ artist > < title > Like a prair </ title > </ record > < record > < artist > Gorillaz </ artist > < title > Gorillaz </ title > </ record > < record > < artist > Madcon </ artist > < title > Beggin </ ...