rajeshpalakk
New Member
I have the below xml sheet:\[code\]<?xml version='1.0' encoding='windows-1256'?><tc><tt> <sd>112</sd> <sN>Good Day</sN> <id>468629</id> </tt> </tc>\[/code\]Which i want to convert to as below:\[code\]<Tada schemaVersion="2" xmlns:ge="ST" xmlns:gl="TS" xmlns:ga="SG"><ge:test internalID="90566" dateAdded="2013-03-19T11:49:28" lastEdited="2013-03- 20T16:26:49" > <ge:TN="World" internalID="161634" /> </ge:test></Tada>\[/code\]I have cut them both short, as they are very long files. But the idea here is to convert from first xml to second xml. Now how do I put this line: schemaVersion into my final output, The rest of the items should be easy to tranlate / match. I would try them with the XPath commands. I tried using XSLT as below:\[code\]<?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <Tada schemaVersion="2" xmlns:ge="ST" xmlns:gl="TS" xmlns:ga="SG"> <xsl:template match="/"> <Title> <xsl:value-of select="//tt/sd"> </xsl:value-of> </Title> </xsl:template> </tada></xsl:stylesheet>\[/code\]But in my test above it doesnot write out : the schema version line, instead it types out the whole file as follows:\[code\]112Good Day468629\[/code\]Thank you.