Splitting Xml Document according to node

后端 未结 2 1060
说谎
说谎 2021-01-26 06:39

My xml document looks like .. (its actually a kml file for google map..)

 
  
    

        
2条回答
  •  别那么骄傲
    2021-01-26 07:12

    Between and tag ..

    dim strXML as string = .... 'place your XML to be splitted here
    dim x as integer     
    Dim aXML As New List(Of String)
    dim sAdd1 as String = ' Folder1'
    
    dim sAdd2 as String = ''
    
    while true    
    x=instr(strXML,"")
    if x > 0 then
      strXML = mid(strXML,x+11) 
      x=instr(strXML,"")
    
      aXML.Add(sAdd1 & mid(strXML,1,x-1) & sAdd2)
    
      strXML = mid(strXML,x+12)
      strXML = trim(strXML)
      if strXML.length=0 then exit while
    else
      exit while
    endif    
    loop
    

    aXML is result array .. The code not tested yet .. so, let me know if that's not working ..

提交回复
热议问题