Inconsistant behaviour when dealing with text() between different environments
Added by Maria Wernersson about 6 years ago
In our input-document, we have
<head>Verfassung des Deutschen Reichs <lb/>Vom 11. August 1919 <lb/>Reichsgesetzblatt 1919 S. 1383 <lb/>Erster Hauptteil. Aufbau und Aufgaben des Reichs</head>
which, when transformed with a xslt 3.0-script collecting the value from lower-case(head/text()) behaves different depenending on environment.
windows 7, oracle java 8, saxon EE 9.8 (different versions), oxygen, no problem ubuntu 18, oracle java 8, saxon EE 9.6 (different versions), terminal, no problem linux mint 19, openjdk 10.0.2, saxon EE 9.9.0.1, 9.8 (different versions) terminal: "XPTY0004: A sequence of more than one item is not allowed as the first argument of"
So the construction texttext is either interpretted as one text node or as several depending on environment (my guess, it's the java version...)
I honestly don't know which behaviour is the correct one.
textNodeTestIn.xml (752 Bytes) textNodeTestIn.xml | Input file with <head>text<lb/>text</head> | ||
textNodeTest.xsl (476 Bytes) textNodeTest.xsl | Transforming |
Replies (5)
Please register to reply
RE: Inconsistant behaviour when dealing with text() between different environments - Added by Maria Wernersson about 6 years ago
You can find an example script and input file in the attachement to the original post.
Thanks in advance!
Inconsistant behaviour when dealing with text() between different environments - Added by Community Admin about 6 years ago
I'm surprised at the difference, and I suspect the cause is something other than the operating system difference, but the error is correct: the head element has more than one text node as a child, so the function call should fail. I'm not sure what you actually want as output: perhaps just lower-case(head) will do the job.
Michael Kay Saxonica
On 17 Oct 2018, at 11:08, Saxonica Developer Community notifications@plan.io wrote:
RE: Inconsistant behaviour when dealing with text() between different environments - Added by Maria Wernersson about 6 years ago
Thanks for the reply Michael,
I'd already changed it to the the latter, lower-case(head) and now it works like a charm.
The original script, written by a colleague is way more excessive, and has been in production for several years, and it has overlived multiple saxon versions so I was surprised that the scenario was handled so differently and therefor just insecure about what'd be the correct behaviour.
I think our solution will be to be more restricted in the use of the text()-function.
Is there a bug in saxon somewhere? should I write an issue?
/Maria Wernersson
Inconsistant behaviour when dealing with text() between different environments - Added by Community Admin about 6 years ago
I would certainly like to understand why you got the behaviour you did. I'm travelling at the moment but will take a look at your files when I get a chance.
Michael Kay Saxonica
On 17 Oct 2018, at 12:54, Saxonica Developer Community notifications@plan.io wrote:
RE: Inconsistant behaviour when dealing with text() between different environments - Added by Maria Wernersson about 6 years ago
It seems like my example script was a tad too minimal since it gives an error on all our computers... That is, no problem with that one.
I'm going to try to recreate the same situation as in our our original script, which is the source to the inconsistency, without posting our 15 sources and 8000 lines of code.
I'll keep you posted.
Please register to reply