Project

Profile

Help

Bug #2673

closed

returning validation with getValidationReport

Added by Roger Martin about 8 years ago. Updated about 8 years ago.

Status:
Closed
Priority:
Normal
Category:
C++ API
Start date:
2016-03-12
Due date:
% Done:

100%

Estimated time:
Found in version:
1.0.0
Fixed in version:
1.0.1
Platforms:

Description

Testing validate and then SchemaValidatior::getValidationReport

After setting up and calling validate everytihng seems ok. Then trying to retrieve the results with getValidationReport causes a jet crash

@

#include

#include //std::system

#include

#include

#include

#include <condition_variable>

#include

#include

#include

#include "SchemaValidator.h"

#include "XdmNode.h"

//Main function.

int main(int argc, char *argv[])

{

std::shared_ptr processor(new SaxonProcessor(true));

std::shared_ptr schemaValidator(processor->newSchemaValidator());

schemaValidator->registerSchemaFromFile("/home/roger/NodeProjects/saxon-node/test/examples/query/books.xsd");

std::cout<<"validate... "<<std::endl;

schemaValidator->validate("/home/roger/NodeProjects/saxon-node/test/examples/query/books.xml");

//XdmNode* vp=schemaValidator->validateToNode("/home/roger/NodeProjects/saxon-node/test/examples/query/books.xml");

std::cout<<"getValidationReport... "<<std::endl;

XdmNode* vp=schemaValidator->getValidationReport();

std::cout<<"vp size "<size()<<std::endl;

std::cout<<"vp\n "<getStringValue()<<std::endl;

return 0;

}

@

https://github.com/rimmartin/saxon-node/tree/master/test/examples/query for the xml and xsd


Related issues

Related to SaxonC - Bug #2675: Validation report properties missing from documentationClosedO'Neil Delpratt2016-03-14

Actions
Actions #1

Updated by O'Neil Delpratt about 8 years ago

  • Category set to C++ API
  • Status changed from New to In Progress
  • Assignee set to O'Neil Delpratt
  • Priority changed from Low to Normal

Thank you for reporting this error. We will be investigating it and will report back shortly.

Actions #2

Updated by O'Neil Delpratt about 8 years ago

Before calling the validate() and getValidationReport() methods you should set the property to switch on validation reporting. i.e.:

schemaValidator->setProperty("report-node", "true");

Alternatively you can save validation report to file:

val->setProperty("report-file", "filename.xml");

Without the first property being set the variable vp will be NULL (see: http://www.saxonica.com/saxon-c/doc/html/classSchemaValidator.html#a6f630753665ec7dc169ed6ca168066b5). Jet intercepts the seg. errors and produces an error log file, which is probably not that helpful. Running gdb is probably more useful when debugging.

I have noticed that the documentation has these properties missing in http://www.saxonica.com/saxon-c/doc/html/index.html#getting-started. I will raise another bug against the documentation to add these properties.

Actions #3

Updated by O'Neil Delpratt about 8 years ago

  • Status changed from In Progress to AwaitingInfo
Actions #4

Updated by O'Neil Delpratt about 8 years ago

  • Related to Bug #2675: Validation report properties missing from documentation added
Actions #5

Updated by Roger Martin about 8 years ago

We're making progress!

saxon-node wrapper is now supporting validation and xpath for EE edition users of Saxon provided they get a license from you

The other method to XdmNode I''ll add after your patch release; users have the other way till then

Actions #6

Updated by O'Neil Delpratt about 8 years ago

  • Status changed from AwaitingInfo to Resolved
  • % Done changed from 0 to 100
  • Found in version set to 1.0.0

Bug fixed and committed to subversion

Actions #7

Updated by O'Neil Delpratt about 8 years ago

  • Status changed from Resolved to Closed
  • Fixed in version set to 1.0.1

Bug fix applied in the Saxon/C 1.0.1 maintenance release.

Please register to edit this issue

Also available in: Atom PDF