…rsion of libxml2 bundled with Leopard is too old. In versions prior to 2.7 (I think), xmlNs does not have a context method, so the code at lines 46-47 of xml_namespace.cc prevent compilation. There was something in xml_node.cc that prevented a compile, as well. Maybe other things. This revision to SConstruct checks your version of libxml2, and if it's too old, checks to see if you've got another version (located where Macports would install it, by default) that is recent enough. If so, it uses that more recent version of libxml2. (I wasn't going to bother getting too granular, so I picked a release that I'm pretty sure is not too old or unnecessarily recent.) With this change, I'm able to simply run: npm install libxmljs And it just works!
Signed-off-by: Nick Campbell <firstname.lastname@example.org>
Yes, I know I'm doing 2 loops. But I need the length to preallocate the array length. My thinking is that for small n it's trivial, and for large n it's still better than having the array dynamically resize.