Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

creating an xml file 1

Status
Not open for further replies.

snowmantle

Programmer
Jun 20, 2005
70
GB
Hi,

Could anyone please point me in the right direction for what method is used for creating an xml document?

I have a two dimensional array which has 1 column holding a variable name and the other column holds the value of the variable.

Using the below code displays the firstname value in a message box, eg. dataArray(0,0) = "firstname" and dataArray(0,1) = "bob".

I am trying to get that into xml so it would be,

<details>
<firstname>Bob</firstname>
...
</details>

I think the method might be .xml but im not sure how to use it properly.

I have only ever used response.write in .asp

Code:
Dim objXml, objDetails

	Set objXml = CreateObject("Microsoft.XMLDOM") 'create an instance of the DOM Document class

	Set objXml.documentElement = objXml.createElement("details")

	Set objDetails = objXML.createElement("detailsitem")

	objDetails.appendChild objXml.createElement("firstname")

	objDetails.childNodes(0).text = dataArray(0,1)

    msgbox(objDetails.childNodes(0).text)
 
Have you tried the .Save method of the XML object?

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top