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

Formatter either adds or removes content in malformed xml #227

Closed
fbricon opened this issue Nov 14, 2018 · 2 comments
Closed

Formatter either adds or removes content in malformed xml #227

fbricon opened this issue Nov 14, 2018 · 2 comments
Assignees
Labels
bug Something isn't working formatting This issue or enhancement is related to formatting support in progress
Milestone

Comments

@fbricon
Copy link
Contributor

fbricon commented Nov 14, 2018

In this document, a closing bracket is missing L8:

<?xml version="1.0" encoding="UTF-8"?>
<resources something="foo">
  <resource name="res00">
    <property name="propA" value="..."/>
    <property name="propB" value="..."/>
  </resource>
  <resource ddd="ddd" name="">
    <property name="one" value="..."
    <property name="two" value="..."/>
  </resource>
</resources>

When invoking the formatter, a closing bracket is added:
formatter-adds-closing-bracket

Here, closing bracket is also missing L8:

<web-app 
         xmlns="http://xmlns.jcp.org/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee 
		 http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
         version="3.1">
         <servlet>
             <servlet-name>sssi</servlet-name>
         </servlet
</web-app>

But then, the formatter removes the line completely!
formatter-removing-malformed-element

@fbricon fbricon added bug Something isn't working formatting This issue or enhancement is related to formatting support labels Nov 14, 2018
@fbricon
Copy link
Contributor Author

fbricon commented Nov 14, 2018

In this case (missing bracket L9), the formatter works as expected:

<?xml version="1.0" encoding="UTF-8"?>
<resources something="foo">
    <resource name="res00">
        <property name="propA" value="..."/>
        <property name="propB" value="..."/>
    </resource>
    <resource ddd="ddd" name="">
        <property name="one" value="..."/>
        <property name="two" value="..."
    </resource>
</resources>

@fbricon
Copy link
Contributor Author

fbricon commented Nov 14, 2018

Looks like malformed closing tags of enclosing elements get removed

@fbricon fbricon added this to the v0.0.3 milestone Nov 15, 2018
@fbricon fbricon added the to do label Nov 15, 2018
NikolasKomonen added a commit to NikolasKomonen/lsp4xml that referenced this issue Dec 4, 2018
NikolasKomonen added a commit to NikolasKomonen/lsp4xml that referenced this issue Dec 4, 2018
@fbricon fbricon added in progress and removed to do labels Dec 5, 2018
NikolasKomonen added a commit to NikolasKomonen/lsp4xml that referenced this issue Dec 5, 2018
NikolasKomonen added a commit to NikolasKomonen/lsp4xml that referenced this issue Dec 5, 2018
NikolasKomonen added a commit that referenced this issue Dec 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working formatting This issue or enhancement is related to formatting support in progress
Projects
None yet
Development

No branches or pull requests

2 participants