[Mono-devel-list] XPath bug + question

Kris Luyten kris.luyten at luc.ac.be
Fri Feb 20 12:03:11 EST 2004


just to note that this code does not work when I download mono and
install it from its current release (0.30.1). But when I do a "make
fullbuild" from CVS, this code does work!

XPathDocument doc = new
XPathNavigator m_vocabulary  = doc.CreateNavigator();

XPathExpression xpExpr = m_vocabulary.Compile("//d-class[@id='Label']/d-property[@id='constructor']/d-param");
XPathNodeIterator xpni = m_vocabulary.Select(xpExpr);
	XPathNavigator xpnParam = xpni.Current.Clone();
		Console.WriteLine("Attribute {0} = {1}", xpnParam.Name, xpnParam.Value);
		while (xpnParam.MoveToNextAttribute())
		Console.WriteLine("Attribute {0} = {1}", xpnParam.Name, xpnParam.Value);

I remember this was a small bug that was fixed a couple of months ago
thanks to Atsushi Eno
(http://lists.ximian.com/archives/public/mono-list/2003-September/016048.html). The code in a .cs file, ready to compile, is available at http://lumumba.luc.ac.be/~kris/projects/uiml.net/test4.cs

I also have a question about conditional compiling. I am working on a
XML-based User Interface renderer (comparable like Xaml, but more
abstract) and want to support different widget sets (currently Gtk# is
supported, and some support for Wx.Net; here are some examples:
http://lumumba.luc.ac.be/~kris/projects/uiml.net/examples/ ).
Windows.Forms is one of the backend I would like to support. I was
wondering whether a .NET compiler can work with define switches (#ifdef
mono ... #endif), like C++ compilers do?

This way the same code can be compiled on Mono and MS .Net without
special makefiles etc. 

All the best,
Kris Luyten
uiml.net: http://lumumba.luc.ac.be/kris/projects/uiml.net/

More information about the Mono-devel-list mailing list