XML Schema substitutionGroup isn't validated correctly by IDEA

Here's a simple XML schema:

Here's a simple corresponding XML file ]]>

However, the "test" element shows up in red and the error is "Element test is not allowed here". However, it is allowed there by the substitutionGroup. Is there something wrong with my XML schema, or is this a bug in IDEA?

2 comments

Try run 'Validate' command which uses Xerces validation, if the problem
will not be reported then please file JIRA issue

Jason Rasmussen wrote:

Here's a simple XML schema:

<xsd:complexType name="objectType">
</xsd:complexType>

<xsd:element name="object" type="objectType"/>

<xsd:element name="test" substitutionGroup="object"/>

<xsd:element name="data">
<xsd:complexType>
<xsd:sequence minOccurs="0" maxOccurs="unbounded">
<xsd:element ref="object" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>


Here's a simple corresponding XML file

<?xml version="1.0" encoding="ISO-8859-1"?>
<data>
<object/>
<test/>
</data>

However, the "test" element shows up in red and the error is "Element test is not allowed here". However, it is allowed there by the substitutionGroup. Is there something wrong with my XML schema, or is this a bug in IDEA?



--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0

I have found the answer to my question. The element object must be abstract for it to work.

0

Please sign in to leave a comment.