在 2014年11月1日星期六UTC+8下午5时58分46秒,Bobby Holley写道:
> I think you're probably out of luck - the method was de-COMed, and is now
> not accessible from external C++ code.
> 
> In generally, using nsIDOM* interfaces from external applications is
> explicitly not supported. If you want to do DOM stuff, you should do so
> from JS, and communicate with your JS code using a JS-implemented XPCOM
> component.
> 
> bholley
> 
> On Sat, Nov 1, 2014 at 10:52 AM, <[email protected]> wrote:
> 
> > 在 2014年11月1日星期六UTC+8下午4时40分57秒,David Rajchenbach-Teller写道:
> > > I believe that the methods have migrated to
> > >
> > http://dxr.mozilla.org/mozilla-central/source/dom/xslt/xpath/XPathResult.h?from=XPathResult#47
> > >
> > > Cheers,
> > >  David
> > >
> > > On 01/11/14 08:43, [email protected] wrote:
> > > > Hi,
> > > >
> > > > Xulrunner 33.x is different from the former releases. I cannot compile
> > my C++ XPCOMs because the new interface of nsIDOMXPathResult has not the
> > methods to get the values.
> > > >
> > > > What should I do?
> > > > _______________________________________________
> > > > dev-platform mailing list
> > > > [email protected]
> > > > https://lists.mozilla.org/listinfo/dev-platform
> > > >
> > >
> > >
> > > --
> > > David Rajchenbach-Teller, PhD
> > > Performance Team, Mozilla
> >
> > After I have included the header file XPathResult.h, one compilation error
> > appears as follows:
> >
> >   xulrunner-sdk-33.0\include\nsStringFwd.h(15): fatal error C1189: #error
> > :  Internal string headers are not available from external-linkage code
> >
> > My xpcom is coded as follows:
> >
> >   nsCOMPtr<nsISupports> results;
> >   rv = oEvaluator->Evaluate(path, checkDom, nsnull,
> > nsIDOMXPathResult::BOOLEAN_TYPE, nsnull, getter_AddRefs(results));
> >   if(NS_FAILED(rv)) {
> >       ...;
> >   }
> >   nsRefPtr<mozilla::dom::XPathResult> oResult = do_QueryObject(results);
> >   if(oResult == nsnull) {
> >     ...
> >   }
> >   mozilla::ErrorResult errorResult;
> >   bool boolVal = oResult->GetBooleanValue(errorResult);
> >   if(errorResult.Failed()) {
> >     ...
> >   }else if(!boolVal) {
> >     ...
> >   }
> >
> > The VC compiler tells me that the parameter "path" in the method
> > Evaluate() can not be casted from nsAutoString to const nsAString. I guess
> > it was the cause of the compilation error.
> >
> > Am I wrong somewhere?
> > _______________________________________________
> > dev-platform mailing list
> > [email protected]
> > https://lists.mozilla.org/listinfo/dev-platform
> >

What a terrible news! I have many C++ XPCOMs evaluating xpath expressions. They 
must be coded in C++ for high speed. Are there alternative nsIxxx interfaces 
for xpath evaluation?

I guess it would be very costly to migrate the codes from C++ to javascript. 
Are there better ways?
_______________________________________________
dev-platform mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to