xsl copy xml but move 1 field value to another
Posted: Mon Jun 25, 2007 3:39 pm
Hi guys
I am new to xsl and have what could be quite a simple problem. I am
trying to take an xml file and copy the entire file, i then want to
take a value out of 1 area in the file and put it in another area so
below is an example of what i'm trying to do:
Go from this xml
<startrequest>
<userdetails>
<username>
test username
</username>
<userdetails>
<furtherdetails>
.....................
.....................
</furtherdetails>
<requestdetails>
<username>
</username
</requestdetails>
</startrequest>
to this xml, notice i have moved the username from the userdetails tag
to the requestdetails tag, I am not aware of the structure of the xml
at runtime, all i know is that the requestdetails tag will be present
and the userdetails tag will be present but everything else can
change..
<startrequest>
<userdetails>
<username>
</username>
<userdetails>
<furtherdetails>
.....................
.....................
</furtherdetails>
<requestdetails>
<username>
test username
</username
</requestdetails>
</startrequest>
Can anyone help me with this, is someone able to provide me with the
xsl needed?
Thanks
Peter
I am new to xsl and have what could be quite a simple problem. I am
trying to take an xml file and copy the entire file, i then want to
take a value out of 1 area in the file and put it in another area so
below is an example of what i'm trying to do:
Go from this xml
<startrequest>
<userdetails>
<username>
test username
</username>
<userdetails>
<furtherdetails>
.....................
.....................
</furtherdetails>
<requestdetails>
<username>
</username
</requestdetails>
</startrequest>
to this xml, notice i have moved the username from the userdetails tag
to the requestdetails tag, I am not aware of the structure of the xml
at runtime, all i know is that the requestdetails tag will be present
and the userdetails tag will be present but everything else can
change..
<startrequest>
<userdetails>
<username>
</username>
<userdetails>
<furtherdetails>
.....................
.....................
</furtherdetails>
<requestdetails>
<username>
test username
</username
</requestdetails>
</startrequest>
Can anyone help me with this, is someone able to provide me with the
xsl needed?
Thanks
Peter