Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries [Thread Prev] >Thread Next - Re: right approch (newbie) right approch (newbie)To: NULL Date: 9/1/2005 5:54:00 AM Hi, I'm pretty new to XSLT and I don't know how to approach this transformation problem I have. I'm converting XML to XML from a very simple record-like format to an insanely complex highly nested format. I don't have any control over either format. What I do have is a list of rules mapping input paths to output paths, e.g. /rec/id1 => /aaa/bbb/ddd/fff /rec/id2 => /aaa/bbb/ccc /rec/id3 => /aaa/bbb/ddd/eee I can code these rules individually easily enough but the problem is that when I apply to this input <rec> <id1>hello</id1> <id2>and</id2> <id3>goodbye</id3> </rec> I get this output <aaa><bbb><ddd><fff>hello</fff></ddd></bbb></aaa> <aaa><bbb><ccc>and</ccc></bbb></aaa> <aaa><bbb><ddd><eee>goodbye</eee></ddd></bbb></aaa> when what I want is this <aaa> <bbb> <ccc>and</ccc> <ddd> <eee>goodbye</eee> <fff>hello</fff> </ddd> </bbb> </aaa> Seems to me that I have to write some sort of generic merging and reordering code to post process the output, but I have no clue how to do that in XSLT. Any clues on how to approach this problem will be greatly appreciated. John | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
