Project

Profile

Help

How to connect?
Download (18.1 KB) Statistics
| Branch: | Tag: | Revision:

he / latest9.6 / hec / Saxon.C.API / XsltProcessor.cpp @ 50e062ec

1
// XsltProcessor.cpp : Defines the exported functions for the DLL application.
2
//
3

    
4
//#include "xsltProcessor.cc"
5

    
6
#include "XsltProcessor.h"
7
#include "XdmValue.h"
8
#include "XdmItem.h"
9
#include "XdmNode.h"
10
#include "XdmAtomicValue.h"
11
#ifdef DEBUG
12
#include <typeinfo> //used for testing only
13
#endif
14

    
15
XsltProcessor::XsltProcessor() {
16

    
17
        SaxonProcessor *p = new SaxonProcessor(false);
18
        XsltProcessor(p, "");
19

    
20
}
21

    
22
XsltProcessor::XsltProcessor(SaxonProcessor * p, std::string curr) {
23

    
24
        proc = p;
25

    
26
        /*
27
         * Look for class.
28
         */
29
        cppClass = lookForClass(proc->environ->env,
30
                        "net/sf/saxon/option/cpp/XsltProcessor");
31
        if ((proc->proc) == NULL) {
32
                cerr << "Processor is NULL" << endl;
33
        }
34

    
35
        cppXT = createSaxonProcessor2(proc->environ->env, cppClass,
36
                        "(Lnet/sf/saxon/s9api/Processor;)V", proc->proc);
37

    
38
#ifdef DEBUG
39
        jmethodID debugMID = proc->environ->env->GetStaticMethodID(cppClass, "setDebugMode", "(Z)V");
40
        proc->environ->env->CallStaticVoidMethod(cppClass, debugMID, (jboolean)true);
41
#endif    
42

    
43
        nodeCreated = false;
44
        proc->exception = NULL;
45
        outputfile1 = "";
46
        if(!(proc->cwd.empty()) && curr.empty()){
47
                cwdXT = proc->cwd;
48
        } else {
49
                cwdXT = curr;
50
        }
51

    
52
}
53

    
54
bool XsltProcessor::exceptionOccurred() {
55
        return proc->exceptionOccurred();
56
}
57

    
58
const char * XsltProcessor::getErrorCode(int i) {
59
 if(proc->exception == NULL) {return NULL;}
60
 return proc->exception->getErrorCode(i);
61
 }
62

    
63
void XsltProcessor::setSourceFromXdmValue(XdmItem * value) {
64
    if(value != NULL){
65
      value->incrementRefCount();
66
      parameters["node"] = value;
67
    }
68
}
69

    
70
void XsltProcessor::setSourceFromFile(const char * ifile) {
71
        setProperty("s", ifile);
72
}
73

    
74
void XsltProcessor::setOutputFile(const char * ofile) {
75
        outputfile1 = std::string(ofile);
76
        setProperty("o", ofile);
77
}
78

    
79
void XsltProcessor::setParameter(const char* name, XdmValue * value) {
80
        if(value != NULL){
81
                value->incrementRefCount();
82
                parameters["param:"+std::string(name)] = value;
83
        } 
84
}
85

    
86
XdmValue* XsltProcessor::getParameter(const char* name) {
87
        std::map<std::string, XdmValue*>::iterator it;
88
        it = parameters.find("param:"+std::string(name));
89
        if (it != parameters.end())
90
          return it->second;
91
        return NULL;
92
}
93

    
94
bool XsltProcessor::removeParameter(const char* name) {
95
        return (bool)(parameters.erase("param:"+string(name)));
96
}
97

    
98
void XsltProcessor::setProperty(const char* name, const char* value) {
99
        properties.insert(std::pair<std::string, std::string>(std::string(name), std::string(value)));
100

    
101
}
102

    
103
const char* XsltProcessor::getProperty(const char* name) {
104
        std::map<std::string, std::string>::iterator it;
105
        it = properties.find(std::string(name));
106
        if (it != properties.end())
107
          return it->second.c_str();
108
        return NULL;
109
}
110

    
111
void XsltProcessor::clearParameters(bool delValues) {
112
        if(delValues){
113
                       for(std::map<std::string, XdmValue*>::iterator itr = parameters.begin(); itr != parameters.end(); itr++){
114
                        //cout<<"param-name:"<<itr->first<<endl;
115
                        /*string s1 = typeid(itr->second).name();
116
                        cerr<<"Type of itr:"<<s1<<endl;*/
117
                        XdmValue * value = itr->second;
118
                        value->decrementRefCount();
119
#ifdef DEBUG
120
                        cout<<"clearParameter() - XdmValue refCount="<<value->getRefCount()<<endl;
121
#endif
122
                        if(value != NULL && value->getRefCount() < 1){                
123
                                delete value;
124
                        }
125
                }
126
                
127
        }
128
        parameters.clear();
129
}
130

    
131
void XsltProcessor::clearProperties() {
132
        properties.clear();
133
}
134

    
135

    
136

    
137
std::map<std::string,XdmValue*>& XsltProcessor::getParameters(){
138
        std::map<std::string,XdmValue*>& ptr = parameters;
139
        return ptr;
140
}
141

    
142
std::map<std::string,std::string>& XsltProcessor::getProperties(){
143
        std::map<std::string,std::string> &ptr = properties;
144
        return ptr;
145
}
146

    
147
void XsltProcessor::exceptionClear(){
148
 if(proc->exception != NULL) {
149
         delete proc->exception;
150
         proc->exception = NULL;
151
        proc->environ->env->ExceptionClear();
152
 }
153
  
154
 }
