Add scientific notation support to XPath number parser#692
Add scientific notation support to XPath number parser#692f-seoane wants to merge 1 commit intozeux:masterfrom
Conversation
- Extended xpath_lexer to recognize exponential notation (e/E with optional +/- sign) - Updated check_string_to_number_format() to validate scientific notation syntax - Handles formats like: 1.5e10, 3.14E-5, 2e+8, .5e3 - Added comprehensive test cases for scientific notation parsing Changes made in both lexer tokenization (for numbers starting with digits and with decimal point) and number validation to ensure proper parsing of scientific notation in XPath expressions.
|
pugixml implements XPath 1.0 as per W3C recommendation: https://www.w3.org/TR/1999/REC-xpath-19991116/ (the implementation is mostly complete, but has a couple namespace- and Unicode-related caveats, see https://pugixml.org/docs/manual.html#xpath.w3c) The specification is quite clear about the number format: neither lexing of XPath expressions, nor This was changed in XPath 2.0; however, pugixml doesn't support any XPath 2.0 features, doesn't plan to, and I would like to not have to consider individual XPath 2.0 features for inclusion - there's too many, and different people have different opinions on which features are important and which aren't. So I don't think I can merge this PR. If you need to use scientific notation with XPath 1.0 queries, depending on the use case there are some potential options:
|
|
Sure, that's fine |
Changes made in both lexer tokenization (for numbers starting with digits and with decimal point) and number validation to ensure proper parsing of scientific notation in XPath expressions.