~pythoneers/ubuntu/lucid/lxml/ltsppa

« back to all changes in this revision

Viewing changes to src/lxml/xslt.pxi

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2008-07-27 00:22:27 UTC
  • mfrom: (1.1.18 upstream)
  • Revision ID: james.westby@ubuntu.com-20080727002227-tz1dat7rcq8n2eh4
Tags: 2.1.1-1
New upstream version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
417
417
        def __get__(self):
418
418
            return self._error_log.copy()
419
419
 
420
 
    def apply(self, _input, *, profile_run=False, **_kw):
421
 
        u"""apply(self, _input,  profile_run=False, **_kw)
 
420
    def apply(self, _input, *, profile_run=False, **kw):
 
421
        u"""apply(self, _input,  profile_run=False, **kw)
422
422
        
423
423
        :deprecated: call the object, not this method."""
424
 
        return self(_input, profile_run=profile_run, **_kw)
 
424
        return self(_input, profile_run=profile_run, **kw)
425
425
 
426
426
    def tostring(self, _ElementTree result_tree):
427
427
        u"""tostring(self, result_tree)
438
438
    def __copy__(self):
439
439
        return _copyXSLT(self)
440
440
 
441
 
    def __call__(self, _input, *, profile_run=False, **_kw):
442
 
        u"""__call__(self, _input, profile_run=False, **_kw)
 
441
    def __call__(self, _input, *, profile_run=False, **kw):
 
442
        u"""__call__(self, _input, profile_run=False, **kw)
443
443
 
444
444
        Execute the XSL transformation on a tree or Element.
445
445
 
457
457
        cdef xslt.xsltTransformContext* transform_ctxt
458
458
        cdef xmlDoc* c_result
459
459
        cdef xmlDoc* c_doc
460
 
        cdef xmlNode* c_node
 
460
        cdef tree.xmlDict* c_dict
461
461
 
462
462
        input_doc = _documentOrRaise(_input)
463
463
        root_node = _rootNodeOrRaise(_input)
483
483
            transform_ctxt._private = <python.PyObject*>resolver_context
484
484
 
485
485
            c_result = self._run_transform(
486
 
                c_doc, _kw, context, transform_ctxt)
 
486
                c_doc, kw, context, transform_ctxt)
487
487
 
488
488
            if transform_ctxt.state != xslt.XSLT_STATE_OK:
489
489
                if c_result is not NULL:
533
533
 
534
534
        result_doc = _documentFactory(c_result, input_doc._parser)
535
535
 
536
 
        if not _checkThreadDict(c_result.dict):
537
 
            # fix document dictionary
538
 
            c_node = _findChildForwards(<xmlNode*>c_result, 0)
539
 
            if c_node is not NULL:
540
 
                __GLOBAL_PARSER_CONTEXT.initThreadDictRef(&c_result.dict)
541
 
                with nogil:
542
 
                    fixThreadDictNames(c_node, c_result.dict)
 
536
        c_dict = c_result.dict
 
537
        __GLOBAL_PARSER_CONTEXT.initThreadDictRef(&c_result.dict)
 
538
        if c_dict is not c_result.dict or \
 
539
                self._c_style.doc.dict is not c_result.dict or \
 
540
                input_doc._c_doc.dict is not c_result.dict:
 
541
            with nogil:
 
542
                if c_dict is not c_result.dict:
 
543
                    fixThreadDictNames(<xmlNode*>c_result,
 
544
                                       c_dict, c_result.dict)
 
545
                if self._c_style.doc.dict is not c_result.dict:
 
546
                    fixThreadDictNames(<xmlNode*>c_result,
 
547
                                       self._c_style.doc.dict, c_result.dict)
 
548
                if input_doc._c_doc.dict is not c_result.dict:
 
549
                    fixThreadDictNames(<xmlNode*>c_result,
 
550
                                       input_doc._c_doc.dict, c_result.dict)
543
551
 
544
552
        return _xsltResultTreeFactory(result_doc, self, profile_doc)
545
553