Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. XML / XSL
  4. Getting zero elements with xmldocument.selectnodes

Getting zero elements with xmldocument.selectnodes

Scheduled Pinned Locked Moved XML / XSL
javascriptxmlhtmlcssdatabase
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    Haim Nachum
    wrote on last edited by
    #1

    Hi. I have an xml document that im loading to the xmldocument class. After loading i can see in the innerXML property the xml text. Using the FirstChild propery gets me the "html" node. But when im trying to get nodes , any nodes including the "html" node using the "selectNodes" or "selectSingleNode" using XPath, i always get zero nodes; Example doc.SelectSingleNode("//html") . dosent return any node. the xml code looks like that : <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><meta name="verify-v1" content="k1br6sikEUd0k3G96/qOGGoQOfCbjtZUn+oT10GDsHc=" /><meta name="keywords" content="lyric, lyrics, song, music, song lyrics, music lyrics" /><meta name="description" content="Lyrics.com is a music community with the largest searchable lyrics database." /><meta name="robots" content="all" /><meta name="server" content="10.1.10.2" /><title>Lyrics.com - your music community with the largest searchable lyrics database.</title><script type="text/javascript" src="http://www.lyrics.com/js/prototype.js"></script><script type="text/javascript" src="http://www.lyrics.com/js/overlay.js"></script><script type="text/javascript" src="http://www.lyrics.com/js/common.js"></script><script type="text/javascript" src="http://www.lyrics.com/js/lyrics.js"></script><script type="text/javascript" src="http://www.lyrics.com/js/users.js"></script><script type="text/javascript" src="http://www.lyrics.com/js/scriptaculous.js"></script><link href="/stylesheets/main.v2.css" rel="stylesheet" type="text/css" /><!--[if IE 7]><link href="/stylesheets/ie7.css" type="text/css" rel="stylesheet" /><![endif]--><!--[if lt IE 7.]><script defer type="text/javascript" src="/js/pngfix.js"></script><![endif]--><!--[if IE 6]><link href="/stylesheets/ie6.css" type="text/css" rel="stylesheet" /><script src="/js/ie6.js" type="text/javascript"></script><script src="/js/pngfix.js" type="text/javascript"></script><![endif]--><!-- --><script type="text/javascript" src="http://partner.googleadservices.com/gampad/google_service.js"></script> . . . . Any ideas why? Thanks

    D 1 Reply Last reply
    0
    • H Haim Nachum

      Hi. I have an xml document that im loading to the xmldocument class. After loading i can see in the innerXML property the xml text. Using the FirstChild propery gets me the "html" node. But when im trying to get nodes , any nodes including the "html" node using the "selectNodes" or "selectSingleNode" using XPath, i always get zero nodes; Example doc.SelectSingleNode("//html") . dosent return any node. the xml code looks like that : <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><meta name="verify-v1" content="k1br6sikEUd0k3G96/qOGGoQOfCbjtZUn+oT10GDsHc=" /><meta name="keywords" content="lyric, lyrics, song, music, song lyrics, music lyrics" /><meta name="description" content="Lyrics.com is a music community with the largest searchable lyrics database." /><meta name="robots" content="all" /><meta name="server" content="10.1.10.2" /><title>Lyrics.com - your music community with the largest searchable lyrics database.</title><script type="text/javascript" src="http://www.lyrics.com/js/prototype.js"></script><script type="text/javascript" src="http://www.lyrics.com/js/overlay.js"></script><script type="text/javascript" src="http://www.lyrics.com/js/common.js"></script><script type="text/javascript" src="http://www.lyrics.com/js/lyrics.js"></script><script type="text/javascript" src="http://www.lyrics.com/js/users.js"></script><script type="text/javascript" src="http://www.lyrics.com/js/scriptaculous.js"></script><link href="/stylesheets/main.v2.css" rel="stylesheet" type="text/css" /><!--[if IE 7]><link href="/stylesheets/ie7.css" type="text/css" rel="stylesheet" /><![endif]--><!--[if lt IE 7.]><script defer type="text/javascript" src="/js/pngfix.js"></script><![endif]--><!--[if IE 6]><link href="/stylesheets/ie6.css" type="text/css" rel="stylesheet" /><script src="/js/ie6.js" type="text/javascript"></script><script src="/js/pngfix.js" type="text/javascript"></script><![endif]--><!-- --><script type="text/javascript" src="http://partner.googleadservices.com/gampad/google_service.js"></script> . . . . Any ideas why? Thanks

      D Offline
      D Offline
      Dexter Legaspi
      wrote on last edited by
      #2

      you need to consider namespace when dealing with this XML. check out this link for a better explanation: http://weblogs.asp.net/wallen/archive/2003/04/02/4725.aspx

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups