Skip to content

Feature request: output XML fragments #32

Open

Description

@MSoegtropIMC

I have XML where the contents of some XML elements is HTML. I would like to collect the HTML literally as string. Since formatting XML is not trivial, I want to use XMLM output to stringify signals until I encounter an unmatched El_end. It is easy enough to pass the signals from the input to an output which writes to a buffer.

The issues is that the output writer doesn't accept fragments. It requires a Dtd and in case elements are followed by data I also need to output some outer element, which I do not want in the output and I have to strip later. All doable, but IMHO this is a reasonably frequent use case.

I think it would make sense to add an optional argument ~fragment to make_output or to allow fragments (that is no Dtd and elements followed by data) in case ~decl:false is passed to make_output, which (I think) indicates that one wants to have a fragment as result, so it would make sense to support fragments on input as well then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions