Skip to content

Fix CodeAction for cvc-complex-type.2.4.a to add elementFormDefault to bound XSD #571

Open
@AlexXuChen

Description

@AlexXuChen

Given an XML document, foo.xml:

<foo xmlns="http://foo"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://foo foo.xsd">
    <bar />
</foo>

and an XSD document, foo.xsd:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://foo">
    <xs:element name="foo">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="bar" />
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>

the following error will appear:
Screenshot from 2021-07-30 09-21-49

with the following Quick Fix suggestion:
Screenshot from 2021-07-30 11-34-52

The CodeAction and Diagnostic for the error is currently incorrect/unsupported, and should add the elementFormDefault="qualified" attribute to the xs:schema tag in foo.xsd.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions