Project

Profile

Help

Download (1.63 KB) Statistics
| Branch: | Revision:

he / src / main / c / samples / cTests / testXSLT.c @ f299305b

1 72bf04c6 Norman Walsh
#include "../../Saxon.C.API/SaxonCProcessor.h"
2
#include "../../Saxon.C.API/SaxonCXPath.h"
3
4
5
int main()
6
{
7
    HANDLE myDllHandle;
8
    //JNIEnv *(environi.env);
9
    //JavaVM *jvm;
10
    jclass  myClassInDll;
11
    int cap = 10;
12
    sxnc_parameter * parameters; /*!< array of paramaters used for the transformation as (string, value) pairs */
13
    parameters;
14
    int parLen=0, parCap;
15
    parCap = cap;
16
    sxnc_property * properties; /*!< array of properties used for the transformation as (string, string) pairs */
17
    properties;
18
    int propLen=0;
19
    parCap = cap;
20
    sxnc_environment * environi;
21
    sxnc_processor * processor;
22
23
    initSaxonc(&environi, &processor, &parameters, &properties, parCap, parCap);
24
25
    /*
26
     * First of all, load required component.
27
     * By the time of JET initialization, all components should be loaded.
28
     */
29
    environi->myDllHandle = loadDefaultDll ();
30
        
31
    /*
32
     * Initialize JET run-time.
33
     * The handle of loaded component is used to retrieve Invocation API.
34
     */
35
    initDefaultJavaRT (&environi);
36
37
    const char *verCh = version(*environi);
38
    printf("XSLT Tests\n\nSaxon version: %s \n", verCh);        
39
    jobject num = integerValue(*environi, 5);
40
    setParameter(&parameters, &parLen, &parCap,"", "numParam", num);
41
  
42
43
    const char *result = xsltApplyStylesheet(environi, &processor, NULL, "cat.xml","test.xsl", 0 ,0, 0, 0);
44
  
45
        
46
47
    if(!result) {
48
      printf("result is null \n");
49
    }else {
50
      printf("%s", result);
51
    }
52
      fflush(stdout);
53
54
    /*
55
     * Finalize JET run-time.
56
     */
57
    finalizeJavaRT (environi->jvm);
58
    freeSaxonc(&environi, &processor, &parameters, &properties);
59
    return 0;
60
}