~ubuntu-branches/debian/lenny/libxslt/lenny

« back to all changes in this revision

Viewing changes to xsltproc/xsltproc.c

  • Committer: Bazaar Package Importer
  • Author(s): Mike Hommey
  • Date: 2006-10-27 18:30:38 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20061027183038-gjgawhlr2k4csrr6
Tags: 1.1.18-1
* New upstream release:
  + Fixes xsl:variable with node sets. Closes: #381597.
  + Honors disable-output-escaping in xhtml 1.0 style element.
    Closes: #395210.
  + Supports XInclude processing on XSL stylesheets. Closes: #395210.
  + Correctly handles xsl:param names with namespaces. Closes: #389023.
* debian/control:
  + Bumped Standards-Version to 3.7.2.2. No changes required.
  + Build depend on libxml2 >= 2.6.27, and adapt other dependencies
    accordingly.

Show diffs side-by-side

added added

removed removed

Lines of Context:
85
85
static int load_trace = 0;
86
86
#ifdef LIBXML_XINCLUDE_ENABLED
87
87
static int xinclude = 0;
 
88
static int xincludestyle = 0;
88
89
#endif
89
90
static int profile = 0;
90
91
 
353
354
xsltProcess(xmlDocPtr doc, xsltStylesheetPtr cur, const char *filename) {
354
355
    xmlDocPtr res;
355
356
    xsltTransformContextPtr ctxt;
 
357
    int ret;
356
358
   
357
359
 
358
360
#ifdef LIBXML_XINCLUDE_ENABLED
391
393
        if (ctxt == NULL)
392
394
            return;
393
395
        xsltSetCtxtParseOptions(ctxt, options);
 
396
#ifdef LIBXML_XINCLUDE_ENABLED
394
397
        if (xinclude)
395
398
            ctxt->xinclude = 1;
 
399
#endif
396
400
        if (profile) {
397
401
            res = xsltApplyStylesheetUser(cur, doc, params, NULL,
398
402
                                          stderr, ctxt);
458
462
        if (ctxt == NULL)
459
463
            return;
460
464
        if (profile) {
461
 
            xsltRunStylesheetUser(cur, doc, params, output,
 
465
            ret = xsltRunStylesheetUser(cur, doc, params, output,
462
466
                                        NULL, NULL, stderr, ctxt);
463
467
        } else {
464
 
            xsltRunStylesheetUser(cur, doc, params, output,
 
468
            ret = xsltRunStylesheetUser(cur, doc, params, output,
465
469
                                        NULL, NULL, NULL, ctxt);
466
470
        }
 
471
        if (ret == -1)
 
472
            errorno = 11;
467
473
        if (ctxt->state == XSLT_STATE_ERROR)
468
474
            errorno = 9;
469
475
        else if (ctxt->state == XSLT_STATE_STOPPED)
511
517
    printf("\t         file:///etc/xml/catalog are activated by default\n");
512
518
#endif
513
519
#ifdef LIBXML_XINCLUDE_ENABLED
514
 
    printf("\t--xinclude : do XInclude processing on document intput\n");
 
520
    printf("\t--xinclude : do XInclude processing on document input\n");
 
521
    printf("\t--xincludestyle : do XInclude processing on stylesheets\n");
515
522
#endif
516
523
    printf("\t--load-trace : print trace of all external entites loaded\n");
517
524
    printf("\t--profile or --norman : dump profiling informations \n");
650
657
        } else if ((!strcmp(argv[i], "-xinclude")) ||
651
658
                   (!strcmp(argv[i], "--xinclude"))) {
652
659
            xinclude++;
 
660
        } else if ((!strcmp(argv[i], "-xincludestyle")) ||
 
661
                   (!strcmp(argv[i], "--xincludestyle"))) {
 
662
            xincludestyle++;
653
663
            xsltSetXIncludeDefault(1);
654
664
#endif
655
665
        } else if ((!strcmp(argv[i], "-load-trace")) ||
777
787
            style = xmlReadFile((const char *) argv[i], NULL, options);
778
788
            if (timing) 
779
789
                endTimer("Parsing stylesheet %s", argv[i]);
 
790
            if (xincludestyle) {
 
791
                if (style != NULL) {
 
792
                    if (timing)
 
793
                        startTimer();
 
794
#if LIBXML_VERSION >= 20603
 
795
                    xmlXIncludeProcessFlags(style, XSLT_PARSE_OPTIONS);
 
796
#else
 
797
                    xmlXIncludeProcess(style);
 
798
#endif
 
799
                    if (timing) {
 
800
                        endTimer("XInclude processing %s", argv[i]);
 
801
                    }
 
802
                }
 
803
            }
780
804
            if (style == NULL) {
781
805
                fprintf(stderr,  "cannot parse %s\n", argv[i]);
782
806
                cur = NULL;