how to translate xml using xslt with complex rules

rgweb

New Member
i have a xml file, and want to translate it using xslt with complex rules.the source xml is like this:\[code\]<analysis> <blocks> <block id="35" original="5,13"> <contain>6 ,7</contain> </block> <block id="33" original="20"> <contain>11, 8, 9, 10</contain> </block> </blocks> <images> <image id = "11">./img/a.jpg </image> </images> <lines> <line id="6"/> <char font="2">a</char> <char font="2">a</char> <char font="2">a</char> <char font="2">a</char> <line id="7"/> <char font="2">b</char> <char font="2">b</char> <char font="2">b</char> <char font="2">b</char> <line id="8"/> <char font="2">c</char> <char font="2">c</char> <char font="2">c</char> <char font="2">c</char> <line id="9"/> <char font="2">d</char> <char font="2">d</char> <char font="2">d</char> <char font="2">d</char> <line id="10"/> <char font="2">e</char> <char font="2">e</char> <char font="2">e</char> <char font="2">e</char> </lines></analysis>\[/code\]the result xml is:\[code\]<result> <block id="35"> <text> aaaabbbb </text> </block> <block id="33"> <text> cccc </text> <image ref="./img/a.jpg"/> <text> ddddeeee </text> </block></result>\[/code\]the rule is:under the tag "block", there is "contain" flag, whose content is the id set which the block references.
 
Back
Top