Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QXmlSchemaValidator trouble with size of xml input.
Forum Updated to NodeBB v4.3 + New Features

QXmlSchemaValidator trouble with size of xml input.

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 2.8k Views 1 Watching
  • 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.
  • H Offline
    H Offline
    hljensen
    wrote on last edited by
    #1

    Hello.

    I'm trying to validate an xml document against a schema using the validate method on the QXmlSchemaValidator class.
    The xml I'm trying to validate has the form:
    @
    <job>
    <description />
    <interval id="1">
    <task id="task1">
    <element></element>
    ...
    </task>
    </interval>

    ... more intervals

    </job>@

    My problem: when i have less than 100 (curiously a round number) intervals the validate() method works fine. If I add a new interval the validate() method fails with "Element interval is not defined in this scope.", sugesting a size constraint of some sort. The overloaded method I use is using QByteArray as input.

    The content of all the intervals is identical and I have validated it sucessfully using other tools.

    Does anybody have a hint to what could be wrong?

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tpreilly
      wrote on last edited by
      #2

      I have the same problem when trying to validate() the xml for my app. 100 card elements is the limit. After that the validate() method returns with "Element card is not defined in this scope." In the schema I have minOccurs="8" and maxOccurs="2048" for the card element. If I set maxOccurs to 100 or less then it works fine for occurences <= 100 card elements. If I set maxOccurs to unbounded then it works fine for any number of card elements. So in my case the solution is to set maxOccurs to unbounded and move the limiting of the number of card elements to the application logic.

      Tim Reilly

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved