Add support for reading and writing standalone Entry values. - #97
Open
mdorman wants to merge 2 commits into
Open
Add support for reading and writing standalone Entry values.#97mdorman wants to merge 2 commits into
Entry values.#97mdorman wants to merge 2 commits into
Conversation
When implementing AtomPub support, one needs the ability to read and write `Entry` values outside of a `Feed` context. The API intentionally apes the API for `Feed` values. Because `Entry` values must now be emitted with (standalone) and without (feed) namespace declarations, the actual writing of the values is moved from the `ToXml` implementation into a private `to_xml_inner()` function with an additional parameter to govern the namespace decl. Tests: - Read standalone entries from a file and a string - Make sure non-<entry> documents are rejected - Make sure EOF is appropriate handled - Write a standalone entry - Make sure `xmlns` isn't emitted on an entry in a feed
mdorman
marked this pull request as draft
July 28, 2026 18:51
Author
|
I just realized that my implementation was too naive: it doesn't properly track the namespaces, which renders the |
I missed this detail before: since an `Entry` can now have its own namespace declarations, we have to track them. We use the same approach as for `Feed` values. Tests: - Make sure a namespace is parsed - Make sure a namespace is emitted
mdorman
marked this pull request as ready for review
July 28, 2026 19:03
Author
|
Fixed the namespace issue, everything should be golden. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When implementing
AtomPubsupport, one needs the ability to read and writeEntryvalues outside of aFeedcontext. The API intentionally apes the API forFeedvalues.Because
Entryvalues must now be emitted with (standalone) and without (feed) namespace declarations, the actual writing of the values is moved from theToXmlimplementation into a privateto_xml_inner()function with an additional parameter to govern the namespace decl.Tests:
xmlnsisn't emitted on an entry in a feed