How to convert multiline text representing as a indent tree to xml in perl?

guiceriogeomo

New Member
for example, the input is\[code\] root ^^aa ^^^^bb ^^cc ^^dd\[/code\]two ^^ represent an indent, therefore aa is child of root, bb is child of aa.
aa,cc and dd are brothers, they are all children of root.The output is a xml file, its content will be\[code\]<?xml version='1.0'?><dir name="root"> <dir name="aa"> <dir name="bb" /> </dir> <dir name="cc" /> <dir name="dd" /></dir>\[/code\]But i can't find the right perl script to solve this problem.
So search for help, Thanks a lot.
 
Back
Top