Apr-12-2018, 06:51 PM
The difference is that the built-in module only lets you use a subset of XPath, making certain things more complicated, or impossible.
For example, to get the
For example, to get the
ConnectionString
attribute in lxml, you can simply do this:>>> root.xpath('XYZ:ConnectionManagers/XYZ:ConnectionManager/XYZ:ObjectData/XYZ:ConnectionManager/@XYZ:ConnectionString', namespaces=ns) ['Data Source=RTG093939BB;Initial Catalog=AdminDB;Provider=SQLNCLI11.1;Integrated Security=SSPI;Auto Translate=False;', 'Data Source=RTG093955XT;Initial Catalog=Stage;Provider=SQLNCLI11.1;Integrated Security=SSPI;Auto Translate=False;']