i am doing my college project and stuck at one point in xslt transfomrations,i have an xml which contains details about food which is shown below
<food>
<healthy>yes</healthy>
<fruits>
<range>350<range>
<mango>
<seasonal>yes</yes>
</mango>
<apple>
<color>red</color>
</apple>
</fruits>
</food>
i need to write and xslt which generates an output in yaml format using above xml as input
topic:the topic about discussion is food
type: fruits
num_mango: 1
properties:
healthy:yes
seasonal:yes
type: fruits
num_apple: 1
properties:
color: red
can anyone give me a hint as to how i proceed, i thought of using maps so that for all enetring nodes starting with apple in one map and all nodes with mango in another map. and then tried ietrating over maps and generating output, but this is not good because i then need to have so many maps as each fruit increases.
No comments:
Post a Comment