Skip to content

xml:space="preserve" not honored #43

Open
@jeff-emanuel

Description

@jeff-emanuel

foo.xml:

<?xml version="1.0" encoding="UTF-8"?>
<foo>
  <v xml:space="preserve"> Keep the space</v>
</foo>
julia> foo = read("foo.xml", Node)
Node Document (2 children)

julia> foo[2]
Node Element <foo> (1 child)

julia> foo[2][1]
Node Element <v xml:space="preserve"> (1 child)

julia> foo[2][1][1]
Node Text "Keep the space"

julia> foo[2][1][1].value
"Keep the space"

julia> XML.write(foo)
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<foo>\n  <v xml:space=\"preserve\">Keep the space</v>\n</foo>\n"

Both EzXML.jl and LightXMLjl preserve the space, but I can't use those directly. I'm using XLSX.jl which uses XML.jl in its latest code, and this issue is corrupting my data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions