XML Read/Write/Amend with VB.NET

Last post 07-05-2005 10:54 AM by lgdt. 0 replies.

Sort Posts:

  • XML Read/Write/Amend with VB.NET

    07-05-2005, 10:54 AM
    • Member
      10 point Member
    • lgdt
    • Member since 06-27-2005, 10:09 AM
    • Posts 26

    I have the following code (written in classic ASP with VB) which I need to convert to VB.NET. Basically I need to replace tags in an XML file writing it back.

     

    I am absoultely flummoxed as to how to do it. Any suggestions would be gratefully received.

     

    Thanks in advance.

     

    Set rootNode = Server.CreateObject("AspXml.AspXml")
    rootNode.LoadXmlFile Server.MapPath("../_templates/" & strtmpFilename)

    Set Contentnode = Server.CreateObject("AspXml.AspXml")

     set TmpNode = rootNode.getroot

     if Not (tmpNode is Nothing) then
     
      
      tmpNode.RemoveAllAttributes
      tmpnode.tag = "div"
      if strmode="edit" then
       tmpnode.addattribute "id","thisis" & strmode & "mode"
       
      else
       tmpnode.addattribute "id",strmode 
       
      end if
      
     else

      Response.Write ("ERROR : NO Maslow Template tag found [TAG <rb:tmp>]") 

     end if

Page 1 of 1 (1 items)