Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to create xml from another xml meta data?
    text
    copied!<p>I am not sure whether the title clearly explains my problem, will try to include as much details I can.</p> <p>I need to convert below xml to a properly formatted one using Xslt 1, so that I can deserialize it to a .net type.</p> <p>Source XML</p> <pre><code> &lt;ax21:result type="test.ws.Result"&gt; &lt;ax21:columnNames&gt;fileName&lt;/ax21:columnNames&gt; &lt;ax21:columnNames&gt;lockedState&lt;/ax21:columnNames&gt; &lt;ax21:columnNames&gt;currentLockOwner&lt;/ax21:columnNames&gt; &lt;ax21:columnNames&gt;UUID&lt;/ax21:columnNames&gt; &lt;ax21:resultData&gt;Test1.doc&lt;/ax21:resultData&gt; &lt;ax21:resultData&gt;true&lt;/ax21:resultData&gt; &lt;ax21:resultData&gt;analyst&lt;/ax21:resultData&gt; &lt;ax21:resultData&gt;f48f0450-9ecc-4a44-b063-898d9d72d112&lt;/ax21:resultData&gt; &lt;ax21:resultData&gt;Test2.doc&lt;/ax21:resultData&gt; &lt;ax21:resultData&gt;false&lt;/ax21:resultData&gt; &lt;ax21:resultData/&gt; &lt;ax21:resultData&gt;f48f0450-9ecc-4a44-b063-898d9d72d112&lt;/ax21:resultData&gt; &lt;ax21:resultData&gt;Test3.doc&lt;/ax21:resultData&gt; &lt;ax21:resultData&gt;true&lt;/ax21:resultData&gt; &lt;ax21:resultData&gt;analyst&lt;/ax21:resultData&gt; &lt;ax21:resultData&gt;f48f0450-9ecc-4a44-b063-898d9d72d112&lt;/ax21:resultData&gt; &lt;ax21:resultData&gt;Test4.doc&lt;/ax21:resultData&gt; &lt;ax21:resultData&gt;false&lt;/ax21:resultData&gt; &lt;ax21:resultData/&gt; &lt;ax21:resultData&gt;f48f0450-9ecc-4a44-b063-898d9d72d112&lt;/ax21:resultData&gt; &lt;/ax21:result&gt; </code></pre> <p>Target XML</p> <pre><code>&lt;result&gt; &lt;item&gt; &lt;fileName&gt;Test1.doc&lt;/fileName&gt; &lt;lockedState&gt;true&lt;/lockedState&gt; &lt;currentLockOwner&gt;analyst&lt;/currentLockOwner&gt; &lt;UUID&gt;f48f0450-9ecc-4a44-b063-898d9d72d112&lt;/UUID&gt; &lt;/item&gt; &lt;item&gt; &lt;fileName&gt;Test2.doc&lt;/fileName&gt; &lt;lockedState&gt;true&lt;/lockedState&gt; &lt;currentLockOwner&gt;analyst&lt;/currentLockOwner&gt; &lt;UUID&gt;f48f0450-9ecc-4a44-b063-898d9d72d112&lt;/UUID&gt; &lt;/item&gt; &lt;item&gt; &lt;fileName&gt;Test2.doc&lt;/fileName&gt; &lt;lockedState&gt;true&lt;/lockedState&gt; &lt;currentLockOwner&gt;analyst&lt;/currentLockOwner&gt; &lt;UUID&gt;f48f0450-9ecc-4a44-b063-898d9d72d112&lt;/UUID&gt; &lt;/item&gt; &lt;/result&gt; </code></pre> <p>Can this be done using xslt? If yes, pls post a link or a sample xslt for me to try.</p> <p>I am using .net 2.0, c#, XSLT 1.0</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload