Diego
Diego

Reputation: 1838

Validate XML Schema 1.1 in Intellij IDEA

I'm trying to validate in Intellij XML against an XML Schema 1.1. However, it doesn't seem to be working. Here's the error that I'm getting. Already switched Default XML Schemas to XML Schema 1.1. What am I missing?

/Users/user/tools/git/testxmlxsd/app/src/main/res/xml/assertion/assertion.xsd
Error:(10, 39) s4s-elt-invalid-content.1: The content of '#AnonType_data' is invalid.  
Element 'assert' is invalid, misplaced, or occurs too often.

Validating the XSD also doesn't work. Here the error:

Error:(936, 30) rcase-Recurse.2: There is not a complete functional mapping between the particles.
Error:(936, 30) derivation-ok-restriction.5.4.2: Error for type 'all'.  The particle of the type is not a valid restriction of the particle of the base.

XML

<?xml version="1.0"?>
<data min="5" max="10" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="assertion.xsd"/>

XSD

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning"
    vc:minVersion="1.1" elementFormDefault="qualified">
  <xs:element name="data" vc:minVersion="1.0" vc:maxVersion="1.1">
    <xs:complexType>
      <xs:attribute name="min" type="xs:int"/>
      <xs:attribute name="max" type="xs:int"/>
      <xs:assert test="@min le @max"/>
    </xs:complexType>
  </xs:element>
</xs:schema>

Upvotes: 0

Views: 936

Answers (1)

CrazyCoder
CrazyCoder

Reputation: 402443

It's a known issue in IntelliJ IDEA. Please vote/comment.

Upvotes: 3

Related Questions