Project

Profile

Help

Bug #2672

validating with validateToNode

Added by Roger Martin over 2 years ago. Updated over 2 years ago.

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

100%

Found in version:
1.0.0
Fixed in version:
1.0.1

Description

In testing SchemaValidator::validateToNode it says:

Error: libsaxon.validate not found

I put a test app together:

@#include

#include //std::system

#include

#include

#include

#include

#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;

}@

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

History

#1 Updated by O'Neil Delpratt over 2 years ago

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

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

#2 Updated by O'Neil Delpratt over 2 years ago

I have reproduced the error you reported and it is indeed a bug in the validateToNode method. I will be working on this and will commit a patch shortly.

#3 Updated by O'Neil Delpratt over 2 years ago

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

Bug fixed and committed to subversion. The problem was in the validateToNode() method of the SchemaValidatorForCpp class of the Java code. The method argument does not match what is in the C++ code, which has the correct arguments.

A workaround would be to change the arguments in the C++ interface to match what is on the Java side for this method until a maintenance release is out.

#4 Updated by O'Neil Delpratt over 2 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