Hi Stefan,
we submitted a patch (that is currently sitting in git trunk) for distributing pxd interface files with lxml (including the static Windows package), to simplify writing cython code that class the lxml Cython API interface.
Unfortunately, we're not quite there yet, because lxml.get_include() still does not return the system include path for libxml (/usr/include/libxml2 or the like), in the cases in which the system ones were used (I think it does work in the case where libxml header files are being shipped within the lxml static package, like on Windows; I can't verify since there is no static Windows package for 2.4 yet).
This means that each and every users of the lxml Cython API must include a build system that duplicates lxml's one build system and finds the system libxml include path.
I was trying to get to a point where a lxml Cython API user should only call lxml.get_include() and get a list of pxd/h directories to be used for both cythoning (pxd) and compiling (h) the extension. Do you think it makes sense to get there?
Thanks!
--
Giovanni Bajo :: rasky(a)develer.com
Develer S.r.l. :: http://www.develer.com
My Blog: http://giovanni.bajo.it
I wanted to do some analyzing of Garmin gpx track and waypoint files. So
I thought of diving into lxml and start with pretty printing a garmin
file. Garmin writes all info on a single line which is not pretty. When
split into lines a waypoint looks like:
<wpt lat="52.151006" lon="15.373755">
<ele>14.742697</ele>
<time>2012-05-19T20:23:15Z</time>
<name>Gazon</name>
<sym>Park</sym>
<extensions>
<wptx1:WaypointExtension>
<wptx1:Samples>3</wptx1:Samples>
</wptx1:WaypointExtension>
</extensions>
</wpt>
when I do:
wpt = '{%s}wpt' % xmlns
waypoints = root.findall(wpt)
for point in waypoints:
print point.get('lon'), point.get('lat')
print etree.tostring(point, pretty_print=True, with_tail=False)
I get a lot of info from the beginning of the file between "<wpt" and
"lat=".
<wpt xmlns="http://www.topografix.com/GPX/1/1"
xmlns:gpxx="http://www.garmin.com/xmlschemas/GpxExtensions/v3"
xmlns:wptx1="http://www.garmin.com/xmlschemas/WaypointExtension/v1"
xmlns:gpxtpx="http://www.garmin.com/xmlschemas/TrackPointExtension/v1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" lat="52.151006"
lon="15.373755">
<ele>14.742697</ele>
<time>2012-05-19T20:23:15Z</time>
<name>Gazon</name>
<sym>Park</sym>
<extensions>
<wptx1:WaypointExtension>
<wptx1:Samples>3</wptx1:Samples>
</wptx1:WaypointExtension>
</extensions>
</wpt>
Why is that and how to avoid?
Thanks for helping this xml and lxml newbe,
Janwillem