← Prev in month ← Prev in thread
Next in thread → Next in month →

xpath mess case study: .net (was: Nasty XPath expressions)

From
Christian Nentwich <>
To
Dare Obasanjo <>
Date
2001-12-14T13:59:54Z
ID
<>
Thread
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.
← Prev in month ← Prev in thread
Next in thread → Next in month →