Fabe Dole
Fabe Dole

Reputation: 31

Convert vbscript into rapid integration flowlanguage

I'm using Pervasive 9.2 and would like to somehow convert the vbscript into pervasives RIFL language. I want to execute the code during a Process where the f(x) component is executed to run the code. As far as the Path to the xml data, I'll be using a Macro defining where the source data is and another to save the file as well.

Here is the vbscript code below:

Set xml = CreateObject("Microsoft.XMLDOM")

xml.async = False
count_var = 1

If xml.Load("c:\folder1\test.xml") Then             
    For Each accounts In xml.SelectNodes("//Accounts")               
        For Each account In Accounts.SelectNodes("./Account")      
            If count_var > 1 Then           
                Set accountEnum = xml.createNode(1, "Account" & count_var, "")                                      
                For Each child In Account.childNodes                                                
                    accountEnum.appendChild(child.cloneNode(TRUE))                    
                Next
                Accounts.replaceChild accountEnum, Account          

                xml.save("c:\folder1\test.xml")

            else                     
               Set accountEnum = xml.createNode(1, "Account" & count_var, "")

               For Each child In Account.childNodes
                  accountEnum.appendChild(child.cloneNode(TRUE))
               Next       
               Accounts.replaceChild accountEnum, Account           

               xml.save("c:\folder1\test.xml")        

              End If
              count_var = count_var + 1

        Next           
        count_var = 1   
    Next
End If

Set node = Nothing
 Set xml = Nothing

Upvotes: 0

Views: 51

Answers (1)

Related Questions