Results 1 to 2 of 2

Thread: Adding an attribute using MSXML 2.6

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2001
    Posts
    3
    Does anyone know of any snippets of code to add an attribute to an element using the MSXML 2.6? My production environment is standardized on it and MSDN now only supports MSXML 3.0 (msxml2.dll)

    Thanks in advance for any help you can offer.

    -Simon

  2. #2
    Hyperactive Member tumblingdown's Avatar
    Join Date
    Mar 2000
    Posts
    362
    Can you not just use setNamedItem? i.e.

    Code:
    Dim d As MSXML2.DOMDocument
    Dim e As MSXML2.IXMLDOMElement
    Dim a As MSXML2.IXMLDOMAttribute
    
        Set d = New MSXML2.DOMDocument
        Set e = d.createElement("E1")
        Set a = d.createAttribute("A1")
        a.nodeValue = "v1"
        e.Attributes.setNamedItem a

    td.
    "One logical slip and an entire scientific edifice comes tumbling down." - Robert M. Pirsig


    [email protected]

    "but if Einstein is right and God is in the details, reality requires that we sometimes get religion." - Scott Meyers.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width