I have the following XML sample:
<finding>
<title>Found something</title>
<heading>Severity:</heading>
<text>Really low.</text>
<heading>URL:</heading>
<text>https://www.something.com:443</text>
<heading>Description:</heading>
<text>We have found an issue</text>
<heading>Impact:</heading>
<text>This is bad.</text>
<heading>Recommendations:</heading>
<text>Fix it!.</text>
</finding>
Is this easily done with an XSLT? I am using Python with lxml if that helps.
What I would like to have is an XSLT that will give me the following:
<finding>
<title>Found something</title>
<severity>Really low.</severity>
<url>https://www.something.com:443</url>
<description>We have found an issue</description>
<impact>This is bad.</impact>
<recommendations>Fix it!</recommendations>
</finding>
Thanks!
XSLT would be a fairly decent way to do it. The selector for the
textnodes is a little complex, but a template along the following lines should do it (just add modified versions of this for your other headings).Note that the identity stylesheet is probably a reasonable starting point for adding your templates to.