~ubuntu-branches/ubuntu/hardy/libxslt/hardy-security

« back to all changes in this revision

Viewing changes to xsltproc/xsltproc.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2007-11-19 14:47:49 UTC
  • mto: This revision was merged to the branch mainline in revision 15.
  • Revision ID: james.westby@ubuntu.com-20071119144749-fev916fklb1jpa8r
Tags: upstream-1.1.22
ImportĀ upstreamĀ versionĀ 1.1.22

Show diffs side-by-side

added added

removed removed

Lines of Context:
82
82
#ifdef LIBXML_HTML_ENABLED
83
83
static int html = 0;
84
84
#endif
 
85
static char *encoding = NULL;
85
86
static int load_trace = 0;
86
87
#ifdef LIBXML_XINCLUDE_ENABLED
87
88
static int xinclude = 0;
382
383
                xmlFreeDoc(doc);
383
384
#ifdef LIBXML_HTML_ENABLED
384
385
                if (html)
385
 
                    doc = htmlReadFile(filename, NULL, options);
 
386
                    doc = htmlReadFile(filename, encoding, options);
386
387
                else
387
388
#endif
388
 
                    doc = xmlReadFile(filename, NULL, options);
 
389
                    doc = xmlReadFile(filename, encoding, options);
389
390
            }
390
391
        }
391
392
        ctxt = xsltNewTransformContext(cur, doc);
500
501
#ifdef LIBXML_HTML_ENABLED
501
502
    printf("\t--html: the input document is(are) an HTML file(s)\n");
502
503
#endif
 
504
    printf("\t--encoding: the input document character encoding\n");
503
505
    printf("\t--param name value : pass a (parameter,value) pair\n");
504
506
    printf("\t       value is an UTF8 XPath expression.\n");
505
507
    printf("\t       string values must be quoted like \"'string'\"\n or");
603
605
                   (!strcmp(argv[i], "--html"))) {
604
606
            html++;
605
607
#endif
 
608
        } else if ((!strcmp(argv[i], "-encoding")) ||
 
609
                   (!strcmp(argv[i], "--encoding"))) {
 
610
            encoding = argv[++i];
606
611
        } else if ((!strcmp(argv[i], "-timing")) ||
607
612
                   (!strcmp(argv[i], "--timing"))) {
608
613
            timing++;
762
767
                   (!strcmp(argv[i], "--output"))) {
763
768
            i++;
764
769
            continue;
 
770
        } else if ((!strcmp(argv[i], "-encoding")) ||
 
771
                   (!strcmp(argv[i], "--encoding"))) {
 
772
            i++;
 
773
            continue;
765
774
        } else if ((!strcmp(argv[i], "-writesubtree")) ||
766
775
                   (!strcmp(argv[i], "--writesubtree"))) {
767
776
            i++;
839
848
                startTimer();
840
849
#ifdef LIBXML_HTML_ENABLED
841
850
            if (html)
842
 
                doc = htmlReadFile(argv[i], NULL, options);
 
851
                doc = htmlReadFile(argv[i], encoding, options);
843
852
            else
844
853
#endif
845
 
                doc = xmlReadFile(argv[i], NULL, options);
 
854
                doc = xmlReadFile(argv[i], encoding, options);
846
855
            if (doc == NULL) {
847
856
                fprintf(stderr, "unable to parse %s\n", argv[i]);
848
857
                errorno = 6;