xpath mess case study: .net (was: Nasty XPath expressions)
> > I won't even start with my success of binding my own variables in the > > .NET System.Xml classes. Their System.Xml.XPath classes do not even > > envisage that someone might ever want to do this.. you have to pick out > > Xsl classes, and then the exceptions start... > If you don't mind me asking, what problems have you had? I wrote a little test program at first: I had to subclass System.Xml.Xsl.XsltContext, and provide my own ResolveVariable function, which always returns the same variable. For that purpose, I had to implement my own IXsltContextVariable class, which returns an XmlNodeList containing one node. And in order to that, I had to subclass XmlNodeList, because it is an abstract class, so I cannot instantiate it, and in any case I cannot write into it. So, I had to write 3 classes already just to set up a variable context. But then when I call setContext with my own context on some XPathExpression object, I get a NotSupportedException.. fanstastic :) Of course, since it was not envisioned as a requirement, this is also not document anywhere. Christian Nentwich p.s. it was just as hard with Xalan, but at least I could look into the source code there to figure out what was going wrong.
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format