Hello guys, Please I need your advice, I'm very new in XML. I guess it should be easy for your:
Let's say that we have people.xml with the following structure:
<people>
<name country="be"> name1 </name>
</people>
I want to have an html (input.html) that allow me to add new names with their country attribute into people.xml using an input tag(form) and javascript.
But I want that the new names are saved in the people.xml in the server, no in the RAM.
Please if you can explain me that as for a man of 99 y.o could be great
Thanks a lot guys.
XML isn't really the issue here, it's whatever language you choose to generate the XML file. The XML itself is arbitrary.
As you have mentioned the use of javascript: I don't think this is the way to go. As you wish to save to server you will require a serverside language such as ASP.NET or PHP.
I recently built a site for a client that uses an XML file for some of the content items.
Along with the site, I built an "admin" page using Classic ASP, XML, and XSL that allows them to update the XML file (including being able to add additional records).
The basic design is like this:
1- "admin.asp" - reads the XML file and presents the data in an HTML form using a table for the layout.
2- user makes updates, adds rows, etc.
3- then the user clicks "Save" the form posts to a page which loops through all of the table rows, creating XML as it goes, ultimately overwriting the current XML file with a new one.
The function that creates the XML, looks like this:
I guess I have to analyse it pretty calm because I'm new using XML... I will copy paste your codes in some blank pages so that I will see what they show me.
Can I use 1 xml file to work with different domains hosted in different servers?
The code just writes a "string" to a file, the string happens to be in XML format, to whatever file you point it to. Since this runs server-side, if you want the process to update files on different servers, you would need to send the information to a web page on each server.
I recently built a site for a client that uses an XML file for some of the content items.
Along with the site, I built an "admin" page using Classic ASP, XML, and XSL that allows them to update the XML file (including being able to add additional records).
The basic design is like this:
1- "admin.asp" - reads the XML file and presents the data in an HTML form using a table for the layout.
2- user makes updates, adds rows, etc.
3- then the user clicks "Save" the form posts to a page which loops through all of the table rows, creating XML as it goes, ultimately overwriting the current XML file with a new one.
The function that creates the XML, looks like this:
Const ForReading = 1, ForWriting = 2, ForAppending = 3
Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0
function WriteToFile(FileName, Contents, Append)
if Append = true then
iMode = 8
else
iMode = 2
end if
set oFs = server.createobject("Scripting.FileSystemObject")
set oTextFile = oFs.OpenTextFile(FileName, iMode, True)
oTextFile.Write Contents
oTextFile.Close
set oTextFile = nothing
set oFS = nothing
end function
Hey I kind of just stumbled across this while working on a site. I'm trying to create a page similar to yours, with an admin page where a user can edit a list that gets displayed on the page. The is a set of people and is stored in an xml file with their name, personal webpage, and their position on our team.
I have experience programming, but I've never worked with asp xml or xls, and im still a student, so I'm not even sure how to get started. Any help would be appreciated.
Bookmarks