Open jeanpaulrehr opened 4 years ago
From our discussion in Slack:
@joewiz:
I just searched and found that I wrote something about this up in the eXist 4.7 era: https://github.com/eXist-db/exist/issues/2394 (it was actually related to a StackOverflow question @jeanpaulrehr asked). The util:serialize function was removed in Adam’s omnibus https://github.com/eXist-db/exist/pull/2603 PR.
@AdamRetter Were you aware that there are some eXist-specific serialization parameters that fn:serialize is not recognizing? Do you think we could hook fn:serialize back up to support those legacy parameters, or should util:serialize be restored solely to support these legacy serialization parameters?
@adamretter:
So I guess for fn:serialize we would have tried to follow the spec. It should probably be extended with the eXist options
From this I take it that the best way to resolve issue would be to extend fn:serialize with expand-xincludes
and possibly the other eXist options that were also cut off with the removal of util:serialize (comparing the serialization options listed in https://exist-db.org/exist/apps/doc/xquery#legacy-serialization to those in https://www.w3.org/TR/xslt-xquery-serialization-31/):
jsonp
highlight-matches
process-xsl-pi
add-exist-id
json-ignore-whitespace-text-nodes
According to the release notes for 5.0+ the function
util:serialize
has been removed in favour of the standardizedfn:serialize()
. With the removal of this function, the capacity to dynamically pass the serialization optionxinclude=false
has been lost.In theory one should then be able to configure Saxon to take the option (Adam Retter says should in this bug report).
The following is the configuration I tested between eXist and Saxon.
eXist's conf.xml:
Saxon's saxon-config.xml :
This configuration has no effect, although Saxon is definitely receiving the config file.
I posted the question over at Stack Overflow and Michael Kay responded:
The interesting point is that Kay states the expansion must be happening outside Saxon as it is switched off by default in Saxon.
Where is the switch for expansion?
-- test --
With the above eXist and Saxon configuration, put the attached two documents in the same directory, then execute this query:
--- Context --- Version eXist 5.2 (installed with tar) MacOS 10.14.6