XML : transform XML to XML by creating XSL

I want to create "XSL" template or file that transform this xml code

  <pets xmlns="http://pets.com">    <cat>      <name>Alice</name>      <age>9</age>    </cat>      <cat>      <name>Bruce</name>      <age>11</age>    </cat>      <cat>      <name>Rocco</name>      <age>11</age>    </cat>      <dog>      <name>Midnight</name>      <age>6</age>    </dog>      <dog>      <name>Rudy</name>      <age>7</age>    </dog>    

to exactly like this

  <cats xmlns="http://pets.com">    <cat name="Alice" age="9"/>    <cat name="Bruce" age="11"/>    <cat name="Rocco" age="11"/>    </cats>    

Please I need help on this how can I convert these elements to attributes?

No comments:

Post a Comment