blob: 48e43b1965ca989235a1c45208d1f760f3c39902 [file] [log] [blame]
Tests node xPath construction
'#document':'' - '/' - '/'
'#comment':' Pre-comment ' - '/comment()[1]' - '/comment()[1]'
'html':'' - '/html' - '/html'
'head':'' - '/html/head' - '/html/head'
'script':'' - '/html/head/script' - '/html/head/script'
'#text':'\n// Comment\n//' - '/html/head/script/text()[1]' - '/html/head/script/text()[1]'
'#cdata-section':'\nfunction f()\n{\n document.write("<");\n}\n//' - '/html/head/script/text()[2]' - '/html/head/script/text()[2]'
'body':'' - '/html/body' - '/html/body'
'div':'' - '//*[@id="id1"]' - '/html/body/div[1]'
'div':'' - '//*[@id="id2"]' - '/html/body/div[2]'
'div':'' - '//*[@id="container"]' - '/html/body/div[3]'
'div':'' - '//*[@id="id3"]' - '/html/body/div[3]/div[1]'
'#text':'3 Prefix ' - '//*[@id="id3"]/text()[1]' - '/html/body/div[3]/div[1]/text()[1]'
'#cdata-section':'<greeting>Hello, world!</greeting>' - '//*[@id="id3"]/text()[2]' - '/html/body/div[3]/div[1]/text()[2]'
'#text':' Suffix' - '//*[@id="id3"]/text()[3]' - '/html/body/div[3]/div[1]/text()[3]'
'div':'' - '//*[@id="id4"]' - '/html/body/div[3]/div[2]'
'#text':'4' - '//*[@id="id4"]/text()' - '/html/body/div[3]/div[2]/text()'
'div':'' - '//*[@id="id5"]' - '/html/body/div[3]/div[3]'
'#text':'5' - '//*[@id="id5"]/text()' - '/html/body/div[3]/div[3]/text()'
'div':'' - '//*[@id="id6"]' - '/html/body/div[3]/div[4]'
'#text':'6' - '//*[@id="id6"]/text()' - '/html/body/div[3]/div[4]/text()'
'#comment':' Post-comment ' - '/comment()[2]' - '/comment()[2]'