There is some xhtml page, the source of this page was parsed before loading in the browser, to find some XPath positions. Then this page was loaded into browser, and i want via JAvaScript(on some action) insert some text in XPath positions, that already have been found. Problem is, that in JavaScript(jQuery) i can get only innerHTML (HTML DOM) of this page, and it's differs from XHTML DOM(XML DOM) that have been parsed. How can i get in JavaScript XML DOM of XHTML page, not HTML DOM. Example(some part of page):
<div><p />
Text1
<p />
Text2
</div>
When i want to find XPath position of Text1 it will be /div/text()[1], but in browser this part of code will be converted in HTML DOM, and looks like this:
<div>
<p>Text1</p>
<p>Text2</p>
</div>
and Text1 is now on the /div/p[1]