[Mono-devel-list] XPath bug + question
Rob.Tillie at Student.tUL.EDU
Rob.Tillie at Student.tUL.EDU
Sat Feb 21 08:19:45 EST 2004
Hello Kris,
I believe Mono defines the __MonoCS__ preprocessor constant which could be
used in your case. If you just want to detect the platform you're running
on, a better method would be to detect the OS, the Environment class
probably has some methods for this.
The archives of this list contain a number of posts concerning your topic.
Greetz,
-- Rob.
PS: Nice of you to attend my presentation, I didn't expect you because you
had a class to teach. I hope it was of some use to you.
> -----Original Message-----
> From: Kris Luyten [mailto:kris.luyten at luc.ac.be]
> Sent: Friday, February 20, 2004 6:03 PM
> To: mono-devel-list at lists.ximian.com
> Subject: [Mono-devel-list] XPath bug + question
>
> Hi,
>
> 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
> XPathDocument("http://lumumba.luc.ac.be/~kris/projects/uiml.net/gtk-sharp-
> 1.0.uiml");
> 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);
> while(xpni.MoveNext())
> {
> XPathNavigator xpnParam = xpni.Current.Clone();
> if(xpnParam.MoveToFirstAttribute())
> {
> 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
> --
> Kris Luyten
> uiml.net: http://lumumba.luc.ac.be/kris/projects/uiml.net/
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
More information about the Mono-devel-list
mailing list