Skip to content

fs2-data-xml streaming parser #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 11 commits into from
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ trait ElemInstances {
implicit def xmlEvents[F[_]](implicit F: Concurrent[F]): EntityDecoder[F, Stream[F, XmlEvent]] =
EntityDecoder.decodeBy(MediaType.text.xml, MediaType.text.html, MediaType.application.xml) {
msg =>
DecodeResult.successT(msg.bodyText.through(fs2.data.xml.events()))
DecodeResult.successT(msg.bodyText.through(fs2.data.xml.events(includeComments = true)))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is necessary to make the new round-trip test pass. But is it actually what we want?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I conflated normalization in the generator with normalization in the test in a way I probably shouldn't have. I guess the question is whether comments are part of normalized output. I think it belongs, perhaps with an option to turn it off.

}

/** Handles a message body as XML.
Expand Down