XPathEvaluator is undefined error using sdk.metadata.js


  • Some people have reported getting an XPathEvaluator is undefined error using sdk.metadata.js sample library from the SDK. This only occurs when using IE10.

    This will be fixed in the next SDK release, but I wanted to put something on the forum in case someone encounters this before the update is released.

    sdk.metadata.js contains three functions: RetrieveAllEntities, RetrieveEntity, & RetrieveAttribute. Only the RetrieveAttribute function is effected.

    To fix, change line 323 and add the highlighted line:

    req.open("POST", _getUrl() + "/XRMServices/2011/Organization.svc/web", true);
    try { req.responseType = 'msxml-document'} catch(e){}
    req.setRequestHeader("Accept", "application/xml, text/xml, */*");

    This will specify that the XML returned have the selectSingleNode attribute if the browser supports it and it won’t try to use XPathEvaluator.

    Jim Daly Technical Writer Microsoft Dynamics CRM

    Monday, April 15, 2013 5:41 PM

All replies

  • Hi Jim,

      try { req.responseType = 'msxml-document'} catch(e){}

        The above line is already existed in the sdk.metadata.js file, still it is showing the error.we are using crm 2013, and IE browser(version 10). please help me to resolve this issue.

    Thanks in advance,


    Wednesday, November 06, 2013 6:19 AM
  • Are you using the sdk.metadata.js library from the CRM 2013 SDK or a later version? Use the SDK.Metadata.js library from the latest 2013 SDK. http://www.microsoft.com/en-us/download/details.aspx?id=40321

    Jim Daly Technical Writer Microsoft Dynamics CRM

    Wednesday, November 06, 2013 4:03 PM
  • need to to change compatible mode as IE 10

    just have to add this line in Head

    <meta http-equiv="X-UA-Compatible" content="IE=10" />

    clear cache the browser and try again! it works! :)

    Tuesday, December 23, 2014 12:36 PM