Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Attributes problem

From: anonymous@-----------.---------.---
To: NULL
Date: 4/1/2004 7:46:00 PM
Hi

I'm having a problem with setting an attribute to a node without it also setting it to childnodes. The code I'm using is below.

    xmlDoc.loadXML "<checklist/>
   
    Set root = xmlDoc.documentElemen
    root.setAttribute "xmlns", "http://tempuri.org/Checklist.xsd
       
    Dim ThisVariable As Long, ThisCriteria As Long, ThisPase As Lon
    With rstva
        .MoveFirs
        Do While .EOF = Fals
            Set nodePhase = xmlDoc.createElement("phase"
            root.appendChild nodePhas
           
            Set cName = xmlDoc.createAttribute("phaseID"
            Set nodeThisOne = root.childNodes.Item(ThisVariable
           
            cName.Value = !I
            nodeThisOne.setAttributeNode cNam
           
            nodeThisOne.setAttribute "xmlns", "http://tempuri.org/Checklist.xsd
           
            Set nodeDescription = xmlDoc.createElement("name"
            Set ThisNode = root.childNodes.Item(ThisVariable
            ThisNode.appendChild nodeDescriptio
            ThisNode.lastChild.Text = Nz(!PhaseName, ""
           
            Set nodeDescription = xmlDoc.createElement("startDate"
            ThisNode.appendChild nodeDescriptio
            ThisNode.lastChild.Text = Nz(!Start, 0
           
            Set nodeDescription = xmlDoc.createElement("endDate"
            ThisNode.appendChild nodeDescriptio
            ThisNode.lastChild.Text = Nz(!End, 0

What results is
<checklist xmlns="http://tempuri.org/Checklist.xsd"><phase phaseID="1" xmlns="http://tempuri.org/Checklist.xsd"><name xmlns="">Phase One</name><startDate xmlns="">0</startDate><endDate xmlns="">0</endDate

NOTE the empty xmlns attributes in name, startDate and endDate. I only want the attribute on checklist and phase

Any help appreciated

Thanks



transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent