Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-42402

XMLISVALID: optional xs:any (minOccurs=0) is not treated as emptyable, valid XML rejected

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Critical
    • Resolution: Unresolved
    • N/A
    • 13.3
    • XML Functions
    • None

    Description

      An optional xs:any doesn't let its content model be empty. XMLSchema_any doesn't override is_emptyable(), so XMLSchema_sequence::end_validation treats it as required. The same happens in xs:choice. An optional xs:element in the same position works.

      SET @s= '<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"><xs:element name="c"><xs:complexType><xs:sequence><xs:any minOccurs="0" processContents="skip"/></xs:sequence></xs:complexType></xs:element></xs:schema>';
      --echo # BUG if 0
      SELECT XMLISVALID('<c/>', @s);
      SET @s= '<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"><xs:element name="c"><xs:complexType><xs:sequence><xs:element name="e"/><xs:any minOccurs="0" processContents="skip"/></xs:sequence></xs:complexType></xs:element></xs:schema>';
      --echo # BUG if 0
      SELECT XMLISVALID('<c><e/></c>', @s);

      Attachments

        Issue Links

          Activity

            People

              holyfoot Alexey Botchkov
              alice Alice Sherepa
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.