I've tried to write an XML code with Notepad. And try to open the xml page using Internet Explorer (fyi. ver. 6)...
but, when I try to open the page, the browser only show the code.
What other things should I prepare to build an XML page ? the server ? web server ? or what else ?
I'm really a newbie in this case. But, want to learn more bout XML. coz I'm interested in XML....
But I am posting an example of reading an xml file.
Also to your first query that when u view the xml file in IE, it displays you the same data as in the file - because actually xml file acts like a database - you can query it (kind-of) to fetch the records and display it using a scripting language(VBScript or JavaScript).
Also I feel that u want to build your XML file ie fill the data into the XML file from a database - The answer to this is Yes.
Though I havent shd it to you in the example here- this one is a very basic one.
how should I upload from my SQL Server to XML file type... ???
Should I type one by one ?
or I should make a coding first to upload it to XML file type ???
For that u need to open that file with a server-side language and loop through all the records in the db and write it to the XML file.
Not type them one by one but may write a code which will do that.
Lastly just out of curiosity - Why are u trying to convert ur SQL DB into XML???
open the SQL database.
Query the database which will fetch you the records u want in the recordset.
create a xml Object and open the xml file
Start a loop which will go on till rs.EOF 'rs is the recordset
then use a createNode method to create nodes in the xml file.
the nodes will contain the data - Name and Password in your case.
complete the loop and close the connection.
save the xml file.
PS: it is advisable to save sensitive data like passwords in xml files - because after all they are TEXT files.
All this scripting shd be in server-side coding(ASP).
If its not clear,pls let me know I will post an example.
I've done this many of times. I just simply create a asp page and loop through the recordset returned from a sproc or whatever. I found it easiest to use microsoft xml parser and create a DOM object and append nodes to the document element. If you need an example, let me know.