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

Autocomplete ignoring imported xsd namespace prefix on xsd files #1000

Open
FcoJavierVicente opened this issue May 30, 2024 · 2 comments
Open

Comments

@FcoJavierVicente
Copy link

When you import one schema into another xsd file autocomplete ignores the namespace prefix of the imported one for element types
image
It works fine for its own namespace prefix
image

@angelozerr
Copy link
Contributor

Could you share your XML and XSD please.

@FcoJavierVicente
Copy link
Author

These are both xsd files, one importing the other:

test1.xsd

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ns1="test1Namespace"
    targetNamespace="test1Namespace" attributeFormDefault="qualified">
    <xs:complexType name="testType1">
        <xs:sequence>
            <xs:element name="testElement1" type="xs:string" />
        </xs:sequence>
    </xs:complexType>
    <xs:simpleType name="testElementType">
        <xs:restriction base="xs:string"></xs:restriction>
    </xs:simpleType>
    <xs:element name="testRoot" type="ns1:testType1"></xs:element>
</xs:schema>

test2.xsd

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ns1="test1Namespace">
    <xs:import namespace="test1Namespace" schemaLocation="test1.xsd"></xs:import>
    <xs:element name="root-element" type="ns1:testType1"></xs:element>
</xs:schema>

In the type attribute of element "root-element" of test2.xsd autocomplete recognices that there is a type called testType1 but ignores the namespace prefix defined by xmlns:ns1="test1Namespace". It gives the error "src-resolve: Cannot resolve the name 'testType1' to a(n) 'type definition' component.xsd(src-resolve)". The error then goes away the moment i write the namespace prefix ns1: manually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants