Note that there are some explanatory texts on larger screens.

plurals
  1. POXML parsing and transforming (XSLT or otherwise)
    text
    copied!<p>I have several xml files that are formated this way:</p> <pre><code>&lt;ROOT&gt; &lt;OBJECT&gt; &lt;identity&gt; &lt;id&gt;123&lt;/id&gt; &lt;/identity&gt; &lt;child2 attr = "aa"&gt;32&lt;/child2&gt; &lt;child3&gt; &lt;childOfChild3 att1="aaa" att2="bbb" att3="CCC"&gt;LN&lt;/childOfChild3&gt; &lt;/child3&gt; &lt;child4&gt; &lt;child5&gt; &lt;child6&gt;3ddf&lt;/child6&gt; &lt;child7&gt; &lt;childOfChild7 att31="RR"&gt;1231&lt;/childOfChild7&gt; &lt;/child7&gt; &lt;/child5&gt; &lt;/child4&gt; &lt;/OBJECT&gt; &lt;OBJECT&gt; &lt;identity&gt; &lt;id&gt;124&lt;/id&gt; &lt;/identity&gt; &lt;child2 attr = "bb"&gt;212&lt;/child2&gt; &lt;child3&gt; &lt;childOfChild3 att1="ee" att2="ccc" att3="EREA"&gt;OP&lt;/childOfChild3&gt; &lt;/child3&gt; &lt;child4&gt; &lt;child5&gt; &lt;child6&gt;213r&lt;/child6&gt; &lt;child7&gt; &lt;childOfChild7 att31="EE"&gt;1233&lt;/childOfChild7&gt; &lt;/child7&gt; &lt;/child5&gt; &lt;/child4&gt; &lt;/OBJECT&gt; &lt;/ROOT&gt; </code></pre> <p>How can i format it this way?:</p> <pre><code>&lt;ROOT&gt; &lt;OBJECT&gt; &lt;id&gt;123&lt;/id&gt; &lt;child2&gt;32&lt;/child2&gt; &lt;attr&gt;aa&lt;/attr&gt; &lt;child3&gt;&lt;/child3&gt; &lt;childOfChild3&gt;LN&lt;/childOfChild3&gt; &lt;att1&gt;aaa&lt;/att1&gt; &lt;att2&gt;bbb&lt;/att2&gt; &lt;att3&gt;CCC&lt;/att3&gt; &lt;child4&gt;&lt;/child4&gt; &lt;child5&gt;&lt;/child5&gt; &lt;child6&gt;3ddf&lt;/child6&gt; &lt;child7&gt;&lt;/child7&gt; &lt;childOfChild7&gt;1231&lt;/childOfChild7&gt; &lt;att31&gt;RR&lt;/att31&gt; &lt;/OBJECT&gt; &lt;OBJECT&gt; &lt;id&gt;124&lt;/id&gt; &lt;child2&gt;212&lt;/child2&gt; &lt;attr&gt;bb&lt;/attr&gt; &lt;child3&gt;&lt;/child3&gt; &lt;childOfChild3&gt;LN&lt;/childOfChild3&gt; &lt;att1&gt;ee&lt;/att1&gt; &lt;att2&gt;ccc&lt;/att2&gt; &lt;att3&gt;EREA&lt;/att3&gt; &lt;child4&gt;&lt;/child4&gt; &lt;child5&gt;&lt;/child5&gt; &lt;child6&gt;213r&lt;/child6&gt; &lt;child7&gt;&lt;/child7&gt; &lt;childOfChild7&gt;1233&lt;/childOfChild7&gt; &lt;att31&gt;EE&lt;/att31&gt; &lt;/OBJECT&gt; &lt;/ROOT&gt; </code></pre> <p>I know some C# so maybe a parser there? or some generic xslt? The xml files are some data received from a client, so i can't control the way they are sending it to me.</p> <p>L.E. Basically when i am trying to test this data in excel (for example i want to make sure that the attribute of childOfChild7 corresponds to the correct identity id) i am getting a lot of blank spaces. If i am importing in access to get only the data i want out, i have to do a thousands subqueries to get them all in a nice table. Basically i just want to see for one Object all its data (one object - One row) and then just delete/hide the columns i don't need.</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