What would be the best way to populate (or generate) an XML template-file from a mapping of XPath expressions?
The requirements are that we will need to start with a
This transformation creates from the "expressions" an XML document that has the structure of the wanted result -- it remains to transform this result into the final result:
- 1
- bar
- foo
- 00.00
- USD
- 11.11
- AUD
- 2
- some name
- some description
- 00.01
- USD
When this transformation is applied on any XML document (not used), the result is:
1
bar
foo
00.00
USD
11.11
AUD
2
some name
some description
00.01
USD
Note:
You need to transform the "expressions" you are given into the format used in this transformation -- this is easy and straightforward.
In the final transformation you need to copy every node "as-is" (using the identity rule), with the exception that the top node should be generated in the "http://predic8.com/wsdl/material/ArticleService/1/"
namespace. Note that the other namespaces present in the "template" are not used and can be safely ommitted.