[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

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

xpath .net

> > 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.


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.

Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.