XML Tools and Validating using Assert(ion) Tags



  • Does the XML Tools plugin support XSD 1.1? I’m using version 3.0.3.0. I ask because I’m trying to use Assert tags but the file fails validation. When I try to validate, I get the following validation error: Element ‘xs:assert’ is not allowed in this context.

    I’ve searched all over to try and determine what I’m doing wrong but to no avail.

    I’m just trying to do a POC for this before I start tackling my larger project. My POC consists of a simple XML and XSD document.

    XML Document
    <?xml version=“1.0” encoding=“UTF-8”?>
    <Person xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance
    xsi:noNamespaceSchemaLocation=“schema.xsd”>
    <StudentId>BT00001</StudentId>
    <LastName>Tomson00001</LastName>
    <FirstName>Bob00001</FirstName>
    <MiddleName></MiddleName>
    <low>0</low>
    <high>1</high>
    </Person>

    XSD Document
    <?xml version=“1.0” encoding=“UTF-8”?>
    <xs:schema
    xmlns:xs=“http://www.w3.org/2001/XMLSchema”>
    <xs:element name=“Person”>
    xs:complexType
    xs:sequence
    <xs:element name=“StudentId” type=“xs:string” minOccurs=“1” maxOccurs=“1”/>
    <xs:element name=“LastName” type=“xs:string” minOccurs=“1” maxOccurs=“1”/>
    <xs:element name=“FirstName” type=“xs:string” minOccurs=“1” maxOccurs=“1”/>
    <xs:element name=“MiddleName” type=“xs:string” minOccurs=“0” maxOccurs=“1”/>
    <xs:element name=“low” type=“xs:integer” minOccurs=“0” maxOccurs=“1”/>
    <xs:element name=“high” type=“xs:integer” minOccurs=“0” maxOccurs=“1”/>
    </xs:sequence>
    <xs:assert test=“low < high”/>
    </xs:complexType>
    </xs:element>
    </xs:schema>

    Anyone’s assistance would be greatly appreaciated. Thank you!



  • @Mark-Vance said in XML Tools and Validating using Assert(ion) Tags:

    XSD 1.1

    Looks like not at the moment, see here.



  • @Ekopalypse

    Well, that’s a bummer…thx for the response!



  • @Ekopalypse
    The link you provided that points to GitHub led me to a valid Python 1.1 validating tool and I was able to validate my 1.1 XSD. Thanks again!



  • @FlurDeChiken

    How could I have missed that? Thanks for mentioning it.
    Another arrow in my quiver. :)


Log in to reply