creating a structured xml from an unstructured xml
example xml file
-"<"root">"
-"<"a">"yo"<"/a">"
-"<"a">"start"<"/a">"
-"<"a">"me"<"/a">"
-"<"a">"R[1]"<"/a">"
-"<"a">"R[2]"<"/a">"
-"<"a">"me"<"/a">"
-"<"a">"R[3]"<"/a">"
-"<"a">"stop"<"/a">"
-"<"a">"woo"<"/a">"
-"<"/root">"
what i need is to start reading the xml file when 'start' is read from the node
and stop when 'stop' is read from the node, when me is there make it a parent node to items containing R[x].
output trying to achieve...
-"<"root">"
-"<"a">"me
-"<"b">"R[1]"<"/a">"
-"<"b">"R[2]"<"/a">"
-"<"/a">"
-"<"a">"me
-"<"b">"R[3]"<"/a">"
-"<"/a">"
-"<"/root">"
thanks
|