The tool I am looking for should be able to generate a XSLT template based upon one XSD file (target = source). Without changes to the template the execution of the XSLT would result in a XML file that is exactly the same as the source. My goal is to use the template and do minor changes to the sequence of tags in the result XML-file. The reason I need this is that the legacy system we use, requires a strict pre defined sequence of the tags.
I'm not aware of any such tools. In any case, I don't understand why you need it in the first place - just use the identity transform, which is universal for any input document, and then add template rules for cases that you need to handle specially.
Thanks for your respons Pavel,
I am not sure if 'identity transform' can help me, but I did get some ideas from it. I am just starting to learn about XML, XSD and XSLT and I see there is a lot to it. So maybe there is a very easy solution for my problem. Maybe when I explain my problem some more with an example, you can help me further.
The company I work for (Gondrand Logisitics) is a logistic service provider. Currently we are developing a so called EDI engine, using a third party (GLI) for mapping of (EDI) messages. An example is the mapping from an EDIFACT IFTMIN message for shipping orders that we receive from one of our partners. The result of the mapping (by GLI) is an XML message. The next step is to offer the XML message to our legacy system in order to create the shipment-orders.
The problem is that the nodes in the result of the mapping by GLI are not in the correct sequences. Underneath you find a part of the result message.
<shipment>
<goodslines>
<goods_basic>
<quantity>1</quantity>
<quantity_unit>FK</quantity_unit>
<grossweight>65</grossweight>
<net_weight>5</net_weight>
</goods_basic>
<goods_description type="GOODS">
<descriptiontext>ROSES</descriptiontext>
</goods_description>
</goodslines>
<addresses role="UNLOADING_PARTY">
<searchname>12031</searchname>
<address_details>
<name_line_1>EC Fischer AG</name_line_1>
<address_line_1>Florastrasse 12</address_line_1>
<city>Littau Luzen</city>
<country>CH</country>
<postal_code>6014</postal_code>
</address_details>
<contact_details type="ANY">
<name>Eric</name>
<communication_details type="PHONE">
<mean>+41-12345678</mean>
</communication_details>
</contact_details>
</addresses>
<basic_data>
<primary_reference>822510</primary_reference>
<terms_of_delivery>EXW</terms_of_delivery>
<terms_of_delivery_place>AALSMEER</terms_of_delivery_place>
</basic_data>
</shipment>
The correct order of nodes should be:
<shipments>
<basic_data>
<addresses>
<goodslines>
</shipment>
I have created a 1:1 XSLT (using a trial version of Altova MapForce) for this message and without changes it already gives me the correct result. Allthough this works fine and I only need to do this once for this message type, I do need this for other message types as well. Besides that I will probably need to go in more detail with other messages in adding template rules. The 1:1 XSLT would give me a good headstart to do that, I presume.
Do you, or anyone else for that matter, know a nice and simple solution?