Project

Profile

Help

Bug #4219

closed

StreamingTransformerImpl fails to run xsl but same xsl works on commandline

Added by Stefan Fritz almost 5 years ago. Updated almost 5 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
JAXP Java API
Sprint/Milestone:
-
Start date:
2019-05-14
Due date:
% Done:

0%

Estimated time:
Legacy ID:
Applies to branch:
9.8
Fix Committed on Branch:
9.8
Fixed in Maintenance Release:
Platforms:

Description

Saxon EE 9.8.0.15

XSL runs fine via commandline (see working.cmd) but fails with below error when XSL is run via StreamingTransformerImpl (see fails.cmd)

XSL error:

SAXON parallel threads per test: 1 Warning at char 1 in xsl:template/@match on line 24 column 178 of CleanUp.xsl: XPTY0004: An error occurred matching pattern {element()[string-length(zero-or-one(convertUntyped(data(child::text())))) eq 0]}: A sequence of more than one item is not allowed as the first argument of fn:string-length() ("", "") Type error at char 22 in xsl:value-of/@select on line 16 column 77 of CleanUp.xsl: XPTY0004: A sequence of more than one item is not allowed as the first argument of fn:replace() ("", "") in built-in template rule for /test in mode cleanup at xsl:apply-templates (file:/C:/dev/workspace/java/SaxonEETests2/./resources/Relationship_EBI.xsl#15) processing / A sequence of more than one item is not allowed as the first argument of fn:replace() ("", "") xsl done

Java stack:

Caused by: net.sf.saxon.trans.XPathException: A sequence of more than one item is not allowed as the first argument of fn:replace() ("", "") at net.sf.saxon.expr.Expression.typeError(Expression.java:1455) at net.sf.saxon.expr.CardinalityChecker.evaluateItem(CardinalityChecker.java:297) at net.sf.saxon.expr.parser.Evaluator$4.evaluate(Evaluator.java:85) at net.sf.saxon.expr.SystemFunctionCall.evaluateArguments(SystemFunctionCall.java:451) at net.sf.saxon.expr.FunctionCall.iterate(FunctionCall.java:545) at net.sf.saxon.expr.Expression.evaluateItem(Expression.java:849) at net.sf.saxon.expr.parser.Evaluator$4.evaluate(Evaluator.java:85) at net.sf.saxon.expr.SystemFunctionCall.evaluateArguments(SystemFunctionCall.java:451) at net.sf.saxon.expr.FunctionCall.iterate(FunctionCall.java:545) at net.sf.saxon.expr.Expression.evaluateItem(Expression.java:849) at net.sf.saxon.expr.Expression.evaluateAsString(Expression.java:908) at net.sf.saxon.expr.instruct.SimpleNodeConstructor.processLeavingTail(SimpleNodeConstructor.java:218) at net.sf.saxon.expr.instruct.ValueOf.processLeavingTail(ValueOf.java:287) at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:687) at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:151) at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:337) at net.sf.saxon.expr.instruct.Copy.processLeavingTail(Copy.java:415) at net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:347) at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:505) at net.sf.saxon.trans.TextOnlyCopyRuleSet.process(TextOnlyCopyRuleSet.java:69) at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:481) at net.sf.saxon.expr.instruct.ApplyTemplates$ApplyTemplatesPackage.processLeavingTail(ApplyTemplates.java:553) at net.sf.saxon.Controller.transformDocument(Controller.java:2425) at net.sf.saxon.Controller.transform(Controller.java:1979) at net.sf.saxon.s9api.Xslt30Transformer.applyTemplates(Xslt30Transformer.java:592) at net.sf.saxon.jaxp.StreamingTransformerImpl.transform(StreamingTransformerImpl.java:76)

Attached is a project to reproduce this.


Files

SaxonEETests2.zip (1.1 MB) SaxonEETests2.zip Stefan Fritz, 2019-05-14 11:04

Please register to edit this issue

Also available in: Atom PDF