Project

Profile

Help

Bug #4348

closed

SaxonC-1.2.0 for Python does not return expected attribute value

Added by Quick van Rijt about 5 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Normal
Category:
Python
Start date:
2019-10-18
Due date:
% Done:

100%

Estimated time:
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:
Found in version:
1.2.0
Fixed in version:
1.2.1
SaxonC Languages:
SaxonC Platforms:
SaxonC Architecture:

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'
Actions #1

Updated by Quick van Rijt about 5 years ago

(Running Python 3.8 on Windows 10)

Actions #2

Updated by O'Neil Delpratt about 5 years ago

  • 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.

Actions #3

Updated by O'Neil Delpratt about 5 years ago

  • 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.

Actions #4

Updated by O'Neil Delpratt about 5 years ago

  • 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

Actions #5

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

Also available in: Atom PDF