1. 03 Feb, 2017 1 commit
  2. 21 Jun, 2016 2 commits
    • Nick Wellnhofer's avatar
      Consolidate recursion checks · 1c8e0e55
      Nick Wellnhofer authored
      Move the check for potentially infinite recursion to
      xsltApplySequenceConstructor. In this function, both template and
      func:function calls can be handled. This also checks for the following
      case of infinite recursion in attribute sets found with afl-fuzz:
      
      <x:attribute-set name="set">
          <x:attribute name="attr">
              <elem x:use-attribute-sets="set"/>
          </x:attribute>
      </x:attribute-set>
      
      Rename funcLevel to depth and check against maxTemplateDepth. I hope it
      isn't a problem to rename an internal struct item.
      1c8e0e55
    • Nick Wellnhofer's avatar
      Rewrite memory management of local RVTs · 470b1734
      Nick Wellnhofer authored
      The psvi slot of RVTs documents is used to store ownership information.
      
      XSLT_RVT_LOCAL for RVTs that are destroyed after the current instructions
      ends.
      
      XSLT_RVT_VARIABLE for RVTs that are part of a local variable and are
      destroyed after the variable goes out of scope.
      
      XSLT_RVT_FUNC_RESULT for RVTs that are part of results returned with
      func:result. These RVTs won't be destroyed after exiting a template and
      will be reset to XSLT_RVT_LOCAL or XSLT_RVT_VARIABLE in the template
      that receives the return value.
      
      XSLT_RVT_GLOBAL for RVTs that are part of a global variable.
      
      The function xsltFlagRVTs is used for the following ownership
      transitions:
      
      - LOCAL or VARIABLE to FUNC_RESULT when returning a value with
        func:result.
      - FUNC_RESULT to LOCAL or VARIABLE when receiving a func:result.
      - LOCAL to GLOBAL after evaluating global variables or parameters.
      
      This obsoletes the element localRVTBase in the context struct and the
      xsltExtensionInstructionResultRegister function. Aside from the
      func:result implementation, the only reason for the old mechanism was
      to protect RVTs (which can only be returned from extension functions)
      in global variables from being destroyed too early. This is done
      automatically now, so there's no need for extension authors to call
      this function anymore.
      
      The function xsltExtensionInstructionResultFinalize is unsupported
      now. To the best of my knowledge, it isn't used outside of libxslt.
      
      Another benefit is that, in some cases, RVTs are freed earlier now.
      
      Also fixes bug #602531.
      470b1734
  3. 14 Sep, 2015 1 commit
  4. 12 Sep, 2012 2 commits
  5. 16 Aug, 2012 1 commit
  6. 20 Mar, 2012 1 commit
  7. 12 Apr, 2010 1 commit
    • Stefan Kost's avatar
      profiling: add callgraph report · 193322ac
      Stefan Kost authored
      This patch also tracks who called a template and how often. Based on that the
      output of xsltproc --profile now also contains a gprof alike callgraph. If available
      posix monotonic clocks are the preferred way to get timestamps.
      193322ac
  8. 17 Sep, 2009 1 commit
    • Daniel Veillard's avatar
      Detect deep recusion on function calls · 3058d809
      Daniel Veillard authored
      * libxslt/xsltInternals.h libexslt/functions.c: add a function call
        counting in the transformation context, and test/increment/decrement
        in exsltFuncFunctionFunction enter and exit
      3058d809
  9. 16 Sep, 2009 1 commit
    • Daniel Veillard's avatar
      Add API versioning and various cleanups · 482e7b7e
      Daniel Veillard authored
      * doc/symbols.xml doc/syms.xsl doc/checkapisym.xsl libxslt/libxslt.syms:
        the new symbol files, checking and stylesheets, based on libxml2 ones
      * configure.in doc/Makefile.am libxslt/Makefile.am: modifications needed
        to activate the symbol versioning
      * doc/libxslt-api.xml doc/libxslt-refs.xml doc/EXSLT/libexslt-api.xml
        doc/EXSLT/libexslt-refs.xml: regenerated
      * libexslt/crypto.c libxslt/Makefile.am libxslt/keys.c libxslt/variables.c
        libxslt/xslt.c libxslt/xsltInternals.h libxslt/xsltlocale.c
        libxslt/xsltlocale.h: various cleanups
      482e7b7e
  10. 03 Jun, 2008 1 commit
    • Daniel Veillard's avatar
      patch from Nick Wellnhofer adding xsl:sort lang support using the locale · 1a8e9f9e
      Daniel Veillard authored
      * configure.in libxslt/extra.c libxslt/Makefile.am libxslt/preproc.c
        libxslt/xsltInternals.h libxslt/xsltlocale.c libxslt/xsltlocale.h
        libxslt/xsltutils.c win32/Makefile.mingw win32/Makefile.msvc: patch
        from Nick Wellnhofer adding xsl:sort lang support using the locale
        support from the C library.
      Daniel
      
      svn path=/trunk/; revision=1476
      1a8e9f9e
  11. 09 May, 2008 1 commit
    • Daniel Veillard's avatar
      fix the key initialization problem introduced when tracking Josef Urban · 2fafb8f6
      Daniel Veillard authored
      * libxslt/documents.c libxslt/keys.c libxslt/xsltInternals.h
        libxslt/transform.c libxslt/pattern.c: fix the key initialization
        problem introduced when tracking Josef Urban problem from 22 Dec
        2007, this should also handle the problem of recursive keys
        definitions should fix #531873.
      * tests/docs/bug-166.xml tests/docs/Makefile.am
        tests/general/Makefile.am tests/general/bug-166.xsl
        tests/general/bug-166.out: add the regression tests when a key
        computation depends on another one.
      Daniel
      
      svn path=/trunk/; revision=1471
      2fafb8f6
  12. 14 Apr, 2008 1 commit
  13. 24 Dec, 2007 1 commit
  14. 11 Jan, 2007 1 commit
    • William M. Brack's avatar
      added new function replace from Joel Reed. added new test case for above. · 40e7c29b
      William M. Brack authored
              * libexslt/strings.c: added new function replace from Joel
                Reed.
              * tests/exslt/Makefile.am, replace.1.xml, replace.1.xsl,
                replace.1.out: added new test case for above.
              * libxslt.spec.in: trivial change from Gnome to GNOME
              * configure.in: trivial change for flags on my compilations
              * libxslt/documents.c, libxslt/documents.h, libxslt/keys.c,
                libxslt/keys.h, libxslt/variables.c, libxslt/templates.c,
                libxslt/transform.c, libxslt/variables.c, libxslt/xslt.c,
                libxslt/xsltutils.c: fixed some documentation/comments and
                compilation warnings - no change to logic.
              * re-generated the documentation.
      
      svn path=/trunk/; revision=1413
      40e7c29b
  15. 26 Oct, 2006 1 commit
  16. 10 Aug, 2006 1 commit
  17. 09 Aug, 2006 1 commit
  18. 14 Jul, 2006 2 commits
    • Kasimier T. Buchcik's avatar
      Committing again, since I forgot to switch from win to linux linebreaks in · 7662584e
      Kasimier T. Buchcik authored
      * libxslt/attributes.c libxslt/documents.c
        libxslt/functions.c libxslt/keys.c libxslt/namespaces.c
        libxslt/pattern.c libxslt/preproc.c libxslt/templates.c
        libxslt/templates.h libxslt/transform.c
        libxslt/variables.c libxslt/xslt.c
        libxslt/xsltInternals.h libxslt/xsltutils.c
        libxslt/xsltutils.h libexslt/common.c libexslt/dynamic.c
        libexslt/functions.c libexslt/strings.c:
        Committing again, since I forgot to switch from win to linux
        linebreaks in the files.
      7662584e
    • Kasimier T. Buchcik's avatar
      Refactored xsltValueOf(). Changed to use xmlXPathCastToString() directly, · 90d2d1c2
      Kasimier T. Buchcik authored
      * libxslt/attributes.c libxslt/documents.c
        libxslt/functions.c libxslt/keys.c libxslt/namespaces.c
        libxslt/pattern.c libxslt/preproc.c libxslt/templates.c
        libxslt/templates.h libxslt/transform.c libxslt/variables.c
        libxslt/xslt.c libxslt/xsltInternals.h libxslt/xsltutils.c
        libxslt/xsltutils.h libexslt/common.c libexslt/dynamic.c
        libexslt/functions.c libexslt/strings.c:
        Refactored xsltValueOf(). Changed to use xmlXPathCastToString()
        directly, rather than creating an intermediate object with
        xmlXPathConvertString(). This now does not add a text-node to
        the result if the string is empty (this has impact on
        serialization, since an empty text-node is serialized as
        <foo></foo>, and now it will be serialized as <foo/>).
        Refactored other functions in transform.c:
        Mostly code cleanup/restructuring. Minimized number of
        function variables for instruction which eat up function stack
        memory when recursing templates (xsltIf(), xsltChoose(),
        xsltApplyTemplates(),  xsltCallTemplate()).
        Changed XSLT tests to use xmlXPathCompiledEvalToBoolean().
        Implemented redefinition checks at compilation-time and
        eliminating them at transformation time in the refactored code
        paths.
        Introduced the field @currentTemplateRule on xsltTransformContext to
        reflect the "Current Template Rule" as defined by the spec.
        NOTE that ctxt->currentTemplateRule and ctxt->templ is not the
        same; the former is the "Current Template Rule" as defined by the
        XSLT spec, the latter is simply the template struct being
        currently processed by Libxslt.
        Added XML_COMMENT_NODE and XML_CDATA_SECTION_NODE to the macro
        IS_XSLT_REAL_NODE.
        Misc code cleanup/restructuring and everything else I already forgot.
        Refactored lifetime of temporary result tree fragments.
        Substituted all calls to the now deprecated xsltRegisterTmpRVT()
        for the new xsltRegisterLocalRVT().
        Fragments of xsl:variable and xsl:param are freed when the
        variable/pram is freed.
        Fragments created when evaluating a "select" of xsl:varible and
        xsl:param are also bound to the lifetime of the var/param.
        EXSLT's func:function now uses the following functions to let take
        care the transformation's garbage collector of returned tree
        fragments:
          xsltExtensionInstructionResultRegister(),
          xsltExtensionInstructionResultFinalize()
        Fixes:
        #339222 - xsl:param at invalid position inside an xsl:template is
                  not catched
        #346015 - Non-declared caller-parameters are accepted
        #160400 - Compiles invalid XSLT; unbound variable accepted
        #308441 - namespaced parameters become unregistered
        #307103 - problem with proximity position in predicates of match
                  patterns
        #328218 - problem with exsl:node-set() when converting strings
                  to node sets
        #318088 - infinite recursion detection
        #321505 - Multiple contiguous CDATA in output
        #334493 - "--param" option does not have root context
        #114377 - weird func:result/xsl:variable/exsl:node-set interaction
        #150309 - Regression caused by fix for 142768
      90d2d1c2
  19. 19 Jun, 2006 1 commit
    • Kasimier T. Buchcik's avatar
      Merged all the namespace lookup/create/disable functions into · c09974f8
      Kasimier T. Buchcik authored
      * libxslt/attributes.c libxslt/attrvt.c libxslt/namespaces.c
        libxslt/namespaces.h libxslt/preproc.c libxslt/templates.c
        libxslt/transform.c libxslt/variables.c libxslt/xslt.c
        libxslt/xsltInternals.h libxslt/xsltutils.c:
        Merged all the namespace lookup/create/disable functions
        into xsltGetSpecialNamespace(). Changed xsltGetNamespace()
        and xsltGetPlainNamespace() to call xsltGetSpecialNamespace(),
        but kept the ns-aliasing mechanism; the ns-aliasing needs
        to be removed when we move to the refactored code, which
        applies ns-alias only at compilaton time.
        Refactored xsltElementComp() (preproc.c); enhanced error reports.
        Fixed: if the "namespace" attribute was not given, then this
        performed incorrectly only a lookup for a default namespace;
        i.e., without taking any prefix on the "name" attribute into
        account.
        Refactored xsltElement() (transform.c); enhanced error reports.
        Refactored xsltAttributeComp() (preproc.c). Added namespace
        lookup as in xsltElementComp(). Enhanced error reports.
        Refactored xsltAttribute() (transform.c); enhanced error reports.
        xsltCopyTreeInternal(): eliminated the need to call xmlGetNsList()
        for every element in the tree; this needs to be done only for
        the top-most elements. For subsequent elements reconcile only
        the ns-declarations. Disallowed setting of ns-declarations if
        children have been already added to an element.
        Removed ns-aliasing code where necessary.
        xsltCopyProp(): disallowed setting of attribute nodes if
        children have been already added to an element.
        xsltCopy(): removed the incorrect skipping of attributes in the
        XSLT namespace. Removed the incorrect ns-aliasing for attributes.
        Changed to use the introduced function xsltShallowCopyAttr().
        xsltShallowCopyAttr():  Centralized all attribute-copy related
        code in this function. It will now be called by
        xsltCopyTreeInternal(), xsltCopyOf() and xsltCopy().
        xsltCopyAttrListNoOverwrite(): Renamed. Refactored. Optimized to
        use xsltGetSpecialNamespace() and xmlNewDocProp().
        Further substitution of various scattered namespace-lookup
        related code for the use of xsltGetSpecialNamespace().
        xsltAttrTemplateProcess(): Refactored. Removed the incorrect
        processing of attribute-sets. Attribute sets need to be applied
        before adding any normal attribute of the literal result element;
        this is now done in  xsltAttrListTemplateProcess(). Fixed to
        ensure that the ns-prefix of the overwriting attribute is used.
        xsltAttrListTemplateProcess(): Refactored. Moved semantics from
        xsltAttrTemplateProcess() over to this function in order to
        optimize processing of multiple attributes. This does not call
        xsltAttrTemplateProcess() anymore.
        Fixed: do not exclude the XSLT namespace after ns-aliasing have
        beed applied.
        The IFDEFed-out refactored code fixes the following issues:
        - #313711: namespace collision with namespace-alias (reported
                    by by Oleg Paraschenko)
        - #338214: Incorrect scope for exclude-result-prefixes
        - #341392: Excluding namespace declarations of literal result
                   elements.
        - #341325: Namespace aliasing and resulting namespace prefixes
        Already enabled fixes:
        - #344183: xsl:copy misses to copy attributes in the XSLT namespace
        - #341463: Namespace-alias using #default for result-prefix with no
        	     default namespace in scope
        - #313890: namespace collision with xsl:element and xsl:attribute,
        	     reported by Oleg Paraschenko
        - #344176: xsl:copy misses to set an element's namespace-URI in
                   some cases
        - #305739: the "name" QName of xsl:element is incorrectly always
        	     resolved to the default namespace
      c09974f8
  20. 22 May, 2006 1 commit
    • Kasimier T. Buchcik's avatar
      Next tiny step of refactoring - mostly bug fixes and cosmetic changes. · c43f2625
      Kasimier T. Buchcik authored
      * libxslt/attributes.c libxslt/documents.c
        libxslt/extensions.c libxslt/keys.c libxslt/pattern.c
        libxslt/preproc.c libxslt/templates.c
        libxslt/transform.c libxslt/variables.c
        libxslt/xslt.c libxslt/xsltInternals.h:
        Next tiny step of refactoring - mostly bug fixes and
        cosmetic changes.
        Changes outside of the refactored code:
        1) Optimized xsl:attribute if the content consists of
         just 1 text node.
        2) Optimized computation of xsl:key. The keys will now be
         computed for a specific document not until the first call
         of a key() function; here only the keys with the specific
         name used by key() are computed. This means that this
         now avoids computation of all keys for all loaded
         input documents (even if no key() was called on them).
         One exception is the scenario where a key() is used in
         a template's match pattern; in this case all keys are
         computed for a document if there's a chance that
         a "keyed" template could match a node (this could still
         be optimized a bit).
      c43f2625
  21. 12 May, 2006 1 commit
    • Kasimier T. Buchcik's avatar
      Next step of refactoring. For more details see bug #341588. I applied the · 76ccb300
      Kasimier T. Buchcik authored
      * libxslt/documents.c libxslt/namespaces.c
        libxslt/preproc.c libxslt/transform.c
        libxslt/xslt.c libxslt/xsltInternals.h libxslt/xsltutils.c:
        Next step of refactoring. For more details see bug #341588.
        I applied the suggestion of Jerome Pesenti to the refactored
        (still IDFEDed out with XSLT_REFACTORED) code: The XPath
        compilation context (accessible via the compilation context)
        is now reused for compilation of expressions at
        compilation-time; this should reduce compilation time to 50%
        for avarage stylesheets.
      76ccb300
  22. 05 May, 2006 1 commit
    • Kasimier T. Buchcik's avatar
      Next step of refactoring (plus some bug-fixes). For more details see · eb037ebd
      Kasimier T. Buchcik authored
      * libxslt/xsltInternals.h libxslt/attributes.c
        libxslt/documents.c libxslt/extensions.c
        libxslt/extensions.h libxslt/functions.c
        libxslt/imports.c libxslt/keys.c libxslt/preproc.c
        libxslt/transform.c libxslt/variables.c libxslt/xslt.c
        libxslt/xsltutils.c libxslt/xsltutils.h libexslt/functions.c:
        Next step of refactoring (plus some bug-fixes).
        For more details see #340780.
      eb037ebd
  23. 12 Apr, 2006 1 commit
    • Kasimier T. Buchcik's avatar
      Refactored the internal structures into specialized structures and · c809be06
      Kasimier T. Buchcik authored
      * libxslt/attributes.c libxslt/preproc.c libxslt/transform.c
        libxslt/variables.c libxslt/xslt.c libxslt/xsltInternals.h
        libxslt/xsltutils.c libxslt/xsltutils.h:
        Refactored the internal structures into specialized
        structures and adjusted the code to work with those new
        structures. I didn't yet (we should in the future)
        renamed any fields of the old structures in order to avoid
        changing too much code.
        Introduced the internal structure xsltCompilerCtxt to be
        used for storage and control of the compilation.
        Optimized the way lists of in-scope namespaces are created
        and stored; this will now only generate a new list if
        really needed, i.e. if we encounter a ns-decl.
        All this changes here are IFDEFed out with XSLT_REFACTORED.
      c809be06
  24. 21 Feb, 2006 1 commit
  25. 29 Mar, 2005 1 commit
  26. 13 Mar, 2005 1 commit
    • Daniel Veillard's avatar
      preparing 1.1.13, updated and rebuilt the docs. trying to fix some build · 91cf35d8
      Daniel Veillard authored
      * NEWS configure.in doc/*: preparing 1.1.13, updated and rebuilt
        the docs.
      * tests/plugins/Makefile.am xsltproc/Makefile.am: trying to fix
        some build problems.
      * libxslt.spec.in: adding a build require and a require for
        libgcrypt-devel, c.f. Red Hat bug #133211
      * libxslt/xsltInternals.h: as for libxml2, XML_CAST_FPTR was wrong.
      Daniel
      91cf35d8
  27. 22 Jan, 2005 2 commits
    • Daniel Veillard's avatar
      chasing xmlStrEqual calls and removed them when comparing mode and modeURI · fd8561c2
      Daniel Veillard authored
      * libxslt/pattern.c libxslt/preproc.c libxslt/templates.c
        libxslt/xslt.c libxslt/xsltInternals.h: chasing xmlStrEqual
        calls and removed them when comparing mode and modeURI for
        templates by interning those strings when compiling the
        stylesheets.
      Daniel
      fd8561c2
    • Daniel Veillard's avatar
      when copying text nodes in elements or attributes to the output, if · cd972e04
      Daniel Veillard authored
      * libxslt/templates.c libxslt/transform.c libxslt/xslt.c
        libxslt/xsltInternals.h: when copying text nodes in elements
        or attributes to the output, if interning, then reuse the strings
        directly without copying them in the output tree if dicts are
        shared between the context and the output docs. Less allocations
        smaller output document and no copying involved anymore.
      Daniel
      cd972e04
  28. 01 Dec, 2004 1 commit
    • William M. Brack's avatar
      minor changes to get rid of gcc warnings, especially on 64-bit system. · 88355389
      William M. Brack authored
      * libxslt/extensions.c, libxslt/functions.c, libxslt/numbers.c,
        libxslt/pattern.c, libxslt/transform.c, libxslt/xslt.c,
        libxslt/xsltInternals.h: minor changes to get rid of gcc
        warnings, especially on 64-bit system. Implemented
        XML_CAST_FPTR macro to cast between function pointer <->
        object pointer while avoiding gcc warnings (a hack).
        No change to the logic.
      88355389
  29. 25 Nov, 2004 1 commit
  30. 24 Nov, 2004 1 commit
  31. 06 Sep, 2004 1 commit
  32. 15 Aug, 2004 1 commit
  33. 16 Feb, 2004 1 commit
  34. 13 Feb, 2004 1 commit
    • Daniel Veillard's avatar
      added new code to handle attribute value templates also a lot of work to · 50b5fc7b
      Daniel Veillard authored
      * libxslt/attrvt.c libxslt/Makefile.am: added new code to handle
        attribute value templates
      * libxslt/*.c libxslt/*.h: also a lot of work to reuse the
        dictionaries at the stylesheet and transformation level.
      * configure.in: this relies on a recent version of libxml2
        with the sub dictionnary catalog.
      Daniel
      50b5fc7b
  35. 21 Dec, 2003 1 commit
  36. 01 Dec, 2003 1 commit