I'm currently working with an automation framework that is pulling a webpage down for analysis, which is then presented as a string for processing. The Rhino Javascript engine is available to assist in parsing the returned web page.
It seems that if the string (which is a complete webpage) can be loaded in a DOM representation, it would provide a very nice interface for parsing and analyzing content.
Using only Javascript, is this a possible and/or feasible concept?
Edit:
I'll decompose the question for clarify: Say I have an string in javascript that contains html like such:
var $mywebpage = '<!DOCTYPE HTML PUB ...//snipped//... </body></html>';
is it possible/realistic to load it somehow into a dom object?
document.body.innerHTML="string"
– Steffens