I've got the following piece of code in VBScript:
Dim OrganizationInfo, name
Dim Location, country
Set xmlDoc = CreateObject("Microsoft.XMLDOM")
xmlDoc.Async = "False"
xmlDoc.setProperty "SelectionLanguage", "XPath"
xmlDoc.load("C:\Users\AdminUser\XMLArchive.xml")
Set fso = CreateObject("Scripting.FileSystemObject")
Const ForAppending = 8
Set WriterObject = fso.OpenTextFile("C:\Users\AdminUser\Folder\TEXTFile.txt", ForAppending, True)
For Each OrganizationInfo In xmlDoc.SelectNodes("//OrganizationInfo/OrganizationName")
name = OrganizationInfo.Text
For Each Location In OrganizationInfo.SelectNodes("//Location")
COUNTRY = Location.Text
WriterObject.WriteLine DATA & ";" & Pais
Next
Next
I'm using Xpaths to write lots of XML Node's Text in multiple txts, without problems.
Now I need to repeat this process with 1000 XMLs in the same directory that "XMLArchive.xml" is inserted, without knowing their names... Can anyone please help? I've seen similar cases here, but none with the same intention.