KAMPATEL1973
Member
- Joined
- Oct 7, 2015
- Messages
- 11
- Programming Experience
- Beginner
Hi All,
I am hoping someone can shed some light on the following please:
1) I have an xml file as follows:
<typeNames xmlns="http://www.acme.com">
<typeName recordType="case" href="types/SAMPLECASE">SAMPLECASE</typeName>
<typeName recordType="source" href="types/SAMPLEST">SAMPLEST</typeName>
<typeName recordType="transaction" href="types/SAMPLEWT">SAMPLEWT</typeName>
</typeNames>
2) I am using the following code:
Dim xdoc As New XmlDocument
Dim xnodelist As XmlNodeList
Dim xNode As XmlNode
Dim XMLnode As XmlNode
Dim xAttr As XmlAttribute
Dim elem As XmlElement
Dim strlist As String
xdoc.LoadXml(xml)
xnodelist = xdoc.SelectNodes("//*/@*")
For Each xNode In xnodelist
strlist = strlist & " " & xNode.Value.ToString
Next
MsgBox(strlist)
This will return a string with no space as "case types/SAMPLECASE source types/SAMPLEST transaction types/SAMPLEWT. Not sure why it is not returning the Values in the > <?
I know by using:
doc = CreateObject("MSXML2.DOMDocument")
success = doc.loadXML(xml)
Work_Type_List = doc.text()
I can create a list which can then be used to create the following SAMPLECASE, SAMPLEST, SAMPLEWT which can be used to populate a list box.
What I am trying to get is a way of reading the XML file so I actually return:
case, SAMPLECASE
source, SAMPLEST
transaction, SAMPLEWT
Any ideas / help would be greatly appreciated.
Thanks
Kam
I am hoping someone can shed some light on the following please:
1) I have an xml file as follows:
<typeNames xmlns="http://www.acme.com">
<typeName recordType="case" href="types/SAMPLECASE">SAMPLECASE</typeName>
<typeName recordType="source" href="types/SAMPLEST">SAMPLEST</typeName>
<typeName recordType="transaction" href="types/SAMPLEWT">SAMPLEWT</typeName>
</typeNames>
2) I am using the following code:
Dim xdoc As New XmlDocument
Dim xnodelist As XmlNodeList
Dim xNode As XmlNode
Dim XMLnode As XmlNode
Dim xAttr As XmlAttribute
Dim elem As XmlElement
Dim strlist As String
xdoc.LoadXml(xml)
xnodelist = xdoc.SelectNodes("//*/@*")
For Each xNode In xnodelist
strlist = strlist & " " & xNode.Value.ToString
Next
MsgBox(strlist)
This will return a string with no space as "case types/SAMPLECASE source types/SAMPLEST transaction types/SAMPLEWT. Not sure why it is not returning the Values in the > <?
I know by using:
doc = CreateObject("MSXML2.DOMDocument")
success = doc.loadXML(xml)
Work_Type_List = doc.text()
I can create a list which can then be used to create the following SAMPLECASE, SAMPLEST, SAMPLEWT which can be used to populate a list box.
What I am trying to get is a way of reading the XML file so I actually return:
case, SAMPLECASE
source, SAMPLEST
transaction, SAMPLEWT
Any ideas / help would be greatly appreciated.
Thanks
Kam