|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Creating XML
Humm, ... lets see
Being a typical programmer, I am going straight to the code example...
Plug this into your favorite VB program
Dim tempdoc As MSXML.DOMDocument
Dim tempnode As MSXML.IXMLDOMNode
Dim tempelement As MSXML.IXMLDOMElement
Dim tempattribute As MSXML.IXMLDOMElement
Dim root As MSXML.IXMLDOMElement
'make an XML document
Set tempdoc = New MSXML.DOMDocument
'make a root node and set is as the root of our document
Set root = tempdoc.createElement("MyRoot")
Set tempdoc.documentElement = root
'make a child node with one attribute and append it to the root
Set tempnode = tempdoc.createNode(MSXML.NODE_ELEMENT, "MyNode", "")
tempnode.Text = "MyNodeValue"
root.appendChild tempnode
'get the element interface to add attributes
Set tempelement = tempnode
tempelement.setAttribute "MyAttribute", "MyAttributeValue"
'print out to a text file
Open "MyXMLFile.xml" for output as #1
Print #1, root.XML
Close #1
I did not try to compile this, but there should make you an XML file
Pierre Boudreau
Alpha Centauri Inc.
-----Original Message-----
From: Sagar Shelke [mailto:sagars@m...]
Sent: Tuesday, April 04, 2000 9:20 AM
To: xml-dev@x...
Subject: Creating XML
Hi all,
I am trying to create XML data out of a treeview object on a windows
system. Typical way is to write tags as if u are writing a text file.
My question is if it is possible to create XML data using MSXML parser and
DOM .
A small sample would be most appreciated.
Thanks in advance,
Sagar Shelke
Software Engineer,
Mastek Limited
***************************************************************************
This is xml-dev, the mailing list for XML developers.
To unsubscribe, mailto:majordomo@x...&BODY=unsubscribe%20xml-dev
List archives are available at http://xml.org/archives/xml-dev/
***************************************************************************
***************************************************************************
This is xml-dev, the mailing list for XML developers.
To unsubscribe, mailto:majordomo@x...&BODY=unsubscribe%20xml-dev
List archives are available at http://xml.org/archives/xml-dev/
***************************************************************************
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|
|||||||||

Cart








