I want to convert an XML into another XML using an XSLT stylesheet.
This is the part of my input XML where I have to use XSL template(input.xml):
...
<extension>
<og:image>http://www.example.com/images/logos/logo-example-PNG.png</og:image>
<og:type>article</og:type>
<resourceName>http://www.example.com/big-data-search-managed-services-questions</resourceName>
</extension>
.......
I want my XML(output.xml) to look like this:
....
<MT N="og:image" V="http://www.example.com/images/logos/logo-example-PNG.png"/>
<MT N="og:type" V="article"/>
<MT N="resourceName" V="http://www.example.com/big-data-search-managed-services-questions"/>
...
I am trying to use an XSLT for this. But I am stuck at the XSL template part. I want my XSLT to go in the XPATH of extension and specify a template for every element inside of the extension to convert into this form:
<MT N="" V=""/>
"N" with the name of the tag name and "V" with the value of the tag
What should I specify in my XSLT?
<xsl:template match="/extension">
....
</xsl:template>