Note: Forums will be making significant UX changes to address key usability improvements surrounding search, discoverability and navigation. To learn more about these changes please visit the announcement which can be found HERE.

Discussion Internet Explorer 9: Missing selectSingleNode

  • Monday, September 20, 2010 4:52 PM
     
      Has Code

    Hello,

    We're updating our javascript code to be IE9 compliant ( I suppose IE6-9 actually ).  The issue I've run into is that IE9 seems to be missing the selectSingleNode and related members on XML documents.  Is this expected, and if so, can anyone suggest a work around?

    Using an IE8 virtual machine or compat mode solves the issue of course, but I'd rather restructure our JS than have to worry about users getting the right headers, being in the right compat mode, etc.

    Example code:
    
    var result = document.selectSingleNode(expression);
    

     

    Thanks for the help.

     

All Replies

  • Monday, September 20, 2010 7:45 PM
     
     

    Hi,

    connect.microsoft.com/ie

    search for XML,

    there are some outstanding issue tickets for XML file rendering.

    You can post your own issue tickets there for IE9 BETA.


    Rob^_^
  • Tuesday, September 21, 2010 2:56 PM
     
     

    Thanks for the suggestion.  Unfortunately most of the bugs there are IE8 issues.  I'm going to post my issue, but I find it hard to believe that it's a bug ... that MS just 'forgot' to include xpath on XML documents seems unlikely.

    I imagine there is a some new way we're supposed to go about XPath queries in IE9, but I'm just not seeing it.

    Can anyone provide any further answers?

  • Tuesday, September 21, 2010 8:33 PM
     
     

    What part of BETA don't you understand?

    Submit you issue at connect.

    Here is the published documentation

    http://msdn.microsoft.com/en-us/ie/ff468705.aspx

    I don't see selectSingleNode with a page search.


    Rob^_^
  • Wednesday, September 22, 2010 4:58 PM
     
     

    Thanks for the suggestion, IECUSTOMIZER, I appreciate the help.  I submitted this as a bug to connect, even though I don't believe it is actually a bug.

    As this forum is for helping us create sites with a good IE9 experience, how should I use XPATH with XML documents in IE9 javascript?

  • Wednesday, September 22, 2010 9:34 PM
     
      Has Code

    Hi Lex,

    I have to admit this is out of my league...

    A web search pointed to this .net documentation

    http://msdn.microsoft.com/en-us/library/system.xml.xmlnode.selectsinglenode.aspx

    Do you have a web link for us to have a look at?

    At a guess I suspect you are using xhtml file extensions....your syntax.... document.selectSingleNode(expression);
    threw me....

    I have one test case in my VS project.... I think I got it from dev.mozilla

    <?xml version='1.0'?>
    <html xmlns="http://www.w3.org/1999/xhtml"
    	xmlns:svg="http://www.w3.org/2000/svg">
    	<head>
    	<title>A swarm of motes</title>
    
    Have you configured your server's mime handling for xhtml to application/xhtml+xml

    There was a post about setting the correct mime handlers on the IEBlog....

    Sorry I don't know much about it as generally I don't use the xhtml extension. Hence, I pushed you to connect....

    That should not be the whole story though... realize that IE9 Beta is BETA... I would not be committing to production changes just yet. My own experience is that there are some showstoppers in the Beta that until they are fixed I would be unwise to commit on the premise that they are going to be fixed....I have been through 2 beta releases of IE before (7 & 8). It is very hard to hit a moving target or to nail jello to a tree. I don't expect that IE9 will become the dominant browser on the web overnight. Its uptake does not justify the effort just yet but moving away from UAS sniffing to feature detection is benign and has immediate benefits.

    Perhaps a wise strategy would be to review your code and move from UAS sniffing to feature detection.

    I am not MSFT so I only know what you have also read from their release documentation.

    Regards.


    Rob^_^
  • Sunday, April 15, 2012 4:03 PM
     
     

    What part of BETA don't you understand?

    What are you, like 10 years old?  Second post I've found of yours in 5 days with arrogant cheek.

    Funny to see this thread a year and a half later and the question is totally legit and has nothing to do with the BETA, it's a missing feature. 

  • Sunday, April 15, 2012 10:27 PM
     
     

    rick,

    connect.microsoft.com/ie is accepting feedback for IE10 now.


    Rob^_^


    selectSingleNode http://msdn.microsoft.com/en-us/library/h0hw012b.aspx