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. XML schema validation QXmlSchemaValidator and messagehandler
Forum Updated to NodeBB v4.3 + New Features

XML schema validation QXmlSchemaValidator and messagehandler

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 1.5k 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.
  • A Offline
    A Offline
    AndrewW
    wrote on last edited by
    #1

    I am writing a test program to check that our xml is working. It a) goes through each element and writes a value which is within range into the in-memory DOM, b) writes the whole DOM out to a test XML file, c) reads the XML file as a text file and checks that the value is correct, d) validates the test XML file against the schema, e) reads the XML file in to a test DOM and compares the original DOM and the test DOM for the specific element.
    At the moment, it tests more than 10 elements, and then gives an error saying that the test XML file is invalid at line -1. The associated MessageHandler::statusMessage() from the validator is simply blank!
    Since the test XML file is written and validated a number of times, it seems likely that my code for writing the XML file is correct. Just before this error, I have checked that the test XML file contains the correct data value, therefore the test XML file exists, it is readable, and it has been closed. I can open the test XML file but I see no problems there.
    Can anyone suggest a possible cause of this error, and/or how to investigate further?

    1 Reply Last reply
    0
    • A Offline
      A Offline
      AndrewW
      wrote on last edited by
      #2

      I have found the answer myself. The error always occured after the previous test had set a decimal value and found that the value read back was marginally different (to the sixth decimal place). When debugging, I had attempted to stop execution at this point, and had placed a
      QCoreApplication::quit();
      statement line. This did not stop the execution and I had forgotten about it, but it had interfered with the XML processing and was causing this error.

      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