Home > Software engineering >  VBA generate XML straton more elements of the question
VBA generate XML straton more elements of the question

Time:03-21

 
The Set newNode=xDoc. Createelement method (" Declaration ")
The Set tNode=xDoc. DocumentElement. The appendChild (newNode)

The Set newNode=xDoc. Createelement method (" BorderTransportMeans ")
The Set tNode=xDoc. DocumentElement..childnodes. Item (1) the appendChild (newNode)

The Set newNode=xDoc. Createelement method (" JourneyID ")
The Set dNode=xDoc. DocumentElement..childnodes. Item (1) the appendChild (newNode)
DNode. The appendChild (xDoc. CreateTextNode (" border town "))

The code above how to write out the following XML, ask ace to give directions, thank you!
 


The book & lt;/JourneyID>


CodePudding user response:

Looking at all dizzy, layer, a layer of a layer of introns node, the last one to a text node
Simplify:

 
Dim xdoc As New DOMDocument60
The Set newNode=xdoc. The appendChild (xdoc. The createElement method (" Declaration "))
The Set newNode=newNode. The appendChild (xdoc. The createElement method (" BorderTransportMeans "))
The Set newNode=newNode. The appendChild (xdoc. The createElement method (" JourneyID "))
The Set newNode=newNode. The appendChild (xdoc. CreateTextNode (" border town "))

The Debug. Print xdoc. XML

CodePudding user response:

reference 1/f, crispy big ice cream reply:
looking at all dizzy, layer, a layer of a layer of introns node, the last one to a text node
Simplify:

 
Dim xdoc As New DOMDocument60
The Set newNode=xdoc. The appendChild (xdoc. The createElement method (" Declaration "))
The Set newNode=newNode. The appendChild (xdoc. The createElement method (" BorderTransportMeans "))
The Set newNode=newNode. The appendChild (xdoc. The createElement method (" JourneyID "))
The Set newNode=newNode. The appendChild (xdoc. CreateTextNode (" border town "))

The Debug. Print xdoc. XML

Can extend again, such as each layer nodes have two elements? Beginners not only baidu a patchwork of things
  •  Tags:  
  • VBA
  • Related