FabianLauer / vs-code-xml-format

Simple XML formatter for Visual Studio Code.
https://marketplace.visualstudio.com/items/fabianlauer.vs-code-xml-format
MIT License
7 stars 5 forks source link

Formatting is Removing Element Prefixes #14

Open ledbutter opened 7 years ago

ledbutter commented 7 years ago

If I have an XML document like this:

<?xml version="1.0" encoding="utf-8"?>
<Foo xmlns:f="http://foo.com/ns" xmlns="urn:epcglobal:epcis:xsd:1">
<Element xmlns="">
<Parent>
<f:Other>
</f:Other>
</Parent>
</Element>
</Foo>

And I then format it, it looks like this (notice the missing f: prefix on Other):

<?xml version="1.0" encoding="utf-8"?>
<Foo xmlns:f="http://foo.com/ns" xmlns="urn:epcglobal:epcis:xsd:1">
    <Element xmlns="">
        <Parent>
            <Other>
            </Other>
        </Parent>
    </Element>
</Foo>

This is obviously a contrived example, but we are dealing with an external company which embeds an element of their own namespace inside an element in a different namespace. VS 2017 handles this without issue.

asiraky commented 4 years ago

Same issue. This plugin is unusable (for me) if its going to arbitrarily change the contents of my xml.