传递的XMLDocument作为参数传递给XSLT参数、XMLDocument、XSLT

2023-09-08 08:38:00 作者:过自己生活 ※

我想传递的XmlDocument本身作为参数传递给XSLT(不保存XML物理)。有没有办法做到这一点。我的函数接受两个XMLDOCUMENT和需要根据两个XML来创建新的XML

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.

推荐答案

变换接受一个XmlReader;您可以在您的DOM的任何元素(通常是文档元素)创建一个XmlNodeReader对象(这足够)。

The transform accepts an XmlReader; you can create an XmlNodeReader (which suffices) for any element in your DOM (typically the document element).