问题描述
我知道这个结构是准确的,所以我正在尝试测试看看是什么
我从这回来了:
昏暗xElem As Xml.XmlElement
Dim sVal As String
xElem = xmlPO.GetElementById(" Body / PurchaseOrder / OrderHeader")
sVal = xElem.GetAttribute(" BuyerOrderNumber")
有没有人看到一个明显的问题,如我所说,XML层次结构是否正确?b $ b是否正确?
-
TFWBWY ... A
I know that this structure is accurate, so I''m trying a test to see if what
I get back from this:
Dim xElem As Xml.XmlElement
Dim sVal As String
xElem = xmlPO.GetElementById("Body/PurchaseOrder/OrderHeader")
sVal = xElem.GetAttribute("BuyerOrderNumber")
Does anyone see an obvious problem, if, as I said, the XML hierarchy is
correct?
--
TFWBWY...A
推荐答案
xElem = xmlPO.GetElementById(" / Body / PurchaseOrder / OrderHeader")
如果xElem什么都不是那么
messagebox.show("你没有找到任何使用该xpaht的元素)
else
sVal = xElem.GetAttribute(" @ BuyerOrderNumber")
结束如果
你不能新的xelem,它必须由GetElementById或
$ b $返回类似的功能。
克里斯
xElem = xmlPO.GetElementById("/Body/PurchaseOrder/OrderHeader")
if xElem is nothing then
messagebox.show("You did not find any elements using that xpaht")
else
sVal = xElem.GetAttribute("@BuyerOrderNumber")
end if
You can''t new the xelem, it has to be returned by the GetElementById or
a similar function.
Chris
这篇关于XML函数问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!