OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   RE: Creating XML

[ Lists Home | Date Index | Thread Index ]
  • From: "Boudreau Pierre (NBSMELTING)" <BoudrePi@BMS.CA>
  • To: "'Sagar Shelke'" <sagars@mastek.com>, xml-dev@xml.org
  • Date: Wed, 5 Apr 2000 12:09:36 -0300

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@mastek.com]
Sent: Tuesday, April 04, 2000 9:20 AM
To: xml-dev@xml.org
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@xml.org&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@xml.org&BODY=unsubscribe%20xml-dev
List archives are available at http://xml.org/archives/xml-dev/
***************************************************************************




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS