data.xml

Emit Empty Elements using EmptyElementTag

Details

  • Type: Enhancement Enhancement
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
  • Environment:
    Does not apply
  • Patch:
    Code and Test

Description

Currently data.xml emits empty elements (elements without content) using start and end tags. The XML spec also allows special empty tags like <foo/>.

I need to serialize XML using such special empty tags because a device, I want to communicate with, does require empty tags. The device is just not able to parse XML messages using start and end tags.

I created a branch on GitHub where I implemented empty tags in the emit function. I'm not familiar how to create a patch. So for now here is the link to the compare view.

As I wrote in my commit message we should discuss, whether a option to the emit function would be a better solution.

Activity

Hide
Herwig Hochleitner added a comment -

I think, this is a worthwhile change, not because we want to support broken xml receivers, but because some xml dialects lean heavily on lots of attr-only tags for byte savings, even going so far as to encode whole polymorphic data structures in attr string values, as seen in svg.

For that reason, of not wanting to take on complexity arising from broken receivers, I'd vote against an emitter flag.

Would you be willing to sign a contributor's agreement and rebase your changes?

Show
Herwig Hochleitner added a comment - I think, this is a worthwhile change, not because we want to support broken xml receivers, but because some xml dialects lean heavily on lots of attr-only tags for byte savings, even going so far as to encode whole polymorphic data structures in attr string values, as seen in svg. For that reason, of not wanting to take on complexity arising from broken receivers, I'd vote against an emitter flag. Would you be willing to sign a contributor's agreement and rebase your changes?

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated: