Web Hosting by
Netfirms
|
Free Domain Names by
Netfirms
WebSite and Software Development
Home
News
Buiz
Weather
Games
Developers
Comix
Software & More
RHSCoder
VBS QuickDev IDE
AI Depot
Generation 5
contact us
Xpounded Simple XML Translation
Copy and Paste and Use this Simple XML Translator
 
Select All
'Another desktop script application 'Action: Select XMl, XSL and Translate 'Requirements: WIN98+, IE, comctl32, and MSXML. Sub saveFile(tname,s) Dim result Set result = fso.createTextFile(tname,True) result.Write s result.Close Set result = Nothing End Sub 'openDialog requires comctl32 Function openDialog(sPattern) set cd = createObject("MSComDlg.CommonDialog") if sPattern="" Then sPattern = "All Files(*.*)|*.*" cd.Filter = sPattern cd.FilterIndex = 1 cd.MaxFileSize = 128 cd.ShowOpen mscdo_File = cd.FileName Set cd = Nothing openDialog = mscdo_File End Function 'xslTransform requires MSXML Function xslTransform(sXMLDoc,sXSLDoc) Dim xmlDoc Dim xslDoc Set xmlDoc = CreateObject("Microsoft.XMLDOM") Set xslDoc = CreateObject("Microsoft.XMLDOM") xmlDoc.load sXMLDoc xslDoc.load sXSLDoc xslTransform = xmlDoc.transformNode(xslDoc) Set xmlDoc = Nothing Set xslDoc = Nothing End Function Dim fso, desktop, WshShell, msg msg="done" set WshShell = WScript.CreateObject("WScript.Shell") desktop = WshShell.SpecialFolders("Desktop") set WshShell = Nothing Set fso = createObject("Scripting.FileSystemObject") Dim xml,xmlp,xslp msgbox "select a xml file",vbokonly,"Locate XML File" xmlp = openDialog("XML File|*.xml") if xmlp<>"" then msgbox "select a xsl file",vbokonly,"Locate XSL File" xslp = openDialog("XSL File|*.xsl") if xslp<>"" then xml = xslTransform(xmlp,xslp) 'change so user can select file name if desired - add a saveDialog. saveFile desktop & "\xfile.txt",xml else msg="aborted. no xsl selected" end if else msg="aborted. no xml selected" end if msgbox msg,vbokonly,"Transform File Results" Set fso = Nothing
Minimal Notes on this one. Should be easy to follow.
- Copyright 2003
Xpounded
-
All JS code developed by Xpounded is developed in RHSCoder.
All VBS code developed by Xpounded is developed in VBS QuickDev IDE, or RHSCoder.
Privacy Statement
Feedback