View Single Post
  #1 (permalink)  
Old August 10th, 2005, 02:58 PM
geoffgeoffgeoff geoffgeoffgeoff is offline
Registered User
 
Join Date: Aug 2005
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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