Forums » Saxon/C Help and Discussions »
Does SaxonC and PyXPathProcessor provide some API to evaluate XPath expressions and serialize the result according to serialization properties set with set_property
Added by Martin Honnen over 1 year ago
https://www.saxonica.com/saxon-c/doc12/html/saxonc.html#PyXPathProcessor-set_property says:
set_property(...)
set_property(self, name, value)
Set a property specific to the processor in use.
Args:
name (str): The name of the property
value (str): The value of the property
Example:
PyXPathProcessor: set serialization properties (names start with '!' i.e. name "!method" -> "xml")
'resources': directory to find Saxon data files,
's': source as file name,
'extc': Register native library to be used with extension functions
So to me "PyXPathProcessor: set serialization properties (names start with '!' i.e. name "!method" -> "xml")" suggests PyXPathProcessor does allow setting serialization properties to be applied when serializing XPath evaluation (results).
But is there any method where I can evaluate an XPath expression and serialize the result to a string? I only find https://www.saxonica.com/saxon-c/doc12/html/saxonc.html#PyXPathProcessor-evaluate and https://www.saxonica.com/saxon-c/doc12/html/saxonc.html#PyXPathProcessor-evaluate_single which return a PyXdmValue or a PyXdmItem but do not serialize to a file or string.
So why does the documentation of set_property
mention serialization properties, how/when would they be applied if set?
Replies (5)
Please register to reply
Does SaxonC and PyXPathProcessor provide some API to evaluate XPath expressions and serialize the result according to serialization properties set with set_property - Added by Norm Tovey-Walsh over 1 year ago
So why does the documentation of set_property mention serialization
properties, how/when would they be applied if set?
Hi Martin,
The best person to answer this question is going to be O’Neil, but he’s
on leave for a few days. Apologies for the delay.
Be seeing you,
norm
--
Norm Tovey-Walsh
Saxonica
RE: Does SaxonC and PyXPathProcessor provide some API to evaluate XPath expressions and serialize the result according to serialization properties set with set_property - Added by Martin Honnen over 1 year ago
Thanks for letting me know that O'Neil is on a leave.
I will wait for his return and response.
RE: Does SaxonC and PyXPathProcessor provide some API to evaluate XPath expressions and serialize the result according to serialization properties set with set_property - Added by Martin Honnen about 1 year ago
Hi,
O'Neil, now that you are back, any thoughts on this?
RE: Does SaxonC and PyXPathProcessor provide some API to evaluate XPath expressions and serialize the result according to serialization properties set with set_property - Added by O'Neil Delpratt about 1 year ago
It does look like the serialization of the result is missing. I will investigate this further.
RE: Does SaxonC and PyXPathProcessor provide some API to evaluate XPath expressions and serialize the result according to serialization properties set with set_property - Added by O'Neil Delpratt about 1 year ago
The setting of the serialization properties on the PyXPathProcessor is not supported. I will raise a bug against the documentation.
Please register to reply