i0707
i0707

Reputation: 617

Passing XMLDocument as parameter to XSLT

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.

Upvotes: 1

Views: 424

Answers (2)

John
John

Reputation: 164

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.

Upvotes: 0

Marc Gravell
Marc Gravell

Reputation: 1062800

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

Upvotes: 1

Related Questions