Re: I seem to be creating a dict that I cannot access the keys of

2016-06-27 Thread dieter
Sayth Renshaw writes: >> The code below is obviously wrong - it is surprising that you get >> anything other than an exception. See comments below inserted into >> your code. >> >> > def parseXML(): >> > ... >> > result = etree.tostring(tree.getroot(),

Re: I seem to be creating a dict that I cannot access the keys of

2016-06-25 Thread Sayth Renshaw
> > The code below is obviously wrong - it is surprising that you get > anything other than an exception. See comments below inserted into > your code. > > > def parseXML(): > > ... > > result = etree.tostring(tree.getroot(), pretty_print=True) > > "result" here is obviously a

Re: I seem to be creating a dict that I cannot access the keys of

2016-06-25 Thread dieter
Sayth Renshaw writes: > ... > Can I ask is there something obvious wrong, i have left the commented other > versions in they "work" in that they all produce the same output the print > whole file. > The code below is obviously wrong - it is surprising that you get

I seem to be creating a dict that I cannot access the keys of

2016-06-24 Thread Sayth Renshaw
Really getting a little lost here with lxml. I cannot seem to create a dict of results using xpath or other that I could easily get the results from, currently I am always returned a printed copy of the whole file regardless of what parsing options I do. Can I ask is there something obvious