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

« back to all changes in this revision

Viewing changes to libxslt/xslt.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:
3469
3469
            }
3470
3470
                     
3471
3471
            if ((cur->nsDef != NULL) && (style->exclPrefixNr > 0)) {
3472
 
                xmlNsPtr ns = cur->nsDef, prev = NULL, next, rns;
 
3472
                xmlNsPtr ns = cur->nsDef, prev = NULL, next;
3473
3473
                xmlNodePtr root = NULL;
3474
3474
                int i, moved;
3475
3475
 
3482
3482
                            if ((ns->prefix != NULL) && 
3483
3483
                                (xmlStrEqual(ns->href,
3484
3484
                                             style->exclPrefixTab[i]))) {
3485
 
                                /* Remove the namespace from this node */
 
3485
                                /*
 
3486
                                 * Move the namespace definition on the root
 
3487
                                 * element to avoid duplicating it without
 
3488
                                 * loosing it.
 
3489
                                 */
3486
3490
                                if (prev == NULL) {
3487
3491
                                    cur->nsDef = ns->next;
3488
3492
                                } else {
3489
3493
                                    prev->next = ns->next;
3490
3494
                                }
3491
 
                                /*
3492
 
                                 * If this prefix is not already present,
3493
 
                                 * move the namespace definition on the root
3494
 
                                 * element to avoid duplicating it without
3495
 
                                 * loosing it.
3496
 
                                 */
3497
 
                                for (rns = root->nsDef; rns != NULL; rns = rns->next)
3498
 
                                    if (xmlStrEqual(ns->prefix, rns->prefix))
3499
 
                                        break;
3500
 
                                if (rns == NULL) {
3501
 
                                    ns->next = root->nsDef;
3502
 
                                    root->nsDef = ns;
3503
 
                                }
3504
 
                                else
3505
 
                                    xmlFreeNs(ns);
 
3495
                                ns->next = root->nsDef;
 
3496
                                root->nsDef = ns;
3506
3497
                                moved = 1;
3507
3498
                                break;
3508
3499
                            }
6574
6565
    * Old behaviour.
6575
6566
    */
6576
6567
    retStyle->doc = doc;
6577
 
    xsltParseStylesheetProcess(retStyle, doc);
 
6568
    if (xsltParseStylesheetProcess(retStyle, doc) == NULL) {
 
6569
                retStyle->doc = NULL;
 
6570
                xsltFreeStylesheet(retStyle);
 
6571
                retStyle = NULL;
 
6572
    }
6578
6573
    if (retStyle != NULL) {
6579
6574
        if (retStyle->errors != 0) {
6580
6575
            retStyle->doc = NULL;