Question about XML And HTML

Results 1 to 3 of 3
  1. #1
    Newbie WaterBuggyMuggy is offline
    MemberRank
    Jun 2005 Join Date
    SingaporeLocation
    2Posts

    Question about XML And HTML

    Is it possible to save a variable from HTML's javascript or vbscript into XML files? Or is it a must to use ASP or PHP? T. T
    The following code is what I have typed, and it doesn't work :P unless i typed the /*xmlDoc.Save "c:\test.xml"*/ then the document.write(xmlDoc.documentElement.childNodes.item(0).text) works but all i want is the xmlDoc.documentElement.childNodes.item(0).text="1" part to work T_T can someone teach me? :P

    Btw: I used VBscript :P

    Code:
    Html Code(dd.html)
    <script type="text/vbscript">
    dim xmlDoc
    Set xmlDoc = server.CreateObject("Microsoft.XMLDOM")
    xmlDoc.async="false"
    xmlDoc.load("xml_note.xml")
    
    document.write(xmlDoc.documentElement.childNodes.item(0).text)
    xmlDoc.documentElement.childNodes.item(0).text="1"
    
    xmlDoc.Save "c:\test.xml"
    </script>
    Code:
    XML Code(xml_note.xml)
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <catalog>
    	<ddd>Test</ddd>
    </catalog>


  2. #2
    Grand Master FragFrog is offline
    Grand MasterRank
    Aug 2004 Join Date
    The NetherlandsLocation
    5,629Posts
    AFAIK is it not possible to write something to file with a scripting language. Could be wrong here, but if you can't get it to work thats probably the reason ;)

    PHP can however, so I'd suggest reading into that :) fopen() is your friend here, as well as http://www.php.net

  3. #3
    Newbie WaterBuggyMuggy is offline
    MemberRank
    Jun 2005 Join Date
    SingaporeLocation
    2Posts
    Thanks :P



Advertisement