Maybe somebody had similar problem. I need to transform using XSL the input XML file:
<decision>
<akapit nr = 1>
This is <b>important</b> decision for the query number <i>0123456</i>
</akapit>
</decision>
As output I need a html document which displays text within elements <b></b> as bolded, elements in <i></i> as italic…etc. So, basically I need to format output HTML from XML element named <akapit> depending on their subelements’ names. Any idea how to use XSL template in such a case?
In case the markup elements names aren’t the same as the corresponding Html element names, for example:
Then a very simple application of the identity rule is this:
And when this transformation is applied on the above XML document, the wanted, correct result is produced:
Do Note: Using
xsl:apply-templatesshould be preferred toxsl:copy-ofas the latter doesn’t allow flexibility to further process the selected nodes — it only copies them.