开发者

Is it possible to perform an XPATH query on the result of a client-side XSL transformation in Internet Explorer 8+?

开发者 https://www.devze.com 2023-03-31 19:32 出处:网络
Wo开发者_运维百科uld it be possible to perform an XPATH query on the result of a client-side XSL transformation from an XML in Internet Explorer 8+ ? As far as I know, the only way to do a client-side

Wo开发者_运维百科uld it be possible to perform an XPATH query on the result of a client-side XSL transformation from an XML in Internet Explorer 8+ ? As far as I know, the only way to do a client-side XSL transformation in Internet Explorer is something like:

result = xml.transformNode(xsl);

, where 'xml' and 'xsl' are XML DOM objects. However, in this case "result" will be a string, which is obviously unsuitable for performing XPATH queries.

Here's a link to an article that states that it's possible: http://glazkov.com/2004/04/06/xpath-unleashed/, but in my experience the only type of thing you can create by doing client-side XSL transformations in IE is a string(as stated above), not an HTML document. Sure, that string may very well be a bunch of nested tags, semantically equivalent to an HTML, but that doesn't really help me. And yes, it may be possible to create a document fragment from that string, but then I wouldn't be able to do XPATH queries on that fragment (I think).

The article I linked is just one of many that state the same thing, but I haven't found any actual example code of how to accomplish something like this.

I should mention that I`m fairly new to XPATH and even JavaScript, so if I made any errors in terminology or you need extra information pertaining to my dilemma, please let me know.


Take a look at transformNodeToObject.

xml.transformNodeToObject(xsl, myNewDOMObject);
0

精彩评论

暂无评论...
验证码 换一张
取 消