Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb thread: adding xml attribute ?


Message #1 by Etienne Joubert <etienne@i...> on Tue, 20 Aug 2002 15:58:34 +0200
Here is an example on how I have created attributes.  The set attribute
creates the attribute if it does not exist...


    set objXML = Server.CreateObject("Msxml2.DOMDocument.4.0")

    objXML.async = false    
    objXML.LoadXML strXMLString

    '********************************************************
    ' Set the root of the XML document
    '********************************************************
    Set objRoot = objXML.documentElement

    if (objRoot is nothing) then
      msgbox "Document element not found
      end 
    end if
  
    '********************************************************
    ' Set the attributes on the root node of the XML tree
    '********************************************************
    objRoot.setAttribute "accountType", cstr(intAccountType)
    objRoot.setAttribute "accountID", strAccountID
    objRoot.setAttribute "filter", strFilter


-----Original Message-----
From: Etienne Joubert [mailto:etienne@i...]
Sent: Tuesday, August 20, 2002 9:59 AM
To: professional vb
Subject: [pro_vb] adding xml attribute ?


i need to create a .xml document by passing values to a function. but i
don't know how to set attributes on my nodes, does any one have a clue
i am using the following code

    Dim oXmlDocument As New DOMDocument
    
    Dim oNode As IXMLDOMNode
    Dim oAttribute As IXMLDOMAttribute
    DIm oXmlDocType1 as iXMLDOMNode    
 
    Set oNode = oXmlDocument.createNode(NODE_ELEMENT, "DOCTYPE", "")
    Set oXmlDocType1 = oXmlClient.appendChild(oNode)

    Set oAttribute = oXmlDocument.createAttribute("name")
    oAttribute.Value = "DOCTYPE ATTRIBUTE"
    
    ?????? oXmlDocType1.Add ???????????
 
thank you
 

  _____  


Etienne Joubert 


Isonetza(pty)ltd 

Technical Developer 	
Tel No. +xx xx xxx xxxx 	
Fax No. +xx xx xxx xxxx 	
Cell No. +xx xx xxx xxxx 	
E-mail: etienne@i... <mailto:etienne@i...>  	
Web Site: http://www.isodoc.co.za/ <http://www.isodoc.co.za/>  	

  _____  


 
 



---
Visual C# - A Guide for VB6 Developers
This book will make it easy to transfer your skills 
from Visual Basic 6 to C#, the language of choice 
of the .NET Framework.
http://www.wrox.com/ACON11.asp?ISBN=1861007175&p2p0059



The information contained in this email is confidential and is intended solely for the use of the person identified and intended as
the recipient. If you are not the intended recipient, any disclosure, copying, distribution, or taking of any action in reliance on
the contents is prohibited. If you receive this message in error, contact the sender immediately and delete it from your computer.


  Return to Index