I'm building a new API for an existing service. The methods in it will be called from with in XSLT as .net extensions however I can see me needing to use the same API to do some .net XML juggling too.
I've been toying which how best to write this all night. For it to be XSLT friendly I'll be returning XML in a XPathNavigator object so the XSLT can work with it straight away (rather than convert it into a node set in the XSLT. But XPathNavigators make me shudder if using them from within .net and I would much rather use a XmlDocument (or XDocument) any day over a XPathNavigator.
So choices, choices, what to return?
My current thought is to write it all to use XmlDocuments and then write a Wrapper that will be used by the XSLT, this would simply call the main API and then generate a XPathNavigator from the returned XmlDocument. Its a few more hoops to jump through but would be the most flexible.
Any thoughts on my reasoning or if you have any better suggestions.
Cheers
Pete