• Login
Community
  • Login

XML Tools and Validating using Assert(ion) Tags

Scheduled Pinned Locked Moved Notepad++ & Plugin Development
5 Posts 2 Posters 1.3k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F
    FlurDeChiken
    last edited by Feb 21, 2020, 1:47 PM

    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!

    E 1 Reply Last reply Feb 21, 2020, 2:07 PM Reply Quote 0
    • E
      Ekopalypse @FlurDeChiken
      last edited by Feb 21, 2020, 2:07 PM

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

      XSD 1.1

      Looks like not at the moment, see here .

      F 2 Replies Last reply Feb 21, 2020, 7:17 PM Reply Quote 2
      • F
        FlurDeChiken @Ekopalypse
        last edited by Feb 21, 2020, 7:17 PM

        @Ekopalypse

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

        1 Reply Last reply Reply Quote 1
        • F
          FlurDeChiken @Ekopalypse
          last edited by Feb 21, 2020, 7:45 PM

          @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!

          E 1 Reply Last reply Feb 21, 2020, 7:56 PM Reply Quote 3
          • E
            Ekopalypse @FlurDeChiken
            last edited by Feb 21, 2020, 7:56 PM

            @FlurDeChiken

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

            1 Reply Last reply Reply Quote 2
            2 out of 5
            • First post
              2/5
              Last post
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors