Project

Profile

Help

Revision c6dcd97a

Added by O'Neil Delpratt almost 6 years ago

Saxon/C update and bug fixes

View differences:

latest9.6/hec/Saxon.C.API/SaxonCGlue.c
19 19
		strncat(resources_dir, env,  env_len);
20 20
		strncat(resources_dir, "/saxon-data", rDir_len);
21 21
		strncat(dllname, env, env_len);
22
		strncat(dllname, "/libsaxoneec.so", name_len); //rename according to product edition (-hec or -pec)
22
		strncat(dllname, "/libsaxonhec.so", name_len); //rename according to product edition (-hec or -pec)
23 23
#ifdef DEBUG	
24 24
		printf("resources_dir: %s\n", resources_dir);	
25 25
		printf("envDir: %s\n", env);
latest9.6/hec/Saxon.C.API/SaxonCGlue.h
1
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
2
// Copyright (c) 2016 Saxonica Limited.
3
// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
4
// If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
5
// This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0.
6
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
7

  
1 8
#ifndef SAXONCGLUE_H 
2 9
#define SAXONCGLUE_H
3 10
#include <jni.h>
......
51 58

  
52 59
static char dllname[] =
53 60
    #ifdef __linux__
54
        "/usr/lib/libsaxon.so";  //rename according to product edition (-hec or -pec) Also make change in the c file
61
        "/usr/lib/libsaxonhec.so";  //rename according to product edition (hec or pec) Also make change in the c file
55 62
    #elif  defined (__APPLE__) && defined(__MACH__)
56 63
        "/usr/lib/libsaxoneec.dylib";
57 64
    #else
58
         "C:\\Program Files\\Saxonica\\SaxonEEC1.0.0\\libsaxoneec.dll";
65
         "C:\\Program Files\\Saxonica\\SaxonHEC1.0.0\\libsaxonhec.dll";
59 66
    #endif
60 67

  
61 68
static char resources_dir[] = 
......
64 71
    #elif  defined (__APPLE__) && defined(__MACH__)
65 72
        "/usr/lib/saxon-data";
66 73
    #else
67
         "C:\\Program Files\\Saxonica\\SaxonEEC1.0.0\\saxon-data";
74
         "C:\\Program Files\\Saxonica\\SaxonHEC1.0.0\\saxon-data";
68 75
    #endif
69 76

  
70 77

  
latest9.6/hec/samples/cppTests/testValidator.cpp
81 81

  
82 82
}
83 83

  
84
void testValidator4a(SaxonProcessor * processor, SchemaValidator * val){
85
  processor->exceptionClear();
86
  val->clearParameters(true);
87
  val->clearProperties();
88
  cout<<endl<<"Test 4: Validate source file with schema file. i.e. family.xml and family.xsd"<<endl;	
89

  
90
	val->registerSchemaFromFile("family-ext.xsd");
91
       //val->registerSchema("family.xsd");
92
	val->registerSchemaFromFile("family.xsd");
93
	XdmNode * node = val->validateToNode("family.xml");
94
	if(node != NULL) {
95
		if(!val->exceptionOccurred()) {
96
			cout<<endl<<"Doc1 is OK"<<endl;
97
	 	} else {
98
			cout<<endl<<"Error: Doc reported as valid!"<<endl;
99
		}
100
	} else {
101
	cout<<endl<<"Error: node is NULL"<<endl;
102
	}
103

  
104
}
105

  
84 106
void testValidator5(SaxonProcessor * processor, SchemaValidator * val){
85 107
  processor->exceptionClear();
86 108
  val->clearParameters(true);
......
105 127
	val->setProperty("verbose", "true");
106 128
	val->validate();
107 129
	XdmNode * node = val->getValidationReport(); 
108
	if(node != NULL) {
109
		cout<<endl<<"Validation Report"<<node->getStringValue()<<endl;
110
	} else {
111
		cout<<endl<<"Error: Validation Report is NULL"<<endl;
112
	}
130
	//if(node != NULL) {
131
		cout<<endl<<node->size()<<"Validation Report"<<node->getStringValue()<<endl;
132
	//} else {
133
	//	cout<<endl<<"Error: Validation Report is NULL"<<endl;
134
	//}
113 135

  
114 136
	
115 137

  
......
131 153
	processor->setConfigurationProperty("http://saxon.sf.net/feature/multipleSchemaImports", "on");
132 154
	SchemaValidator * validator2 = processor->newSchemaValidator();
133 155
	testValidator4(processor, validator2);
156
	testValidator4a(processor, validator2);
134 157
	processor->setConfigurationProperty("xsdversion", "1.1");
135 158
	SchemaValidator * validator3 = processor->newSchemaValidator();
136 159
	testValidator5(processor, validator3);

Also available in: Unified diff