Click to See Complete Forum and Search --> : Modifying XML


modemide
04-28-2004, 01:58 AM
I'm new to this web developing thing, so I apologize if this is a complete newbie question. I was wondering, what would I use to modify the xml file via html. Let's say I have an xml file in my web server, then What kind of web language would I use to access and modify the file? I was thinking java script (Which I am in the process of learning). As a side note, I am pretty proficient in C++

r3alityc0d3r
04-28-2004, 06:05 PM
In what way do you want to modify it? If you are wanting to add elements to it or remove elements then you will have to use Servlets, JSP or ASP. If however, you want to transform the xml into a html so that it displays as a webpage you can use XSL and XPath. A good introductory tutorial is at

http://www.w3schools.com/xsl/xsl_languages.asp

modemide
04-28-2004, 07:12 PM
yes w3schools has been very useful to me lately. I just found out I could modify it via asp. however I am confused as to weather the code to modify the file will be in the asp file it's self (invoking some java script file open / write to methods) or if there is some other way I should be doing it?

crh3675
04-29-2004, 07:28 AM
this is a sample that you can probably figure out. It updates a single node in an xml file:

Dim objRoot
Dim objContact
Dim objField

strXMLFile=Server.MapPath("articles.xml")

Set objXML = Server.CreateObject("Microsoft.XMLDOM")
objXML.async = false
objXML.load strXMLFile
Set objRoot = objXML.DocumentElement

Set objContact = objRoot.SelectSingleNode("event[@id=1]/time")

objContact.Text="3:25 P.M."

objXML.Save strXMLFile


%>

modemide
04-29-2004, 10:26 AM
Thanks I will try that