Skip to content
  1. Dec 07, 2008
  2. May 16, 2008
  3. Apr 27, 2008
  4. Mar 24, 2008
    • David Lichteblau's avatar
      Added XPATH-PROTOCOL:NODE-EQUAL and HASH-KEY · af16503a
      David Lichteblau authored
      Use XPATH-PROTOCOL:NODE-EQUAL rather than EQ/EQL on nodes.  Use HASH-KEY
      with an EQUAL hash table instead of nodes in an EQL hash table.
      
      This change is motivated by the DOM-NAMESPACE and STP-NAMESPACE objects,
      which are consed up every time they are queried, yet need to be compared
      later.  The alternative solutions would have been
        - caching of those objects in DOM, which requires changes to the DOM
          implementation
        - force use of a navigator for STP and DOM (awkward)
      Simply allowing duplicate nodes seems easier.
      
      darcs-hash:b0ccd40b33df1274fccb89650090ff5340d9276b
      af16503a
  5. Mar 02, 2008
  6. Mar 01, 2008
    • Ivan Shvedunov's avatar
      Fixed some bugs, added some missing features. · 1a1c6bbc
      Ivan Shvedunov authored
      Fixed xnum parsing / unparsing.
      Fixed comparison operators.
      Added lang() function.
      Node sets returned by EVALUATE and EVALUATE-COMPILED now are automatically sorted
      using document order by default.
      Fixed following:: axis (again).
      Fixed NODE-TEST-NAME for namespace nodes.
      Numbers in XPath expressions are now never parsed into SINGLE-FLOAT.
      Added SORT-NODE-SET function.
      
      darcs-hash:f11136c9917dee6bd41d96f3e8950db389c78b55
      1a1c6bbc
  7. Feb 28, 2008
  8. Feb 27, 2008
    • Ivan Shvedunov's avatar
      XPATH-SYS package, documentation, misc changes. · 0c1621cf
      Ivan Shvedunov authored
      Added atdoc documentation templates (mostly copied from Xuriella).
      Renamed xpath-protocol:string-value to xpath-protocol:node-text.
      Added xpath-protocol:node-text method for namespace nodes.
      Added list->node-set function (a simpler version of xpath-sys:make-node-set).
      
      darcs-hash:5157e09c5e43012d65211d1fb22d6b544a75ee54
      0c1621cf
  9. Feb 25, 2008
    • Ivan Shvedunov's avatar
      Important fixes & some new features. · cb747fe2
      Ivan Shvedunov authored
      Fixed :following, :preceding-sibling, :following-sibling and :namespace axes.
      Fixed contains() (what a shame! I made a mistake in the order of arguments).
      Fixed translate().
      Added get-node-id() and plx:generate-id() (same as generate-id() in XSLT).
      Added checks for number of arguments passed to XPath functions.
      Fixed a package-related problem in define-xpath-function/single-type.
      Fixed xnum-round.
      
      darcs-hash:f3bff21d76ef40b125506213bf44f04efd054b8d
      cb747fe2
  10. Feb 24, 2008
  11. Feb 20, 2008
  12. Feb 10, 2008
  13. Dec 30, 2007
  14. Dec 20, 2007
    • david's avatar
      Replaced the compiler macro with an ordinary one. · 40d4817c
      david authored
      Always require the second argument to COMPILE-XPATH.  We cannot see lexical
      bindings in this function.
      
      Replaced the function EVALUATE with EVALUATE-THUNK, which always takes a
      closure as an argument, never a string or sexp.  (EVALUATE-THUNK is just
      a working title for this function, perhaps a better name can be found.)
      
      New macro EVALUATE, replacing the compiler macro.
      
      Removed *LEXICAL-NAMESPACES* and *LEXICAL-VARIABLES*.
        - don't bind *LEXICAL-NAMESPACES* in WITH-NAMESPACES
        - don't bind *LEXICAL-VARIABLES* in WITH-VARIABLES
      
      Export EVALUATE-THUNK from the package in addition to EVALUATE.
      
      Added a test checking that the empty namespace can be used without
      having to use WITH-NAMESPACES.
      
      Removed the call to STRING in TEST-FILTERING.  (fixme?)
      
      darcs-hash:55b42a4c50757f63616b05dccca0cac08aa84fb4
      40d4817c
  15. Dec 08, 2007
    • david's avatar
      Added an XPATH-ERROR condition class. · 7b539b0f
      david authored
      Helper function of the same name to signal this error.
      
      Exported XPATH-ERROR.
      
      Added another workaround for the non-error condition that parse-number
      signals.
      
      darcs-hash:868c30fb0b1fd42c9c394405fac7c9cacab3a832
      7b539b0f
  16. Dec 05, 2007
  17. Dec 04, 2007
    • Ivan Shvedunov's avatar
      Fixed filtering and following axis · f5dad9b2
      Ivan Shvedunov authored
      darcs-hash:ed5d82a8ecee6fa2ff9f226148004c797a858445
      f5dad9b2
    • Ivan Shvedunov's avatar
      Node set iteration/mapping API updated. · 4619a373
      Ivan Shvedunov authored
      Fixed:
        map-node-set
        do-node-set
      
      Added node set iterators:
        make-node-set-iterator
        node-set-iterator-end-p
        node-set-iterator-next
        node-set-iterator-current
      
      Exported:
        node-set-p
      
      Added test for empty node sets:
        node-set-empty-p
      
      darcs-hash:9e84b4035564a382ee3af2e16316bd1bb8854ab8
      4619a373
  18. Dec 02, 2007
    • david's avatar
      Fixed the empty namespace in with-namespaces. · 073850f8
      david authored
      ... allow both NIL and "" for the empty prefix.
      
      ... normalize to NIL
      
      darcs-hash:819b651322611ac596ef0d803fa0e652cd79384e
      073850f8
    • david's avatar
      * Reworked variable handling. · ee9a88b7
      david authored
        Reverted CONTEXT-VARIABLE-VALUE.
      
        Renamed ENVIRONMENT-VALIDATE-VARIABLE to ENVIRONMENT-FIND-VARIABLE,
        which now returns a closure rather than just a boolean.
      
        New exported macro WITH-VARIABLES for the LEXICAL-ENVIRONMENT.
        (And tests for that.)
      
      darcs-hash:4bf3773ca6bd46e449833192b823a08f248a9175
      ee9a88b7
  19. Dec 01, 2007
    • Ivan Shvedunov's avatar
      Some missing XPath funcs, code reorganization and minor bugfixes. · 54694b95
      Ivan Shvedunov authored
      Moved XPath parser to parser.lisp.
      
      Moved some of toplevel API to api.lisp.
      
      Added MAP-NODE-SET and DO-NODE-SET.
      
      Added proper unary minus handling.
      
      Added test cases for string representation of XPath in TEST-XPATH
      (previously TEST-XPATH/UNABBREVIATED).
      
      Made it possible to pass strings to compile-xpath.
      STRING-VALUE, NUMBER-VALUE, BOOLEAN-VALUE and NODE-SET-VALUE now can handle single nodes.
      Added XPATH-PROTOCOL:NODE-P.
      
      Compiler macro for EVALUATE now issues warning instead of error if EVALUATE
      is used outside lexical scope of (WITH-NAMESPACES (...) ...)
      
      Added some of missing XPath functions - substring(), true(), false(),
      boolean(), number()
      
      darcs-hash:973601a675f33d9ebcd85ef89b6270e702fbaa1d
      54694b95
  20. Nov 25, 2007
    • david's avatar
      new exported functions EVALUATE, FIRST-NODE, ALL-NODES · 3eea15e3
      david authored
      A new function EVALUATE is provided that...
        - automatically parses XPath strings.
        - also accepts sexps in the syntax (xpath (sexp-goes-here)).  (The special
          marker XPATH in the CAR is needed to distinguish literal strings from XPath
          strings.)
        - and accepts pre-compiled closures.  Users who want to use this function
          with a customized environment must pass precompiled closures.
      
      For the first two cases, the environment is defined lexically using the
      new macro WITH-NAMESPACES.
      
      The context argument to ALL-NODES can be either...
        - an actual context
        - or any other node understood by the XPath protocol, and will then
          be turned into a trivial context automatically
      
      A compiler macro on EVALUATE allows pre-compilation of closures at fasl
      load time.  (Macrolet tricks propagate the information from WITH-NAMESPACES
      into the compiler macro.  Thanks to chandler on #lisp for the tip.)
      
      darcs-hash:88c7a7985b99372e14071fb9eb8da0bc97d0b054
      3eea15e3
    • david's avatar
      new package XPATH-PROTOCOL; STP support; tests run again · ef46381f
      david authored
      darcs-hash:2d8860ef9e911e6597859b4fa6ea89a4138523bc
      ef46381f
    • david's avatar
      applied parse-xpath-3.diff: · 738a5991
      david authored
      functions.lisp
              - new function XPATH:UNION for the | operator
                (not a keyword because not technically an XPath function)
      
      lexer.lisp
      	Lots of fixes.
      
      node-tests.lisp
      	- NODE-TEST-NAME
      	  Added the namespace URI as an optional second argument.
      	- NODE-TEST-NAMESPACE
      	  New, checks only the namespace and not the local name.
      	- NODE-TEST-PROCESSING-INSTRUCTION
      	  Added the name to check as an optional argument.
      
      types.lisp
      	- CONTEXT-VARIABLE-VALUE
      	  New generic function looking up variable values during
      	  evaluation.
      	- ENVIRONMENT
      	  New struct, basically a compilation-time context.
      	- ENVIRONMENT-FIND-NAMESPACE
      	  New generic function for prefix -> uri lookups
      	- ENVIRONMENT-FIND-FUNCTION
      	  New generic function for (local-name uri) -> function lookups.
      	- ENVIRONMENT-VALIDATE-VARIABLE
      	  New generic function that returns true if the variable is
      	  declared.
      	- TEST-ENVIRONMENT
      	  An environment that pretends to know about every namespace,
      	  function, and variable. For use only in parser tests.
      
      xpath.lisp
      
      	- MAKE-LOCATION-STEP
      	  Now accepts the list of predicates instead of just one
      	  predicate.
      	- COMPILE-PREDICATES
      	  helper function for make-location-step
       	- DECODE-QNAME, FIND-NAMESPACE
      	  New
      	- COMPILE-XPATH
      	    * New second argument `environment'.
      	    * For function calls, check if the function name is a string
      	      rather than a symbol, and if so, look it up in the enviroment.
      	    * New: variables
      	    * New: filters
      	- COMPILE-VARIABLE
      	  New
      	- COMPILE-NODE-TEST
      	  Split qnames.  And allow lists as node-tests to handle
      	  :namespace, named :processing-instruction, and pre-parsed :qname
      	- COMPILE-LOCATION-STEP
      	    * New second argument `environment'.
      	    * Accept multiple predicates.
      	- COMPILE-PATH
      	  New second argument `environment'.
      	- COMPILE-FILTER-PATH
      	  New
      
      axis.lisp
      	- new axis :namespace
      	- new axis :following-sibling
      	- new axis :preceding-sibling
      	- new axis :following
      	- new axis :preceding
      	- new axis :ancestor-or-self
      	and
      	- pseudo axis :root  -- FIXME: is this right?
      
      darcs-hash:828be75c0208ef166e480cfe33eb83b3ac57f285
      738a5991
    • david's avatar
      Ivan Shvedunov's XPath implementation · 1ed90069
      david authored
      darcs-hash:b96e13c8d54121d1fbfffc220ff442053e425942
      1ed90069