writing xslt to transform xml with atrribute names into tags



I have the following xml input.



<?xml version="1.0" encoding="utf-8"?>
<update-all-attributes>
<document name="http://ift.tt/1b6wEti">
<attribute name="PageType" value="product" />
<attribute name="ProductId" value="8" />
<attribute name="Title" value="Ctrl + Z"></attribute>
</document>


How do I write xslt query to transform it into the xml below where I parse the attribute name and create a tag out of it.



<?xml version="1.0" encoding="utf-8"?>
<update-all-attributes>
<document name="http://ift.tt/1b6wEti">
<PageType>product</PageType>
<ProductId>8</ProductId>
<Title>Ctrl + Z</Title>
</document>

No comments:

Post a Comment