Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Does anyone help me to create the appropriate xml query string thrugh VBA for example below

From: avi <avisemah@---.--->
To: 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>



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent