Bug #4348
closed
SaxonC-1.2.0 for Python does not return expected attribute value
Fixed in Maintenance Release:
Description
Saxon/C 1.2.0 running with Saxon-HE 9.9.1.5J from Saxonica
Example script SaxonHEC1.2.0\Saxon.C.API\python-saxon\saxon_example.py
print('node.children[1].attributes[1].string_value =', attrs[1].string_value)
returns
"attr2='value2'"
while i expect
'value2'
(Running Python 3.8 on Windows 10)
- Project changed from Saxon to SaxonC
- Category set to Python
- Assignee set to O'Neil Delpratt
- Priority changed from Low to Normal
- Found in version set to 1.2.0
Thank you for reporting this bug issue, which we will investigate shortly.
- Status changed from New to In Progress
This is indeed a bug. The string_value
property should return the value for the attribute as the name
property only returns the attribute name.
We will investigate a fix for this.
- Status changed from In Progress to Resolved
- % Done changed from 0 to 100
Bug fixed in the string_value function. See it in the PyXdmNode class of the saxonc.pyx file.
The fix was to change to use the underlying getStringValue
method from the C++ API instead of the toString
method.
The following code:
print(attrs[1].string_value)
Returns:
value2
Where are:
print(attrs[1])
Returns:
att2="value2"
Fix committed to subversion and available in the next maintenance release.
You can try it before the next release by downloading file saxonc.pyx
- 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
Also available in: Atom
PDF