The svg-format has an option to omit the XML declaration, namely ’x’. So try 
with opt={’u’:None, ’C’:None, ’x’:None}
I haven’t had time to test though...

> 26 dec. 2018 kl. 21:14 skrev Dimitri Maziuk via OpenBabel-discuss 
> <openbabel-discuss@lists.sourceforge.net>:
> 
> (Repost with a catchy Subject)
> 
> Noel, Geoff,
> 
> this sounds like a bug:
> 
> On 12/23/18 2:52 PM, Spencer Trinh wrote:
>> 
>> output=pybel.Outputfile('svg',filename='testsvg.svg',opt={'u':None,'C':None})
>> for name,mol in mols.items():
>> mol.removeh()
>> mol.title=name
>> output.write(mol)
>> output.close()
> 
>> ... The svg file itself has errors. The error is:
>> 
>> This page contains the following errors:
>> error on line 36 at column 6: XML declaration allowed only at the start of
>> the document
> 
> I am guessing every write() writes out the whole shebang starting with
> "<?xml version..."?
> 
> -- 
> Dimitri Maziuk
> Programmer/sysadmin
> BioMagResBank, UW-Madison -- http://www.bmrb.wisc.edu
> 
> 
> 
> _______________________________________________
> OpenBabel-discuss mailing list
> OpenBabel-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss



_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

Reply via email to