Support #3767
closedmin on sequences containing xs:datetime values
Added by Guido Walter Schmidt over 6 years ago. Updated over 6 years ago.
0%
Description
The min function should be able to compare xs:datetime values numerically. According to https://www.w3.org/TR/xmlschema-2/#dateTime :
3.2.7 dateTime
[Definition:] dateTime values may be viewed as objects with integer-valued year, month, day, hour and minute properties, a decimal-valued second property, and a boolean timezoned property. Each such object also has one decimal-valued method or computed property, timeOnTimeline, whose value is always a decimal number.
Indeed xslt templates we produce with Altova style vision render as expected but give following error:
XPathException
Failure converting {2018-05-02T06:00:00Z} to a number
Failure converting {2018-05-02T06:00:00Z} to a number
net.sf.saxon.functions.Minimax.minimax [205] Minimax.java
net.sf.saxon.functions.Minimax.call [333] Minimax.java
net.sf.saxon.functions.Minimax$Min.call [365] Minimax.java
net.sf.saxon.expr.FunctionCall.iterate [547] FunctionCall.java
net.sf.saxon.expr.Expression.evaluateItem [840] Expression.java
net.sf.saxon.expr.AtomicSequenceConverter.evaluateItem [317] AtomicSequenceConverter.java
net.sf.saxon.expr.AtomicSequenceConverter.evaluateItem [32] AtomicSequenceConverter.java
net.sf.saxon.expr.Expression.evaluateAsString [899] Expression.java
Files
offerdev2.zip (23.3 KB) offerdev2.zip | Guido Walter Schmidt, 2018-04-30 17:17 |
Updated by Michael Kay over 6 years ago
The line number in the code suggests that the values in question are xs:untypedAtomic rather than xs:dateTime. Perhaps you need to set ~~val:strict to ensure that the input documents are properly typed. But that's only a guess ~~ we can't see exactly what's going on unless you post some code to reproduce the problem.
Updated by Guido Walter Schmidt over 6 years ago
- File offerdev2.zip offerdev2.zip added
Unfortunately the error remains with strict=true and multipleSchemaImports = on.
Please find attached the test data with the crucial xpath Meeting/Appontments/Time/StartTime
Updated by Michael Kay over 6 years ago
The test case is working for me, so we need more information about exactly how you are running it.
After trivial renaming of the files, I'm running from the command line:
java net.sf.saxon.Transform -xsl:test.xsl -s:test.xml -t -val:strict
which produces output:
Saxon-EE 9.8.0.10J from Saxonica
Java version 1.8.0_121
Using license serial number K006480
URIResolver.resolve href="pb_business_schema9.xsd" base="file:/Users/mike/bugs/2018/schmidt3767/test.xsl"
Loading schema document file:/Users/mike/bugs/2018/schmidt3767/pb_business_schema9.xsd
URIResolver.resolve href="pb_business_schema1.xsd" base="file:/Users/mike/bugs/2018/schmidt3767/pb_business_schema9.xsd"
Loading schema document file:/Users/mike/bugs/2018/schmidt3767/pb_business_schema1.xsd
URIResolver.resolve href="pb_business_schema6.xsd" base="file:/Users/mike/bugs/2018/schmidt3767/pb_business_schema1.xsd"
Loading schema document file:/Users/mike/bugs/2018/schmidt3767/pb_business_schema6.xsd
URIResolver.resolve href="pb_business_schema7.xsd" base="file:/Users/mike/bugs/2018/schmidt3767/pb_business_schema6.xsd"
Loading schema document file:/Users/mike/bugs/2018/schmidt3767/pb_business_schema7.xsd
URIResolver.resolve href="pb_business_schema8.xsd" base="file:/Users/mike/bugs/2018/schmidt3767/pb_business_schema7.xsd"
Loading schema document file:/Users/mike/bugs/2018/schmidt3767/pb_business_schema8.xsd
URIResolver.resolve href="pb_business_schema5.xsd" base="file:/Users/mike/bugs/2018/schmidt3767/pb_business_schema8.xsd"
Loading schema document file:/Users/mike/bugs/2018/schmidt3767/pb_business_schema5.xsd
URIResolver.resolve href="pb_business_schema4.xsd" base="file:/Users/mike/bugs/2018/schmidt3767/pb_business_schema5.xsd"
Loading schema document file:/Users/mike/bugs/2018/schmidt3767/pb_business_schema4.xsd
Finished loading schema document file:/Users/mike/bugs/2018/schmidt3767/pb_business_schema4.xsd
Finished loading schema document file:/Users/mike/bugs/2018/schmidt3767/pb_business_schema5.xsd
Warning at xs:import on line 12 column 122 of pb_business_schema8.xsd:
The schema document at pb_business_schema4.xsd is not being read because schema components
for this namespace are already available. To force the schema document to be read, set
--multipleSchemaImports:on
URIResolver.resolve href="pb_business_schema3.xsd" base="file:/Users/mike/bugs/2018/schmidt3767/pb_business_schema8.xsd"
Loading schema document file:/Users/mike/bugs/2018/schmidt3767/pb_business_schema3.xsd
Finished loading schema document file:/Users/mike/bugs/2018/schmidt3767/pb_business_schema3.xsd
Finished loading schema document file:/Users/mike/bugs/2018/schmidt3767/pb_business_schema8.xsd
Finished loading schema document file:/Users/mike/bugs/2018/schmidt3767/pb_business_schema7.xsd
Finished loading schema document file:/Users/mike/bugs/2018/schmidt3767/pb_business_schema6.xsd
Warning at xs:import on line 6 column 113 of pb_business_schema1.xsd:
The schema document at pb_business_schema8.xsd is not being read because schema components
for this namespace are already available. To force the schema document to be read, set
--multipleSchemaImports:on
Finished loading schema document file:/Users/mike/bugs/2018/schmidt3767/pb_business_schema1.xsd
Warning at xs:import on line 6 column 119 of pb_business_schema9.xsd:
The schema document at pb_business_schema6.xsd is not being read because schema components
for this namespace are already available. To force the schema document to be read, set
--multipleSchemaImports:on
Warning at xs:import on line 8 column 113 of pb_business_schema9.xsd:
The schema document at pb_business_schema8.xsd is not being read because schema components
for this namespace are already available. To force the schema document to be read, set
--multipleSchemaImports:on
Warning at xs:import on line 10 column 121 of pb_business_schema9.xsd:
The schema document at pb_business_schema7.xsd is not being read because schema components
for this namespace are already available. To force the schema document to be read, set
--multipleSchemaImports:on
Warning at xs:import on line 12 column 122 of pb_business_schema9.xsd:
The schema document at pb_business_schema4.xsd is not being read because schema components
for this namespace are already available. To force the schema document to be read, set
--multipleSchemaImports:on
Warning at xs:import on line 14 column 122 of pb_business_schema9.xsd:
The schema document at pb_business_schema3.xsd is not being read because schema components
for this namespace are already available. To force the schema document to be read, set
--multipleSchemaImports:on
URIResolver.resolve href="pb_business_schema2.xsd" base="file:/Users/mike/bugs/2018/schmidt3767/pb_business_schema9.xsd"
Loading schema document file:/Users/mike/bugs/2018/schmidt3767/pb_business_schema2.xsd
Warning at xs:import on line 4 column 113 of pb_business_schema2.xsd:
The schema document at pb_business_schema8.xsd is not being read because schema components
for this namespace are already available. To force the schema document to be read, set
--multipleSchemaImports:on
Warning at xs:import on line 6 column 116 of pb_business_schema2.xsd:
The schema document at pb_business_schema1.xsd is not being read because schema components
for this namespace are already available. To force the schema document to be read, set
--multipleSchemaImports:on
Warning at xs:import on line 8 column 119 of pb_business_schema2.xsd:
The schema document at pb_business_schema6.xsd is not being read because schema components
for this namespace are already available. To force the schema document to be read, set
--multipleSchemaImports:on
Finished loading schema document file:/Users/mike/bugs/2018/schmidt3767/pb_business_schema2.xsd
Finished loading schema document file:/Users/mike/bugs/2018/schmidt3767/pb_business_schema9.xsd
Stylesheet compilation time: 4.336734s (4336.734224ms)
Processing file:/Users/mike/bugs/2018/schmidt3767/test.xml
Using parser org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser
Building tree for file:/Users/mike/bugs/2018/schmidt3767/test.xml using class net.sf.saxon.tree.tiny.TinyBuilder
Tree built in 100.158299ms
Tree size: 3201 nodes, 10577 characters, 0 attributes
Execution time: 380.244977ms
<!DOCTYPE html
PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title></title><meta name="generator" content="Altova StyleVision Enterprise Edition 2017 rel. 3 sp1 (x64) (http://www.altova.com)"><meta http-equiv="X-UA-Compatible" content="IE=9"><!--[if IE]><STYLE type="text/css">.altova-rotate-left-textbox{filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3)} .altova-rotate-right-textbox{filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1)} </STYLE><![endif]--><!--[if !IE]><!--><style type="text/css">.altova-rotate-left-textbox{-webkit-transform: rotate(-90deg) translate(-100%, 0%); -webkit-transform-origin: 0% 0%;-moz-transform: rotate(-90deg) translate(-100%, 0%); -moz-transform-origin: 0% 0%;-ms-transform: rotate(-90deg) translate(-100%, 0%); -ms-transform-origin: 0% 0%;}.altova-rotate-right-textbox{-webkit-transform: rotate(90deg) translate(0%, -100%); -webkit-transform-origin: 0% 0%;-moz-transform: rotate(90deg) translate(0%, -100%); -moz-transform-origin: 0% 0%;-ms-transform: rotate(90deg) translate(0%, -100%); -ms-transform-origin: 0% 0%;}</style><!--<![endif]--><style type="text/css">@page { margin-left:0.60in; margin-right:0.60in; margin-top:0.79in; margin-bottom:0.79in } @media print { br.altova-page-break { page-break-before: always; } div.altova-page-break { page-break-before: always; } }</style></head><body><span>2018-05-01T06:00:00Z</span></body></html>
Memory used: 41,790,512
It would be useful if you could run it with the same command line options and show me the output.
Updated by Guido Walter Schmidt over 6 years ago
Pretty much the same with the latest release as well as with our production release. Without -val:strict it produces the error. Seems that the parameter is not properly read in our system. The issue can be closed. Thank you very much for the incredible response time.
D:\temp\saxon\old>java -jar saxon9ee.jar -xsl:test.xslt -s:test.xml -t -val:strict
Saxon-EE 9.5.1.4J from Saxonica
Java version 1.8.0_144
Using license serial number V006058
URIResolver.resolve href="pb_business_schema9.xsd" base="file:/D:/temp/saxon/old/test.xslt"
Loading schema document file:/D:/temp/saxon/old/pb_business_schema9.xsd
URIResolver.resolve href="pb_business_schema1.xsd" base="file:/D:/temp/saxon/old/pb_business_schema9.xsd"
Loading schema document file:/D:/temp/saxon/old/pb_business_schema1.xsd
URIResolver.resolve href="pb_business_schema6.xsd" base="file:/D:/temp/saxon/old/pb_business_schema1.xsd"
Loading schema document file:/D:/temp/saxon/old/pb_business_schema6.xsd
URIResolver.resolve href="pb_business_schema7.xsd" base="file:/D:/temp/saxon/old/pb_business_schema6.xsd"
Loading schema document file:/D:/temp/saxon/old/pb_business_schema7.xsd
URIResolver.resolve href="pb_business_schema8.xsd" base="file:/D:/temp/saxon/old/pb_business_schema7.xsd"
Loading schema document file:/D:/temp/saxon/old/pb_business_schema8.xsd
URIResolver.resolve href="pb_business_schema5.xsd" base="file:/D:/temp/saxon/old/pb_business_schema8.xsd"
Loading schema document file:/D:/temp/saxon/old/pb_business_schema5.xsd
URIResolver.resolve href="pb_business_schema4.xsd" base="file:/D:/temp/saxon/old/pb_business_schema5.xsd"
Loading schema document file:/D:/temp/saxon/old/pb_business_schema4.xsd
Finished loading schema document file:/D:/temp/saxon/old/pb_business_schema4.xsd
Finished loading schema document file:/D:/temp/saxon/old/pb_business_schema5.xsd
Warning: at xs:import on line 12 column 122 of pb_business_schema8.xsd:
The schema document at pb_business_schema4.xsd is not being read because schema components
for this namespace are already available. To force the schema document to be read, set
--multipleSchemaImports:on
URIResolver.resolve href="pb_business_schema3.xsd" base="file:/D:/temp/saxon/old/pb_business_schema8.xsd"
Loading schema document file:/D:/temp/saxon/old/pb_business_schema3.xsd
Finished loading schema document file:/D:/temp/saxon/old/pb_business_schema3.xsd
Finished loading schema document file:/D:/temp/saxon/old/pb_business_schema8.xsd
Finished loading schema document file:/D:/temp/saxon/old/pb_business_schema7.xsd
Finished loading schema document file:/D:/temp/saxon/old/pb_business_schema6.xsd
Warning: at xs:import on line 6 column 113 of pb_business_schema1.xsd:
The schema document at pb_business_schema8.xsd is not being read because schema components
for this namespace are already available. To force the schema document to be read, set
--multipleSchemaImports:on
Finished loading schema document file:/D:/temp/saxon/old/pb_business_schema1.xsd
Warning: at xs:import on line 6 column 119 of pb_business_schema9.xsd:
The schema document at pb_business_schema6.xsd is not being read because schema components
for this namespace are already available. To force the schema document to be read, set
--multipleSchemaImports:on
Warning: at xs:import on line 8 column 113 of pb_business_schema9.xsd:
The schema document at pb_business_schema8.xsd is not being read because schema components
for this namespace are already available. To force the schema document to be read, set
--multipleSchemaImports:on
Warning: at xs:import on line 10 column 121 of pb_business_schema9.xsd:
The schema document at pb_business_schema7.xsd is not being read because schema components
for this namespace are already available. To force the schema document to be read, set
--multipleSchemaImports:on
Warning: at xs:import on line 12 column 122 of pb_business_schema9.xsd:
The schema document at pb_business_schema4.xsd is not being read because schema components
for this namespace are already available. To force the schema document to be read, set
--multipleSchemaImports:on
Warning: at xs:import on line 14 column 122 of pb_business_schema9.xsd:
The schema document at pb_business_schema3.xsd is not being read because schema components
for this namespace are already available. To force the schema document to be read, set
--multipleSchemaImports:on
URIResolver.resolve href="pb_business_schema2.xsd" base="file:/D:/temp/saxon/old/pb_business_schema9.xsd"
Loading schema document file:/D:/temp/saxon/old/pb_business_schema2.xsd
Warning: at xs:import on line 4 column 113 of pb_business_schema2.xsd:
The schema document at pb_business_schema8.xsd is not being read because schema components
for this namespace are already available. To force the schema document to be read, set
--multipleSchemaImports:on
Warning: at xs:import on line 6 column 116 of pb_business_schema2.xsd:
The schema document at pb_business_schema1.xsd is not being read because schema components
for this namespace are already available. To force the schema document to be read, set
--multipleSchemaImports:on
Warning: at xs:import on line 8 column 119 of pb_business_schema2.xsd:
The schema document at pb_business_schema6.xsd is not being read because schema components
for this namespace are already available. To force the schema document to be read, set
--multipleSchemaImports:on
Finished loading schema document file:/D:/temp/saxon/old/pb_business_schema2.xsd
Finished loading schema document file:/D:/temp/saxon/old/pb_business_schema9.xsd
Cannot run altova:CountLeadingTrueValues in compile mode - using interpreter
Generating byte code...
Stylesheet compilation time: 1435 milliseconds
Processing file:/D:/temp/saxon/old/test.xml
Using parser com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser
Building tree for file:/D:/temp/saxon/old/test.xml using class net.sf.saxon.tree.tiny.TinyBuilder
Tree built in 109 milliseconds
Tree size: 3201 nodes, 10577 characters, 0 attributes
<title></title><style type="text/css">.altova-rotate-left-textbox{-webkit-transform: rotate(-90deg) translate(-100%, 0%); -webkit-transform-origin: 0% 0%;-moz-transform: rotate(-90deg) translate(-100%, 0%); -moz-transform-origin: 0% 0%;-ms-transform: rotate(-90deg) translate(-100%, 0%); -ms-transform-origin: 0% 0%;}.altova-rotate-right-textbox{-webkit-transform: rotate(90deg) translate(0%, -100%); -webkit-transform-origin: 0% 0%;-moz-transform: rotate(90deg) translate(0%, -100%); -moz-transform-origin: 0% 0%;-ms-transform: rotate(90deg) translate(0%, -100%); -ms-transform-origin: 0% 0%;}</style><style type="text/css">@page { margin-left:0.60in; margin-right:0.60in; margin-top:0.79in; margin-bottom:0.79in } @media print { br.altova-page-break { page-break-before: always; } div.altova-page-break { page-break-before: always; } }</style>2018-05-01T06:00:00ZExecution time: 243msMemory used: 11352024
NamePool contents: 532 entries in 394 chains. 17 URIs
Updated by Michael Kay over 6 years ago
- Tracker changed from Bug to Support
- Status changed from New to Resolved
- Assignee set to Michael Kay
Please register to edit this issue