I have an XML source file as an input which is the following:
<?xml version="1.0" encoding="UTF-8"?>
<catalog>
<car>
<brand>Mercedes</brand>
<type>ClassA</type>
<engine>Diesel</engine>
<seats>5</seats>
</car>
<car>
<brand>Audi</brand>
<type>A8</type>
<engine>Diesel</engine>
<seats>2</seats>
</car>
<car>
<brand>Mercedes</brand>
<type>ClassB</type>
<engine>Petrol</engine>
<seats>5</seats>
</car>
</catalog>
I need to filter the cars using an .xsl styleshett (XSLT) according to various data (for example: I want the list of the Mercedes brand cars with all of it's properties). My output file's structure (XML tags) has to be the same as the input after the filter.
In this case (filter Mercedes brand cars) the output has to be:
<?xml version="1.0" encoding="UTF-8"?>
<catalog>
<car>
<brand>Mercedes</brand>
<type>ClassA</type>
<engine>Diesel</engine>
<seats>5</seats>
</car>
<car>
<brand>Mercedes</brand>
<type>ClassB</type>
<engine>Petrol</engine>
<seats>5</seats>
</car>
</catalog>