Jon Udell explains the code behind the ‘structured search in the browser’ demo I mentioned earlier.
The trick is that he loads the stylesheet into a DOM, modifies that stylesheet by replacing a placeholder with the XPath query that the user selects or enters, then loads the stylesheet into a transform object and applies it to the source XML.
Possibly Related posts (machine generated):