lkiesow / python-feedgen

Python module to generate ATOM feeds, RSS feeds and Podcasts.
https://feedgen.kiesow.be/
BSD 2-Clause "Simplified" License
713 stars 123 forks source link

Fix etree to string conversion in FeedGenerator #124

Closed chazeon closed 7 months ago

chazeon commented 9 months ago

When converting feed object to a string, using atom_str or rss_str methods, with etree.tostring method, feed instead of doc is supplied. In this case, changes applied outside the was lost (e.g., adding a processing instruction <?xml-stylesheet href="rss.xsl" type="text/xsl"?> as sibling to <rss>).

The feed object has now been replaced by the doc object in both the _create_atom and _create_rss methods, ensuring the correct conversion and preventing possible lost of information in the feed generation.