[Biopython-dev] ToEol in Martel
Andrew Dalke
dalke at acm.org
Tue Mar 27 06:45:43 EST 2001
Cayte:
> ToEol is apparently stripping leading white space?
That's not what I get. Here's my test:
>>> import Martel
>>> amino_acid_ref_journal_line =
artel.Group( "amino_acid_ref_journal_line",
... Martel.Str( "AAREFJ" ) +
...
Martel.ToEol( "amino_acid_ref_journal" ) )
>>>
>>> parser = amino_acid_ref_journal_line.make_parser()
>>> from xml.sax import saxutils
>>> parser.setContentHandler(saxutils.XMLGenerator())
>>> parser.parseString("AAREFJ 1 J IMMUNOL 150: 4985-4995 (1993)\n")
<?xml version="1.0" encoding="iso-8859-1"?>
<amino_acid_ref_journal_line>AAREFJ<amino_acid_ref_journal> 1 J IMMUNOL
150: 49
85-4995 (1993)</amino_acid_ref_journal>
</amino_acid_ref_journal_line>
This has "<amino_acid_ref_journal>" include the spaces.
>Is this how ToEol should work?
No. ToEol should store all the whitespace - and everything else -
up to the end of line character(s).
What happens when you do this same test?
Andrew
More information about the Biopython-dev
mailing list