Project

Profile

Help

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

he / latest9.6 / hec / samples / cTests / testXSLT.c @ 2a9719f6

1
#include "../../Saxon.C.API/SaxonCProcessor.h"
2
#include "../../Saxon.C.API/SaxonCXPath.h"
3

    
4

    
5
int main()
6
{
7
    HANDLE myDllHandle;
8
    //JNIEnv *(environ.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 * environ;
21
    sxnc_processor * processor;
22

    
23
    initSaxonc(&environ, &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
    environ->myDllHandle = loadDefaultDll ();
30
        
31
    /*
32
     * Initialize JET run-time.
33
     * The handle of loaded component is used to retrieve Invocation API.
34
     */
35
    initDefaultJavaRT (&environ);
36

    
37
    const char *verCh = version(*environ);
38
    printf("XSLT Tests\n\nSaxon version: %s \n", verCh);        
39
    jobject num = integerValue(*environ, 5);
40
    setParameter(&parameters, &parLen, &parCap,"", "numParam", num);
41
  
42

    
43
    const char *result = xsltApplyStylesheet(*environ, &processor, "/home/ond1/work/svn/Saxon.C.Api/cTests/", "ORP0301177AA__EE__30954_sinsello.xml","campos.xsl", 0 ,0, 0, 0);
44
  
45
    /*xsltSaveResultToFile(*environ, &processor, "/home/ond1/work/svn/Saxon.C.Api/cTests/", "cat.xml","test.xsl", "output.txt", parameters ,0, parLen, 0);*/
46
        
47

    
48
    if(!result) {
49
      printf("result is null \n");
50
    }else {
51
      printf("%s", result);
52
    }
53
      fflush(stdout);
54

    
55
    /*
56
     * Finalize JET run-time.
57
     */
58
    finalizeJavaRT (environ->jvm);
59
    freeSaxonc(&environ, &processor, &parameters, &properties);
60
    return 0;
61
}
(12-12/12)