Skip to content

Usage of xsi:type for polymorphism seems not to work when using XML schemas with namespaces #1126

@LHJP3FUeZ

Description

@LHJP3FUeZ

For more details about xsi:type polymorphism see:

https://www.xml.com/pub/a/2002/07/03/schema_design.html "Runtime Polymorphism via xsi:type and Abstract Types"

See also: #920

In case the XML and the Schemafile having a Namespace the problem seems even worse than in #920.

 <root xmlns="MyNamespace">
	<ElementName xsi:type="MyXSIType" >
        </ElementName>
</root>

In this case, I get the error: cvc-elt.4.2: Cannot resolve ‘MyXSIType’ to a type definition for element ‘Elementname’.xml(cvc-elt.4.2)

 <root xmlns="MyNamespace">
	<ElementName xsi:type="MyXSIType" >
        </ElementName>
</root>

Also it is not possible to provide xsi:type with namespace shortcut e.g.

 <root xmlns="MyNamespace">
	<ElementName xsi:type="sc:MyXSIType" >
        </ElementName>
</root>

In this case, I get the error: (cvc-elt.4.2)](cvc-attribute.3: The value 'sc:MyXSIType' of attribute 'xsi:type' on element 'ElementName ' is not valid with respect to its type, 'QName'.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions