Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XML
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old April 22nd, 2006, 08:51 AM
Authorized User
 
Join Date: Mar 2006
Location: , , .
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default Create a new XML file with vbscript

Could someone point me to a tutorial or example that will show me how to create an XML file with vbscript

I just want to save the XML file to the C:\ drive, and I cannot use ASP or any server side scripts.

I just want a brand new XML file in that folder that looks something like

<root>
<info>test</info>
<info2>my info goes here</info2>
</root>

I cant find any online tutorial that will show me how to do this.

Thanks!

Reply With Quote
  #2 (permalink)  
Old April 23rd, 2006, 10:42 PM
Authorized User
 
Join Date: Mar 2006
Location: , , .
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I got something put together that I think should work, but its not. It runs with no errors, but I dont get a file created. Here is my code:
<html>
<body>
<script languate="vbscript">




Set fso = CreateObject("Scripting.FileSystemObject")
    Set f = fso.createTextfile("C:\temp\NewXmlFile.xml", True)
    With f
        .Writeline "<root>"
    .Writeline "<element>test</element>"
    .Writeline "</root>"
        .Close
    End With

    Set xmlDom = CreateObject("Microsoft.XMLDOM")
    XmlDom.async = False
    XmlDom.Load("C:\temp\NewXmlFile.xml")

    XmlDom.Save("C:\temp\NewXmlFile.xml")


</script>
</body>
</html>

Reply With Quote
  #3 (permalink)  
Old April 24th, 2006, 03:28 AM
mhkay's Avatar
Wrox Author
Points: 17,773, Level: 58
Points: 17,773, Level: 58 Points: 17,773, Level: 58 Points: 17,773, Level: 58
Activity: 9%
Activity: 9% Activity: 9% Activity: 9%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,839
Thanks: 0
Thanked 267 Times in 262 Posts
Default

You're asking questions about browser security settings, Javascript etc, which have nothing to do with XML and are off-topic for this forum. You might hit lucky and get an answer from someone, but not from me.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
Reply With Quote
  #4 (permalink)  
Old April 24th, 2006, 07:01 AM
Authorized User
 
Join Date: Mar 2006
Location: , , .
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hoes does creating an xml file with VBSCRIPT have ANYTHING to do with browser security settings, or javascript? Sorry that I'm such a newb, but it seems that it fits to me. I want to create an xml file, so Im in the xml forum...

Reply With Quote
  #5 (permalink)  
Old April 24th, 2006, 07:31 AM
mhkay's Avatar
Wrox Author
Points: 17,773, Level: 58
Points: 17,773, Level: 58 Points: 17,773, Level: 58 Points: 17,773, Level: 58
Activity: 9%
Activity: 9% Activity: 9% Activity: 9%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,839
Thanks: 0
Thanked 267 Times in 262 Posts
Default

Your problem is creating a file from within the browser. The fact that it's an XML file is irrelevant. Normal browser security settings prevent you from modifying the filestore on the client machine.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Create XML file from SLQ Server2000 using vbScript ilearn XML 1 September 5th, 2008 02:32 AM
Create XML file - add elements according to range remya1000 XML 5 October 3rd, 2007 02:50 PM
Create XML file - According to the Value, add elem remya1000 General .NET 0 October 2nd, 2007 11:03 PM
Problem to create an xml file from two xml files saurabh_inblore XSLT 1 April 12th, 2006 02:58 AM
create xml file using c# kk_katepally General .NET 2 February 11th, 2005 01:59 AM



All times are GMT -4. The time now is 12:15 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.