Hi,
this code works greate, to create a an XML Doc. If I no charicters (like =,', or . ) in the create node section below. However, they want the tag to look like this:
<md.securities.tax guid = GHJK426>
How can I make it look like this.
Thank you
Here is my code:
Private Sub CopyValues()
Dim xml_document As DOMDocument
Dim PathGuid_node As IXMLDOMNode
Dim AppPath As String
AppPath = App.Path
If Right$(AppPath, 1) <> "\" Then AppPath = AppPath & "\"
Set xml_document = New DOMDocument
Set PathGuid_node = xml_document.createElement("PathGuid")
PathGuid_node.appendChild xml_document.createTextNode(vbCrLf)
xml_document.appendChild PathGuid_node
CreateNode 4, PathGuid_node, "md.securities.tax guid = GHJK426", GlobalVarNavigationPath
CreateNode 4, PathGuid_node, "md.securities.tax guid = WSLXEE455", GlobalVarNodeGuid
'md.securities.taxonomy guid = SWESE011
Clipboard.Clear
' Sends the XML doc to the clipboard
Clipboard.SetText xml_document.xml
End Sub
Private Sub CreateNode(ByVal indent As Integer, ByVal parent As IXMLDOMNode, ByVal node_name As String, ByVal PathGuid_node As String)
Dim new_node As IXMLDOMNode
parent.appendChild parent.ownerDocument.createTextNode(Space$(indent))
Set new_node = parent.ownerDocument.createElement(node_name)
new_node.Text = PathGuid_node
parent.appendChild new_node
parent.appendChild parent.ownerDocument.createTextNode(vbCrLf)
End Sub
this code works greate, to create a an XML Doc. If I no charicters (like =,', or . ) in the create node section below. However, they want the tag to look like this:
<md.securities.tax guid = GHJK426>
How can I make it look like this.
Thank you
Here is my code:
Private Sub CopyValues()
Dim xml_document As DOMDocument
Dim PathGuid_node As IXMLDOMNode
Dim AppPath As String
AppPath = App.Path
If Right$(AppPath, 1) <> "\" Then AppPath = AppPath & "\"
Set xml_document = New DOMDocument
Set PathGuid_node = xml_document.createElement("PathGuid")
PathGuid_node.appendChild xml_document.createTextNode(vbCrLf)
xml_document.appendChild PathGuid_node
CreateNode 4, PathGuid_node, "md.securities.tax guid = GHJK426", GlobalVarNavigationPath
CreateNode 4, PathGuid_node, "md.securities.tax guid = WSLXEE455", GlobalVarNodeGuid
'md.securities.taxonomy guid = SWESE011
Clipboard.Clear
' Sends the XML doc to the clipboard
Clipboard.SetText xml_document.xml
End Sub
Private Sub CreateNode(ByVal indent As Integer, ByVal parent As IXMLDOMNode, ByVal node_name As String, ByVal PathGuid_node As String)
Dim new_node As IXMLDOMNode
parent.appendChild parent.ownerDocument.createTextNode(Space$(indent))
Set new_node = parent.ownerDocument.createElement(node_name)
new_node.Text = PathGuid_node
parent.appendChild new_node
parent.appendChild parent.ownerDocument.createTextNode(vbCrLf)
End Sub