I would like to pass the XMLdocument itself as parameter to the XSLT (without saving the XML physically). Is there any way to do that. My function accepts two Xmldocument and need to create new XML based on the two XML.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
The transform accepts an XmlReader; you can create an XmlNodeReader (which suffices) for any element in your DOM (typically the document element).
回答2:
You would be better off just combining your xml document nodes and transforming on the entire thing. There are ways to pass xml in as parameters but none of them are pretty and after you do it, you're still going to be forced to so some xsl trickery to gain access to it.