<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:v =
"urn:schemas-microsoft-com:vml" xmlns:o =
"urn:schemas-microsoft-com:office:office" xmlns:w =
"urn:schemas-microsoft-com:office:word"><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2873" name=GENERATOR><!--[if !mso]>
<STYLE>v\:* {
        BEHAVIOR: url(#default#VML)
}
o\:* {
        BEHAVIOR: url(#default#VML)
}
w\:* {
        BEHAVIOR: url(#default#VML)
}
.shape {
        BEHAVIOR: url(#default#VML)
}
</STYLE>
<![endif]-->
<STYLE>@font-face {
        font-family: MS Mincho;
}
@font-face {
        font-family: Tahoma;
}
@font-face {
        font-family: Bookman Old Style;
}
@font-face {
        font-family: @MS Mincho;
}
@page Section1 {size: 8.5in 11.0in; margin: 1.0in 1.25in 1.0in 1.25in; }
P.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
LI.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
DIV.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
A:link {
        COLOR: blue; TEXT-DECORATION: underline
}
SPAN.MsoHyperlink {
        COLOR: blue; TEXT-DECORATION: underline
}
A:visited {
        COLOR: blue; TEXT-DECORATION: underline
}
SPAN.MsoHyperlinkFollowed {
        COLOR: blue; TEXT-DECORATION: underline
}
P {
        FONT-SIZE: 12pt; MARGIN-LEFT: 0in; MARGIN-RIGHT: 0in; FONT-FAMILY: "Times New Roman"; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto
}
SPAN.EmailStyle21 {
        COLOR: navy; FONT-FAMILY: Arial; mso-style-type: personal-reply
}
DIV.Section1 {
        page: Section1
}
</STYLE>
</HEAD>
<BODY lang=EN-US vLink=blue link=blue>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=283351417-19052006>Is a
better diagnostic message possible? This would let us distinguish a pyd
problem from "playing tricks with paths", and presumably there might be some
value in fixing any problems in the latter.</SPAN></FONT></DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B>
users-bounces@lists.ironpython.com
[mailto:users-bounces@lists.ironpython.com]<B>On Behalf Of </B>Dino
Viehland<BR><B>Sent:</B> Wednesday, May 17, 2006 11:50 AM<BR><B>To:</B>
Discussion of IronPython<BR><B>Subject:</B> Re: [IronPython] from xml import
xpath<BR><BR></FONT></DIV>
<DIV class=Section1>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">You’re right, I did
miss that… Looking at this page: <A
href="http://pyxml.sourceforge.net/topics/howto/section-install.html">http://pyxml.sourceforge.net/topics/howto/section-install.html</A>
It would seem that you may be right about the Pyd’s (it at least requires a C
compiler, making that likely – and almost guaranteeing it won’t work w/
IronPython).<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Unfortunately we
don’t support PYD’s currently (and aren’t likely to soon) so most likely this
won’t currently work. If you absolutely need XPath support in the mean time
I’d suggest using .NET’s XMLPath (and if you need to work on both you could
make a thin wrapper over either PyXml for CPython and .NET’s XPath
support). For example:<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">import
clr<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">clr.AddReference(‘System.Xml’)<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">import
System.Xml.XPath as XPath<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">xpathDoc =
XPath.XPathDocument(‘file://foo.txt’)<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<DIV>
<P class=MsoNormal><FONT face="Bookman Old Style" color=navy size=1><SPAN
style="FONT-SIZE: 8pt; COLOR: navy; FONT-FAMILY: 'Bookman Old Style'"><A
href="http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038">Do
you want to help develop Dynamic languages on CLR?</A> </SPAN></FONT><FONT
face="Bookman Old Style" color=white size=1><SPAN
style="FONT-SIZE: 1pt; COLOR: white; FONT-FAMILY: 'Bookman Old Style'">(http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038)</SPAN></FONT><FONT
face="Bookman Old Style" size=1><SPAN
style="FONT-SIZE: 8pt; FONT-FAMILY: 'Bookman Old Style'"><o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<DIV class=MsoNormal style="TEXT-ALIGN: center" align=center><FONT
face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">
<HR tabIndex=-1 align=center width="100%" SIZE=2>
</SPAN></FONT></DIV>
<P class=MsoNormal><B><FONT face=Tahoma size=2><SPAN
style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">From:</SPAN></FONT></B><FONT
face=Tahoma size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">
users-bounces@lists.ironpython.com [mailto:users-bounces@lists.ironpython.com]
<B><SPAN style="FONT-WEIGHT: bold">On Behalf Of </SPAN></B>Simon
Dahlbacka<BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> Wednesday,
May 17, 2006 11:41 AM<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B>
Discussion of IronPython<BR><B><SPAN
style="FONT-WEIGHT: bold">Subject:</SPAN></B> Re: [IronPython] from xml import
xpath</SPAN></FONT><o:p></o:p></P></DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-BOTTOM: 12pt"><FONT face="Times New Roman"
size=3><SPAN style="FONT-SIZE: 12pt">Dino, you seemed to have missed the part
about pyxml..<BR><BR>It works in cpython with pyxml installed. However, pyxml
is playing tricks with paths etc, and there might even be pyd:s
involved..<BR><BR>C:\Python24>python.exe <BR>Python 2.4.1 (#65, Mar 30
2005, 09:13:57) [MSC v.1310 32 bit (Intel)] on win32<BR>Type "help",
"copyright", "credits" or "license" for more information.<BR>>>>
import xml <BR>>>>
xml.__file__<BR>'C:\\Python24\\lib\\site-packages\\_xmlplus\\__init__.pyc'<BR>>>>
from xml import xpath<BR>>>><o:p></o:p></SPAN></FONT></P>
<DIV>
<P class=MsoNormal><SPAN class=gmailquote><FONT face="Times New Roman"
size=3><SPAN style="FONT-SIZE: 12pt">On 5/17/06, <B><SPAN
style="FONT-WEIGHT: bold">Dino Viehland</SPAN></B> <<A
href="mailto:dinov@exchange.microsoft.com">dinov@exchange.microsoft.com</A>>
wrote:</SPAN></FONT></SPAN><o:p></o:p></P>
<DIV>
<DIV vlink="blue" link="blue">
<DIV>
<P><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">This doesn't work for
my in CPython 2.4 either, so I think the docs are
wrong:</SPAN></FONT><o:p></o:p></P></DIV>
<DIV>
<P><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"> </SPAN></FONT><o:p></o:p></P>
<P><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">>>> from xml
import xpath</SPAN></FONT><o:p></o:p></P>
<P><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Traceback (most
recent call last):</SPAN></FONT><o:p></o:p></P></DIV>
<DIV>
<P><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"> File
"<stdin>", line 1, in ?</SPAN></FONT><o:p></o:p></P>
<P><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">ImportError: cannot
import name xpath</SPAN></FONT><o:p></o:p></P>
<P><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">>>> import
sys</SPAN></FONT><o:p></o:p></P>
<P><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">>>>
sys.version</SPAN></FONT><o:p></o:p></P>
<P><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">'2.4.2 (#67, Sep 28
2005, 12:41:11) [MSC v.1310 32 bit (Intel)]'</SPAN></FONT><o:p></o:p></P>
<P><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">>>> </SPAN></FONT><o:p></o:p></P>
<P><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"> </SPAN></FONT><o:p></o:p></P>
<DIV>
<P><FONT face="Bookman Old Style" color=navy size=1><SPAN
style="FONT-SIZE: 8pt; COLOR: navy; FONT-FAMILY: 'Bookman Old Style'"><A
href="http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038"
target=_blank>Do you want to help develop Dynamic languages on CLR?</A>
</SPAN></FONT><FONT face="Bookman Old Style" color=white size=1><SPAN
style="FONT-SIZE: 1pt; COLOR: white; FONT-FAMILY: 'Bookman Old Style'">(<A
href="http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038"
target=_blank>
http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038</A>)</SPAN></FONT><o:p></o:p></P></DIV>
<DIV>
<DIV class=MsoNormal style="TEXT-ALIGN: center" align=center><FONT
face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">
<HR align=center width="100%" SIZE=2>
</SPAN></FONT></DIV>
<P><B><FONT face=Tahoma size=2><SPAN
style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">From:</SPAN></FONT></B><FONT
face=Tahoma size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"> <A
href="mailto:users-bounces@lists.ironpython.com"
target=_blank>users-bounces@lists.ironpython.com</A> [mailto:<A
href="mailto:users-bounces@lists.ironpython.com" target=_blank>
users-bounces@lists.ironpython.com</A>] <B><SPAN style="FONT-WEIGHT: bold">On
Behalf Of </SPAN></B>Greg Lee<BR><B><SPAN
style="FONT-WEIGHT: bold">Sent:</SPAN></B> Tuesday, May 16, 2006 3:17
PM<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> <A
href="mailto:users@lists.ironpython.com"
target=_blank>users@lists.ironpython.com</A><BR><B><SPAN
style="FONT-WEIGHT: bold">Subject:</SPAN></B> [IronPython] from xml import
xpath</SPAN></FONT><o:p></o:p></P></DIV></DIV>
<DIV><SPAN id=q_10b438c1498d8662_3>
<P><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"> <o:p></o:p></SPAN></FONT></P>
<P><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I'm porting an application that
uses PyXML. The following from the PyXml documentation <A
href="http://pyxml.sourceforge.net/topics/howto/section-XPath.html"
target=_blank>http://pyxml.sourceforge.net/topics/howto/section-XPath.html</A>
doesn't work:</SPAN></FONT><o:p></o:p></P>
<P><FONT face="Courier New" size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">from xml import
xpath</SPAN></FONT> <BR><FONT face="Courier New" size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">Traceback (most recent
call last):</SPAN></FONT> <BR><FONT face="Courier New" size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> File , line 0, in
input##113</SPAN></FONT> <BR><FONT face="Courier New" size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">ImportError: cannot import
xpath from xml</SPAN></FONT> <o:p></o:p></P>
<P><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Any suggestions? I messed
around with adding site-packages to IRONPYTHONPATH but other BadThings
happened.</SPAN></FONT> <o:p></o:p></P>
<P><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Here's the
installation:</SPAN></FONT> <o:p></o:p></P>
<P><FONT face="Courier New" size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">Microsoft Windows XP
[Version 5.1.2600]<BR>IronPython 1.0.60420 (Beta) on .NET
2.0.50727.42<BR><BR>python 2.4.2<BR>pyxml 0.8.4<BR>pywin32 205<BR>py2exe
0.6.3<BR><BR>IRONPYTHONPATH = c:\python24\lib</SPAN></FONT>
<o:p></o:p></P></DIV></DIV></DIV></SPAN>
<P class=MsoNormal style="MARGIN-BOTTOM: 12pt"><FONT face="Times New Roman"
size=3><SPAN
style="FONT-SIZE: 12pt"><BR>_______________________________________________<BR>users
mailing list<BR><A
href="mailto:users@lists.ironpython.com">users@lists.ironpython.com</A><BR><A
href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com"
target=_blank>http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</A><BR><BR><o:p></o:p></SPAN></FONT></P></DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"><o:p> </o:p></SPAN></FONT></P></DIV></BLOCKQUOTE></BODY></HTML>