Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Re: Does anyone help me to create the appropriate xml query string thrugh VBA for example below [Thread Next] Re: Does anyone help me to create the appropriate xml query string thrugh VBA for example belowTo: NULL Date: 10/7/2007 12:54:00 PM On Oct 5, 3:42 am, "Anthony Jones" <Ant@y...> wrote: > "avi" <avisemah@a...> wrote in message > > news:1191564928.917151.270610@k...... > > > > > > > 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. > > You've got the wrong path separator character. > Use "//cmvolcu:instrument". > > Note the query language used in msxml2.dll doesn't understand namespaces and > simply treats the whole string cmvolcu:instrument as being the node name. > > Seems a little odd to stick with such an older version when the XML is > clearly intended for a more sophisticated XML implementation. > > -- > Anthony Jones - MVP ASP/ASP.NET- Hide quoted text - > > - Show quoted text - thanks very much for your help Anthony ---- it's good to have people like you on the net ...silly me used the wrong character. i also appreciate the fact that you suggested something more 'modern'. i will definitely look into that suggestion of using other xml dll libraries. | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
