DotJoshJohnson / vscode-xml

XML Tools for Visual Studio Code
MIT License
322 stars 86 forks source link

Invalid Count Value Error. #291

Closed jpwijbenga closed 4 years ago

jpwijbenga commented 4 years ago

Description

Formatter gives cryptic error message: "Invalid Count Value" when trying to format small XML. Not sure if the document is faulty or formatter has a bug.

<?xml version="1.0" encoding="UTF-8"?>
<a>
    The Total (<value-of />) is not equal to the sum (<value-of />).
</a>

Formatter Implementation

v2

XML Tools Version

2.5.0

VS Code Version

1.40.1 User

Operating System

Win10 Ent (x64) 1809

SebastianZ commented 4 years ago

This seems to be a bug in the formatter.

Here's another simple test case:

<x>foo<y><z>bar</z></y></x>

Trying to format this also results in an "Invalid count value" error.

Though if you insert a line break after "foo" like this

<x>foo
<y><z>bar</z></y></x>

the XML will be formatted correctly.

Sebastian

DotJoshJohnson commented 4 years ago

This should be fixed by #317.

SebastianZ commented 4 years ago

I can confirm that this issue is gone in the latest version.

The output of my example looks like this now after formatting:

<x>foo<y>
  <z>bar</z>
</y>
</x>

I had expected it to format it like this:


<x>foo
  <y>
    <z>bar</z>
  </y>
</x>```

Though at least the error is gone, so thank you for fixing this!

Sebastian