views:

2536

answers:

4

Given a source XML document and a sample of what it should look like after it is transformed, is there a code generator that could create an XSL transform to accomplish that.

I am not expecting it to be perfect but, much like the code generators that can create XSD from sample XML, it would be a good starting point to then refine by hand.

+1  A: 

See the similar question How to generate XSLT from XML samples for possible solutions.

Kosi2801
+1  A: 

What you're asking is, essentially, "Given a set of input data and an output, is it possible to infer the logic of a program that will produce that output?" Except for the trivial case - where the program produces the provided output irrespective of the input - the answer is "No."

Robert Rossney
A: 

try ALTOVA MapForce

mia
A: 

I know you probably don't need it anymore, but this app looks promising and exactly what you're looking for:

http://www.cs.mu.oz.au/~jbailey/xsltgen/XSLTGen.htm

Has anybody tried it as yet?

saurabhj