155

    
156
   void XsltProcessor::setcwd(const char* dir){
157
    cwdXT = std::string(dir);
158
   }
159

    
160
const char* XsltProcessor::checkException() {
161
        /*if(proc->exception == NULL) {
162
         proc->exception = proc->checkForException(proc->environ, cppClass, cpp);
163
         }
164
         return proc->exception;*/
165
        return checkForException(*(proc->environ), cppClass, cppXT);
166
}
167

    
168
int XsltProcessor::exceptionCount(){
169
 if(proc->exception != NULL){
170
 return proc->exception->count();
171
 }
172
 return 0;
173
 }
174

    
175
void XsltProcessor::compileFromString(const char* stylesheetStr) {
176
        static jmethodID cStringmID =
177
                        (jmethodID) proc->environ->env->GetMethodID(cppClass,
178
                                        "createStylesheetFromString",
179
                                        "(Ljava/lang/String;Ljava/lang/String;)Lnet/sf/saxon/s9api/XsltExecutable;");
180
        if (!cStringmID) {
181
                cerr << "Error: MyClassInDll." << "createStylesheetFromString"
182
                                << " not found\n" << endl;
183

    
184
        } else {
185

    
186
                stylesheetObject = (jobject)(
187
                                proc->environ->env->CallObjectMethod(cppXT, cStringmID,
188
                                                proc->environ->env->NewStringUTF(cwdXT.c_str()),
189
                                                proc->environ->env->NewStringUTF(stylesheetStr)));
190
                if (!stylesheetObject) {
191
                        if(exceptionOccurred()) {
192
                                
193
                                if(proc->exception != NULL) {
194
                                        delete proc->exception;
195
                                }
196
                                proc->exception = proc->checkForExceptionCPP(proc->environ->env, cppClass, NULL);
197
                                proc->exceptionClear();
198
                             }
199
                }
200
        }
201

    
202
}
203

    
204
void XsltProcessor::compileFromXdmNode(XdmNode * node) {
205
        static jmethodID cNodemID =
206
                        (jmethodID) proc->environ->env->GetMethodID(cppClass,
207
                                        "createStylesheetFromFile",
208
                                        "(Ljava/lang/String;Lnet/sf/saxon/s9api/XdmNode;)Lnet/sf/saxon/s9api/XsltExecutable;");
209
        if (!cNodemID) {
210
                cerr << "Error: MyClassInDll." << "createStylesheetFromXdmNode"
211
                                << " not found\n" << endl;
212

    
213
        } else {
214
                releaseStylesheet();
215
                stylesheetObject = (jobject)(
216
                                proc->environ->env->CallObjectMethod(cppXT, cNodemID,
217
                                                proc->environ->env->NewStringUTF(cwdXT.c_str()),
218
                                                node->getUnderlyingValue(proc)));
219
                if (!stylesheetObject) {
220
                        if(exceptionOccurred()) {
221
                                if(proc->exception != NULL) {
222
                                        delete proc->exception;
223
                                }
224
                                proc->exception = proc->checkForExceptionCPP(proc->environ->env, cppClass, NULL);
225
                                proc->exceptionClear();
226
                             }
227
                        //cout << "Error in compileFromXdmNode" << endl;
228
                }
229
        }
230

    
231
}
232

    
233
void XsltProcessor::compileFromFile(const char* stylesheet) {
234
        static jmethodID cFilemID =
235
                        (jmethodID) proc->environ->env->GetMethodID(cppClass,
236
                                        "createStylesheetFromFile",
237
                                        "(Ljava/lang/String;Ljava/lang/String;)Lnet/sf/saxon/s9api/XsltExecutable;");
238
        if (!cFilemID) {
239
                cerr << "Error: MyClassInDll." << "createStylesheetFromFile"
240
                                << " not found\n" << endl;
241

    
242
        } else {
243
                releaseStylesheet();
244

    
245
                stylesheetObject = (jobject)(
246
                                proc->environ->env->CallObjectMethod(cppXT, cFilemID,
247
                                                proc->environ->env->NewStringUTF(cwdXT.c_str()),
248
                                                proc->environ->env->NewStringUTF(stylesheet)));
249
                if (!stylesheetObject) {
250
                        if(exceptionOccurred()) {
251
                                
252
                                if(proc->exception != NULL) {
253
                                        delete proc->exception;
254
                                }
255
                                proc->exception = proc->checkForExceptionCPP(proc->environ->env, cppClass, NULL);
256
                                proc->exceptionClear();
257
                           }
258
                     
259
                }
260
                //proc->environ->env->NewGlobalRef(stylesheetObject);
261
        }
262

    
263
}
264

    
265
void XsltProcessor::releaseStylesheet() {
266

    
267
        stylesheetObject = NULL;
268
        
269
}
270

    
271

    
272

    
273
XdmValue * XsltProcessor::transformFileToValue(const char* sourcefile,
274
                const char* stylesheetfile) {
275

    
276
        if(sourcefile == NULL && stylesheetfile == NULL && !stylesheetObject){
277
                cerr<< "Error: The most recent Stylesheet Object failed. Please check exceptions"<<endl;
278
                return NULL;
279
        }
280

    
281
        setProperty("resources", proc->getResourcesDirectory());
282
        static jmethodID mID =
283
                        (jmethodID) proc->environ->env->GetMethodID(cppClass,
284
                                        "transformToNode",
285
                                        "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;[Ljava/lang/Object;)Lnet/sf/saxon/s9api/XdmNode;");
286
        if (!mID) {
287
                cerr << "Error: MyClassInDll." << "transformtoNode" << " not found\n"
288
                                << endl;
289

    
290
        } else {
291
                jobjectArray stringArray = NULL;
292
                jobjectArray objectArray = NULL;
293
                jclass objectClass = lookForClass(proc->environ->env,
294
                                "java/lang/Object");
295
                jclass stringClass = lookForClass(proc->environ->env,
296
                                "java/lang/String");
297

    
298
                int size = parameters.size() + properties.size();
299
                if (size > 0) {
300
                        objectArray = proc->environ->env->NewObjectArray((jint) size,
301
                                        objectClass, 0);
302
                        stringArray = proc->environ->env->NewObjectArray((jint) size,
303
                                        stringClass, 0);
304
                        int i = 0;
305
                        for (map<std::string, XdmValue*>::iterator iter =
306
                                        parameters.begin(); iter != parameters.end(); ++iter, i++) {
307
                                proc->environ->env->SetObjectArrayElement(stringArray, i,
308
                                                proc->environ->env->NewStringUTF(
309
                                                                (iter->first).c_str()));
310
                                proc->environ->env->SetObjectArrayElement(objectArray, i,
311
                                                (iter->second)->getUnderlyingValue(proc));
312
                        }
313
                        for (map<std::string, std::string>::iterator iter =
314
                                        properties.begin(); iter != properties.end(); ++iter, i++) {
315
                                proc->environ->env->SetObjectArrayElement(stringArray, i,
316
                                                proc->environ->env->NewStringUTF(
317
                                                                (iter->first).c_str()));
318
                                proc->environ->env->SetObjectArrayElement(objectArray, i,
319
                                                proc->environ->env->NewStringUTF(
320
                                                                (iter->second).c_str()));
321
                        }
322
                }
323
                jobject result = (jobject)(
324
                                proc->environ->env->CallObjectMethod(cppXT, mID,
325
                                                proc->environ->env->NewStringUTF(cwdXT.c_str()),
326
                                                (sourcefile != NULL ?
327
                                                                proc->environ->env->NewStringUTF(sourcefile) :
328
                                                                NULL),
329
                                                (stylesheetfile != NULL ?
330
                                                                proc->environ->env->NewStringUTF(
331
                                                                                stylesheetfile) :
332
                                                                NULL), stringArray, objectArray));
333
                if (size > 0) {
334
                        proc->environ->env->DeleteLocalRef(stringArray);
335
                        proc->environ->env->DeleteLocalRef(objectArray);
336
                }
337
                if (result) {
338
                        XdmNode * node = new XdmNode(result);
339
                        node->setProcessor(proc);
340
                        return node;
341
                }else if(exceptionOccurred()) {
342
        
343
                        if(proc->exception != NULL) {
344
                                delete proc->exception;
345
                        }
346
                        proc->exception = proc->checkForExceptionCPP(proc->environ->env, cppClass, NULL);
347
                        proc->exceptionClear();
348
                           
349
                     }
350
        }
351
        return NULL;
352

    
353
}
354

    
355

    
356
void XsltProcessor::transformFileToFile(const char* source,
357
                const char* stylesheet, const char* outputfile) {
358

    
359
        if(source == NULL && outputfile == NULL && !stylesheetObject){
360
                cerr<< "Error: The most recent Stylesheet Object failed. Please check exceptions"<<endl;
361
                return;
362
        }
363
        setProperty("resources", proc->getResourcesDirectory());
364
        jmethodID mID =
365
                        (jmethodID) proc->environ->env->GetMethodID(cppClass,
366
                                        "transformToFile",
367
                                        "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;[Ljava/lang/Object;)V");
368
        if (!mID) {
369
                cerr << "Error: MyClassInDll." << "transformToFile" << " not found\n"
370
                                << endl;
371

    
372
        } else {
373
                jobjectArray stringArray = NULL;
374
                jobjectArray objectArray = NULL;
375
                jclass objectClass = lookForClass(proc->environ->env,
376
                                "java/lang/Object");
377
                jclass stringClass = lookForClass(proc->environ->env,
378
                                "java/lang/String");
379

    
380
                int size = parameters.size() + properties.size();
381
#ifdef DEBUG
382
                cerr<<"Properties size: "<<properties.size()<<endl;
383
                cerr<<"Parameter size: "<<parameters.size()<<endl;
384
                cerr<<"size:"<<size<<endl;
385
#endif
386
                if (size > 0) {
387
                        objectArray = proc->environ->env->NewObjectArray((jint) size,
388
                                        objectClass, 0);
389
                        stringArray = proc->environ->env->NewObjectArray((jint) size,
390
                                        stringClass, 0);
391
                        if (objectArray == NULL) {
392
                                cerr << "objectArray is NULL" << endl;
393
                        }
394
                        if (stringArray == NULL) {
395
                                cerr << "stringArray is NULL" << endl;
396
                        }
397
                        int i = 0;
398
                        for (map<std::string, XdmValue*>::iterator iter =
399
                                        parameters.begin(); iter != parameters.end(); ++iter, i++) {
400

    
401
#ifdef DEBUG
402
                                cerr<<"map 1"<<endl;
403
                                cerr<<"iter->first"<<(iter->first).c_str()<<endl;
404
#endif
405
                                proc->environ->env->SetObjectArrayElement(stringArray, i,
406
                                                proc->environ->env->NewStringUTF(
407
                                                                (iter->first).c_str()));
408
#ifdef DEBUG
409
                                string s1 = typeid(iter->second).name();
410
                                cerr<<"Type of itr:"<<s1<<endl;
411
                                jobject xx = (iter->second)->getUnderlyingValue(proc);
412
                                if(xx == NULL) {
413
                                        cerr<<"value failed"<<endl;
414
                                } else {
415

    
416
                                        cerr<<"Type of value:"<<(typeid(xx).name())<<endl;
417
                                }
418
                                if((iter->second)->getUnderlyingValue(proc) == NULL) {
419
                                        cerr<<"(iter->second)->getUnderlyingValue() is NULL"<<endl;
420
                                }
421
#endif
422
                                proc->environ->env->SetObjectArrayElement(objectArray, i,
423
                                                (iter->second)->getUnderlyingValue(proc));
424

    
425
                        }
426

    
427
                        for (map<std::string, std::string>::iterator iter =
428
                                        properties.begin(); iter != properties.end(); ++iter, i++) {
429
                                proc->environ->env->SetObjectArrayElement(stringArray, i,
430
                                                proc->environ->env->NewStringUTF(
431
                                                                (iter->first).c_str()));
432
                                proc->environ->env->SetObjectArrayElement(objectArray, i,
433
                                                proc->environ->env->NewStringUTF(
434
                                                                (iter->second).c_str()));
435
                        }
436
                }
437
                proc->environ->env->CallObjectMethod(cppXT, mID,
438
                                                                proc->environ->env->NewStringUTF(cwdXT.c_str()),
439
                                                                (source != NULL ?
440
                                                                                proc->environ->env->NewStringUTF(
441
                                                                                                source) :
442
                                                                                NULL),
443
                                                                proc->environ->env->NewStringUTF(stylesheet),NULL,
444
                                                                stringArray, objectArray);
445
                if (size > 0) {
446
                        proc->environ->env->DeleteLocalRef(stringArray);
447
                        proc->environ->env->DeleteLocalRef(objectArray);
448
                }
449
                
450
        }
451

    
452
        if(exceptionOccurred()) {
453
                        if(proc->exception != NULL) {
454
                                delete proc->exception;
455
                        }
456
                        proc->exception = proc->checkForExceptionCPP(proc->environ->env, cppClass, NULL);
457
                        proc->exceptionClear();
458
                           
459
                     }
460

    
461

    
462
}
463

    
464

    
465
XdmValue * XsltProcessor::getXslMessages(){
466

    
467
jmethodID mID =   (jmethodID) proc->environ->env->GetMethodID(cppClass,
468
                                        "getXslMessages",
469
                                        "()[Lnet/sf/saxon/s9api/XdmValue;");
470
        if (!mID) {
471
                cerr << "Error: MyClassInDll." << "transformToString" << " not found\n"
472
                                << endl;
473

    
474
        } else {
475
jobjectArray results = (jobjectArray)(
476
                        proc->environ->env->CallObjectMethod(cppXT, mID));
477
        int sizex = proc->environ->env->GetArrayLength(results);
478

    
479
        if (sizex>0) {
480
                XdmValue * value = new XdmValue();
481
                
482
                for (int p=0; p < sizex; ++p) 
483
                {
484
                        jobject resulti = proc->environ->env->GetObjectArrayElement(results, p);
485
                        value->addUnderlyingValue(resulti);
486
                }
487
                proc->environ->env->DeleteLocalRef(results);
488
                return value;
489
        }
490
    }
491
    return NULL;
492

    
493

    
494
}
495

    
496
const char * XsltProcessor::transformFileToString(const char* source,
497
                const char* stylesheet) {
498
        if(source == NULL && stylesheet == NULL && !stylesheetObject){
499
                cerr<< "Error: The most recent StylesheetObject failed. Please check exceptions"<<endl;
500
                return NULL;
501
        }
502
        setProperty("resources", proc->getResourcesDirectory());
503
        jmethodID mID =
504
                        (jmethodID) proc->environ->env->GetMethodID(cppClass,
505
                                        "transformToString",
506
                                        "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;");
507
        if (!mID) {
508
                cerr << "Error: MyClassInDll." << "transformFileToString" << " not found\n"
509
                                << endl;
510

    
511
        } else {
512
                jobjectArray stringArray = NULL;
513
                jobjectArray objectArray = NULL;
514
                jclass objectClass = lookForClass(proc->environ->env,
515
                                "java/lang/Object");
516
                jclass stringClass = lookForClass(proc->environ->env,
517
                                "java/lang/String");
518

    
519
                int size = parameters.size() + properties.size();
520
#ifdef DEBUG
521
                cerr<<"Properties size: "<<properties.size()<<endl;
522
                cerr<<"Parameter size: "<<parameters.size()<<endl;
523
#endif
524
                if (size > 0) {
525
                        objectArray = proc->environ->env->NewObjectArray((jint) size,
526
                                        objectClass, 0);
527
                        stringArray = proc->environ->env->NewObjectArray((jint) size,
528
                                        stringClass, 0);
529
                        if (objectArray == NULL) {
530
                                cerr << "objectArray is NULL" << endl;
531
                        }
532
                        if (stringArray == NULL) {
533
                                cerr << "stringArray is NULL" << endl;
534
                        }
535
                        int i = 0;
536
                        for (map<std::string, XdmValue*>::iterator iter =
537
                                        parameters.begin(); iter != parameters.end(); ++iter, i++) {
538

    
539
#ifdef DEBUG
540
                                cerr<<"map 1"<<endl;
541
                                cerr<<"iter->first"<<(iter->first).c_str()<<endl;
542
#endif
543
                                proc->environ->env->SetObjectArrayElement(stringArray, i,
544
                                                proc->environ->env->NewStringUTF(
545
                                                                (iter->first).c_str()));
546
#ifdef DEBUG
547
                                string s1 = typeid(iter->second).name();
548
                                cerr<<"Type of itr:"<<s1<<endl;
549
                                jobject xx = (iter->second)->getUnderlyingValue(proc);
550
                                if(xx == NULL) {
551
                                        cerr<<"value failed"<<endl;
552
                                } else {
553

    
554
                                        cerr<<"Type of value:"<<(typeid(xx).name())<<endl;
555
                                }
556
                                if((iter->second)->getUnderlyingValue(proc) == NULL) {
557
                                        cerr<<"(iter->second)->getUnderlyingValue() is NULL"<<endl;
558
                                }
559
#endif
560
                                proc->environ->env->SetObjectArrayElement(objectArray, i,
561
                                                (iter->second)->getUnderlyingValue(proc));
562

    
563
                        }
564

    
565
                        for (map<std::string, std::string>::iterator iter =
566
                                        properties.begin(); iter != properties.end(); ++iter, i++) {
567
                                proc->environ->env->SetObjectArrayElement(stringArray, i,
568
                                                proc->environ->env->NewStringUTF(
569
                                                                (iter->first).c_str()));
570
                                proc->environ->env->SetObjectArrayElement(objectArray, i,
571
                                                proc->environ->env->NewStringUTF(
572
                                                                (iter->second).c_str()));
573
                        }
574
                }
575

    
576
        jstring result = NULL;
577
        jobject obj =
578
                                (
579
                                                proc->environ->env->CallObjectMethod(cppXT, mID,
580
                                                                proc->environ->env->NewStringUTF(cwdXT.c_str()),
581
                                                                (source != NULL ?
582
                                                                                proc->environ->env->NewStringUTF(
583
                                                                                                source) :
584
                                                                                NULL),
585
                                                                proc->environ->env->NewStringUTF(stylesheet),
586
                                                                stringArray, objectArray));
587
                if(obj) {
588
                        result = (jstring)obj;
589
                }                
590
                if (size > 0) {
591
                        proc->environ->env->DeleteLocalRef(stringArray);
592
                        proc->environ->env->DeleteLocalRef(objectArray);
593
                }
594
                if (result) {
595
                        const char * str = proc->environ->env->GetStringUTFChars(result,
596
                                        NULL);
597
                        //return "result should be ok";
598
                        return str;
599
                } else if(exceptionOccurred()) {
600
                        if(proc->exception != NULL) {
601
                                delete proc->exception;
602
                        }
603
                        proc->exception = proc->checkForExceptionCPP(proc->environ->env, cppClass, NULL);
604
                        proc->exceptionClear();
605
                           
606
                     }
607
        }
608

    
609
        return NULL;
610
}
611

    
612

    
613
   const char * XsltProcessor::transformToString(){
614
        if(!stylesheetObject){
615
                cerr<< "Error: The most recent Stylesheet Object failed or has not been set."<<endl;
616
                return NULL;
617
        }
618
        return transformFileToString(NULL, NULL);
619
   }
620

    
621

    
622
    XdmValue * XsltProcessor::transformToValue(){
623
        if(!stylesheetObject){
624
                cerr<< "Error: The most recent Stylesheet Object failed or has not been set."<<endl;
625
                return NULL;
626
        }
627
        return transformFileToValue(NULL, NULL);
628
   }
629

    
630
    void XsltProcessor::transformToFile(){
631
        if(!stylesheetObject){
632
                cerr<< "Error: The most recent Stylesheet Object failed or has not been set."<<endl;
633
                return;
634
        }
635
        transformFileToFile(NULL, NULL, NULL);
636
   }
637

    
638
const char * XsltProcessor::getErrorMessage(int i ){
639
 if(proc->exception == NULL) {return NULL;}
640
 return proc->exception->getErrorMessage(i);
641
 }
642

    
(26-26/37)