Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries [Thread Prev] >Thread Next - Re: Does anyone help me to create the appropriate xml query string thrugh VBA for example below Does anyone help me to create the appropriate xml query string thrugh VBA for example belowTo: NULL Date: 10/4/2007 11:15:00 PM
The xml documnet is meant to exemplify the problem. I have done some
researching with respect to the problem i experience (on which i will
elaborate), but i have not managed to solve it, although i got the
concept of what needs tom be done but not the specifics.
Here is the problem:
i'm trying to use the selectsinglenode method or selectnodes method of
the msxml.dll version 2 activex object. i managed to load the
document, but when i tried to use the supposedly effective and fast
querying feature embedded in that Activex object, I fail -- that is,
neither one of those methods (i.e., selectnodes) returns a non-empty
list node. this is the code that tries to retrun the
'cmvolcu:instrument ' element. (the code is in Excel VBA)
Dim TheList As IXMLDOMNode
Dim SkewXMLDomDocObject As New DOMDocument
SkewXMLDomDocObject.validateOnParse = False
SkewXMLDomDocObject.resolveExternals = False
SkewXMLDomDocObject.Load "c:\myxmlfilebelow.xll"
TheXQlString = "\\cmvolcu:instrument"
Set TheList = SkewXMLDomDocObject.selectSingleNode(TheXQlString)
there is no doubt that the query string TheXQlString is wrong. in
fact i tried so many, but it did not work. i realize that the prefix
cmvolcu represents a namespace, which the parser seeking the desired
node must know about in one way or another. How do I 'tell' the
object xml query engine that 'cmvolcu' really stands for
"mx.MarketParameters.commodity.volcurve" , the namespace representing
that prefix in the xml document below. if you know the answer, i
will be greatly appreciative becuase to get around that i had to
create my own querying function (which is only a temporary solotion).
i read abot siimilar problems that people encountered, and i also read
the suggested solutions. many solutions used the namespacemanager
object but that was in vb.net whereas i use VBA. Some had another
argument in the selectsinglenode method, which i did not encounter
with the object i'm dealing with (i.e., msxml.dll version 2), so their
solution could not be applied to mine, though i managed to get the
concept, i don't have the specifics of the solution to my problem. if
anyone out there can tell me exactly what i need to do, that will be
really helpful.
thank you in advance
avi
<xc:XmlCache xmlns:xc="xmlCache" >
<mp:nickName xmlns:mp="mx.MarketParameters"
xc:value="MUREX.EXPORT">
<cmvolcu:volcurve
xmlns:cmvolcu="mx.MarketParameters.commodity.volcurve">
<cmvolcu:instrument xc:value="IBM">
<cmvolcu:maturity xc:value="APR-14" xc:type="Fields">
<mp:midVol xc:keyFormat="N">50</mp:midVol>
<mp:callVol xc:keyFormat="N">99</mp:callVol>
</cmvolcu:maturity>
</cmvolcu:instrument>
</cmvolcu:volcurve>
</mp:nickName>
</xc:XmlCache>
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
