Bug #4356
closedXPathProcessor missing methods
100%
Description
Following the bug issue #4351 it has showed up that the XPathProcessor is missing some other key methods which would make it work in similar way as the XPathCompiler on Java:
- setAllowUndeclaredVariables
- declareVariable (already discussed in bug issue #4351 )
- declareVariable(QName qname, ItemType itemType, OccurrenceIndicator occurrences)
- setCaching
- importSchemaNamespace(String uri)
Related issues
Updated by O'Neil Delpratt about 5 years ago
- Status changed from New to In Progress
Added methods in the APIs: C++, PHP and Python. Available for the next maintenance release
Adding unit tests.
Updated by O'Neil Delpratt about 5 years ago
- Status changed from In Progress to Resolved
- % Done changed from 0 to 100
Given that we are supporting languages that are not strongly typed we have decided to automatically set the setAllowUndeclaredVariables(true)
upon creation of the XPathProcessor. Therefore we don't need to make available the methods declareVariable
and setAllowUndeclaredVariable
in C++, PHP and Python. If a variable is used but not set a error will occur.
Added unit tests.
Updated by O'Neil Delpratt about 5 years ago
- Related to Bug #4351: set_parameter failing under PyXPathProcessor added
Updated by O'Neil Delpratt about 5 years ago
As a result the following sample test case will work:
def test_declare_variable_value(saxonproc):
s1 = 'This is a test.'
xdm_string_value = saxonproc.make_string_value(s1)
xpath_processor = saxonproc.new_xpath_processor()
xpath_processor.set_parameter('s1', xdm_string_value)
result = xpath_processor.evaluate('$s1')
assert result is not None
assert 'test.' in result.head.string_value
Updated by O'Neil Delpratt about 5 years ago
- Status changed from Resolved to Closed
- Fixed in version set to 1.2.1
Bug fix applied in the Saxon/C maintenance release 1.2.1
Please register to edit this issue