Open GoogleCodeExporter opened 9 years ago
The intent wasn't to create a valid xml document, but that would be a useful
feature.
Original comment by tom.h.mi...@gmail.com
on 20 Jul 2010 at 8:25
Hah. If the intent is not to create a valid xml document, why would you include
the xml declaration line at all? And by the way, why would you call the option
"list xml", when you don't intent to dump xml document? Because xml document
has only some meaning when it is valid, that means in can be machine-processed.
Ivalid xml is just garbage, because you can't use it with other tools.
Sorry, this is not an enhancement. I understand you try to filter your bugs for
defects as much as possible, but this was a false hit. Invalid xml is not xml,
period.
Original comment by kamil.paral
on 20 Jul 2010 at 8:42
The code literally walks through the feed (rather, the list of entries built by
Python) and calls str() on each entry. The xml declaration line just happens to
be a part of that for some reason.
I found myself wanting to manually look at the xml data of select entries I got
from the servers and thought others might want to do the same, so I included
this as "xml" rather than "invalid_xml_document", since the former is much
easier to type :)
The data is certainly more valuable when it's machine-parsable, even though the
original intent was to dump data for manual inspection, hence the accepted
status as an enhancement.
Original comment by tom.h.mi...@gmail.com
on 20 Jul 2010 at 9:06
[deleted comment]
I made a small script that creates a valid Atom feed. Note that it adds a root
element, because multiple entry-elements at root level would also be invalid
xml.
#!/bin/sh
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>"
echo "<frame:feed xmlns:frame=\"http://www.w3.org/2005/Atom\">"
google contacts list xml | egrep -v "^<\?.*\?>$"
echo "</frame:feed>"
Original comment by MentalFS
on 1 Mar 2011 at 1:02
Original issue reported on code.google.com by
kamil.paral
on 9 Jul 2010 at 9:20