Skip to content
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

Output of toPrettyString is broken #10

Open
andre2007 opened this issue Oct 12, 2024 · 0 comments
Open

Output of toPrettyString is broken #10

andre2007 opened this issue Oct 12, 2024 · 0 comments

Comments

@andre2007
Copy link

The output of this code

import kxml.xml;
import std.stdio: writeln;

XmlNode nodeAttributes = new XmlNode("attributes");
nodeAttributes.addChild(new XmlNode("divisions").setCData("1"));
        
nodeAttributes.addChild(new XmlNode("key").addChild( 
  new XmlNode("fifths").setCData("0")));
    
nodeAttributes.addChild(new XmlNode("time").addChildren([
  new XmlNode("beats").setCData("4"),
  new XmlNode("beats-type").setCData("4") ]));

writeln(nodeAttributes.toPrettyString());

is

<attributes>
        <divisions>
                1
        </divisions>
        <key>
                <fifths>
                        0
                </fifths>
        </key>
        <time>
                <beats>
                        4
                </beats>
                <beats-type>
                        4
                </beats-type>
        </time>
</attributes>

The unecessary line breaks for the tag contents causes issues for other xml parsers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant