I have an xml stack like this;
<translations>
<message1>A message</message1>
<message2>A second message</message2>
</translations>
Using xslt and the for-each method, how can I get the name (message1, message2) and values (A message, A second message) as key/value pairs?]
EDIT:
My desired output would be used to generate a javascript object e.g.
<script type="text/javascript">
var t = {
<xsl:value-of select="name()" /> : '<xsl:value-of select="." />'
}
</script>
Obviously the above doesn’t work but that was my initial thinking…
Output: