~ubuntu-branches/ubuntu/natty/libxslt/natty

« back to all changes in this revision

Viewing changes to libxslt/xslt.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2008-06-23 15:25:14 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20080623152514-nf37q9fm3drv69ps
Tags: 1.1.24-1ubuntu1
* merge from debian, remaining ubuntu changes:
  - build a python-libxslt1-dbg package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3397
3397
static void
3398
3398
xsltPrecomputeStylesheet(xsltStylesheetPtr style, xmlNodePtr cur)
3399
3399
{
3400
 
    xmlNodePtr deleteNode;
 
3400
    xmlNodePtr deleteNode, styleelem;
3401
3401
    int internalize = 0;
3402
3402
 
3403
3403
    if ((style == NULL) || (cur == NULL))
3408
3408
        internalize = 1;
3409
3409
    else
3410
3410
        style->internalized = 0;
 
3411
 
 
3412
    if ((cur != NULL) && (IS_XSLT_ELEM(cur)) &&
 
3413
        (IS_XSLT_NAME(cur, "stylesheet"))) {
 
3414
        styleelem = cur;
 
3415
    } else {
 
3416
        styleelem = NULL;
 
3417
    }
 
3418
 
3411
3419
    /*
3412
3420
     * This content comes from the stylesheet
3413
3421
     * For stylesheets, the set of whitespace-preserving
3539
3547
        }
3540
3548
 
3541
3549
        /*
3542
 
         * Skip to next node
 
3550
         * Skip to next node. In case of a namespaced element children of
 
3551
         * the stylesheet and not in the XSLT namespace and not an extension
 
3552
         * element, ignore its content.
3543
3553
         */
3544
 
        if (cur->children != NULL) {
 
3554
        if ((cur->type == XML_ELEMENT_NODE) && (cur->ns != NULL) &&
 
3555
            (styleelem != NULL) && (cur->parent == styleelem) &&
 
3556
            (!xmlStrEqual(cur->ns->href, XSLT_NAMESPACE)) &&
 
3557
            (!xsltCheckExtURI(style, cur->ns->href))) {
 
3558
            goto skip_children;
 
3559
        } else if (cur->children != NULL) {
3545
3560
            if ((cur->children->type != XML_ENTITY_DECL) &&
3546
3561
                (cur->children->type != XML_ENTITY_REF_NODE) &&
3547
3562
                (cur->children->type != XML_ENTITY_NODE)) {
3554
3569
        if (cur->next != NULL) {
3555
3570
            cur = cur->next;
3556
3571
            continue;
3557
 
        }       
 
3572
        }
3558
3573
        do {
3559
3574
 
3560
3575
            cur = cur->parent;
6023
6038
        xmlFree(prop);
6024
6039
    }
6025
6040
 
 
6041
    /*
 
6042
     * process xsl:import elements
 
6043
     */
6026
6044
    cur = top->children;
6027
 
 
6028
 
    /*
6029
 
     * process xsl:import elements
6030
 
     */
6031
6045
    while (cur != NULL) {
6032
6046
            if (IS_BLANK_NODE(cur)) {
6033
6047
                    cur = cur->next;
6589
6603
 * xsltParseStylesheetDoc:
6590
6604
 * @doc:  and xmlDoc parsed XML
6591
6605
 *
6592
 
 * parse an XSLT stylesheet building the associated structures
 
6606
 * parse an XSLT stylesheet, building the associated structures.  doc
 
6607
 * is kept as a reference within the returned stylesheet, so changes
 
6608
 * to doc after the parsing will be reflected when the stylesheet
 
6609
 * is applied, and the doc is automatically freed when the
 
6610
 * stylesheet is closed.
6593
6611
 *
6594
6612
 * Returns a new XSLT stylesheet structure.
6595
6613
 */