Commit Graph

13 Commits

Author SHA1 Message Date
sergei
8afc5b8ebf + Basic implementation of TXPathNSResolver class, Mantis .
git-svn-id: trunk@25814 -
2013-10-18 08:36:19 +00:00
sergei
22038d7db6 + XPath test suite, implemented possibility to use a specified context node instead of fixed root element.
* enabled expressions which start with a FilterNode.
+ added a test for ancestor:: axis of attribute.

git-svn-id: trunk@15650 -
2010-07-28 12:24:27 +00:00
sergei
5352b78c4a * XPath, fixed parsing of 'prefix:*' node tests:
o The prefix to resolve should not include following ':*' characters
  o NextToken changes CurTokenString, so NextToken must be after reading CurTokenString.
  o Added a test for that
* XPath test suite, fixed comparison of numeric result (it is quite tricky in presence of NaNs).

git-svn-id: trunk@15639 -
2010-07-26 16:35:35 +00:00
sergei
3bb9bfd2b8 * XPath, fixed parent axis of attribute nodes: it must consist of the owner element of an attribute.
+ Tests

git-svn-id: trunk@15439 -
2010-06-14 21:15:53 +00:00
sergei
1ed130e2e1 * Fixed XPath functions name() and local-name(), which should behave different from DOM properties of the same names. name() is empty for text, comment and document nodes. local-name() is the same as name() for non-prefixed attributes and processing instructions.
+ Another dozen of tests.

git-svn-id: trunk@15438 -
2010-06-14 17:21:35 +00:00
sergei
a283bc4f46 xpath.pp:
* Progress with namespace support. Resolve namespace prefixed while parsing, compare namespaceURI/localNames while evaluating. Existing tests for namespace-uri(), local-name() and name() now all pass, but resolving interface isn't ready for general use yet.
* Fixed name() to default to context node if argument is omitted.

xpathts.pp:
+ support for prefix resolving while testing.

git-svn-id: trunk@13846 -
2009-10-11 15:04:33 +00:00
sergei
a9d9841eee * XPath: number-to-string conversion is now compliant to the specs (no scientific notation, decimal separator is a hardcoded period, correct output values for INF/NAN) + tests.
git-svn-id: trunk@13389 -
2009-07-15 09:56:48 +00:00
sergei
106a605e05 xpath.pp:
- Removed (made abstract) default implementations of TXPathVariable.AsText(), AsNumber() and
  AsBoolean(). These methods are overriden by all TXPathVariable descendants, therefore in
  TXPathVariable itself they are dead and only increase executable size.
- Removed debug statement committed by accident in r13256.

tests/xpathts.pp:
* Annotated some tests, added a few tests for name(), namespace-uri() and local-name().

git-svn-id: trunk@13322 -
2009-06-24 19:16:33 +00:00
sergei
f31d31049e Improved XPath test suite and added some more tests.
git-svn-id: trunk@13260 -
2009-06-11 19:21:37 +00:00
sergei
8c898e963a + Implements XPath function id() + test. Running the test is another story, however, because it requires parsing FilterExpr+'/'+RelativeLocationPath, which is currently not implemented.
git-svn-id: trunk@13106 -
2009-05-06 20:07:09 +00:00
sergei
e17ac308e0 Implementation of XPath function lang() + tests.
git-svn-id: trunk@13060 -
2009-04-29 17:52:39 +00:00
sergei
b02aededf8 More progress with XPath:
src/xpath.pp:

+ Implemented sum() and normalize-space() core functions.
* Rewrote comparison code, nodesets are now handled correctly (to the
  extent of the tests which I could find).
* starts-with() and contains() return True when second argument is an
  empty string - that differs from Pos() behavior.
* NaNs are propagated through mod operator, floor() and ceiling().
* Fixed memory leak caused by not releasing arguments after function
  calls.
* string-value of a nodeset is the value of its first node, not all
  nodes glued together.

tests/xpathts.pp:

+ Added 120 tests, most coming from OASIS Prototype XSLT/XPath 1.0
  conformance test suite.
+ Tests can now take an input xml data as a string.

git-svn-id: trunk@13046 -
2009-04-26 16:06:15 +00:00
michael
f641281a7e * Patch from Sergei Gorelkin:
+ added TXPathBinaryNode as a common ancestor for binary operations;
  + TXPathBooleanOpNode now handles only 'and' and 'or' operators,
    the purpose is to not evaluate the second argument if the result can
    be determined by the first argument;
  * Comparison operations moved to TXPathCompareNode and fixed
    to support INFs and NANs correctly;
  * Fixed TranslateWideString() that was not deleting characters;
  * Fixed 'substring-after' function so its result is empty when argument
    string does not contain the pattern;
  * Fixed 'round' funcion so it complies to the specs;
  * Completed implementation of 'substring' function (but surrogate pairs
    are not handled yet);
  * Mask exInvalidOp and exZeroDivide FPU exceptions while evaluating
    expressions, this ensures correct calculations with respect to INFs
    and NANs.
  + Added testsuite for xpath

git-svn-id: trunk@12961 -
2009-03-23 08:37:51 +00:00