Rohan, OK. The code with parsexmlstring_ is already in the Bitbucket repository -- https://dkuhl...@bitbucket.org/dkuhlman/generateds
I'm leaving tomorrow for a 2 week vacation. When I return, I'll look into the thing about stripping out the XML declaration or header. Maybe there is some convention we can follow. Or, maybe Lxml has some support for this that I have not yet found. After all, it's the Lxml function that is objecting to that encoding in the header. Dave On Tue, Dec 19, 2017 at 11:30:34AM +0100, Rohan Dsa wrote: > Hi Dave, > option 2 is definitely more suitable. > The string cannot start with an XML declaration containing an encoding > (for example, "<?xml version="1.0" encoding="UTF-8"?>"), because > lxml.etree.fromstring throws this error: > Regarding parsing the header, i suppose it would be possible for > generateds to search for <? and ?>. i.e. check if the header exists and > pass a reference(hopefully without an extra copy) of the header stripped > sliced string to lxml. i wonder if there is any compelling reason not to > do it. i have seen the header saved often enough into files. it may be a > bad practice but it would be cumbersome for the end user to keep stripping > the header every time. > Regards, > Rohan > On Tue, Dec 12, 2017 at 11:56 PM, Dave Kuhlman <dkuhl...@davekuhlman.org> > wrote: > > Rohan, > > In case the patch in my previous message does not apply, I've > attached a fixed copy of generateDS.py. > Dave > -- > > Dave Kuhlman > http://www.davekuhlman.org -- Dave Kuhlman http://www.davekuhlman.org ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ generateds-users mailing list generateds-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/generateds-users