mbeckerle commented on a change in pull request #463:
URL: https://github.com/apache/incubator-daffodil/pull/463#discussion_r547488352
##########
File path: daffodil-schematron/src/test/resources/xsd/embedded-1.dfdl.xsd
##########
@@ -24,25 +24,26 @@
<dfdl:format ref="GeneralFormat"/>
</xs:appinfo>
<xs:appinfo xmlns:sch="http://purl.oclc.org/dsdl/schematron">
- <sch:pattern name="test-uuid">
+ <sch:pattern name="validate-uuid">
<sch:rule context="uuid">
- <sch:assert test="string-length(.)=36">uuid must be 36
chars</sch:assert>
- <sch:assert test="substring(.,9,1)='-' and
substring(.,14,1)='-' and substring(.,19,1)='-' and
substring(.,24,1)='-'">malformed uuid</sch:assert>
- </sch:rule>
- </sch:pattern>
- <sch:pattern name="test-short-uuid">
- <sch:rule context="short-uuid">
- <sch:assert test="string-length(.)=8">short uuid must be 8
chars</sch:assert>
+ <sch:assert test="string-length(time_low)=8"><sch:name/>
wrong length</sch:assert>
Review comment:
So you don't need package names on these functions? Why?
I would expect to see "fn:string-length(.) eq 8"
Is schematron's expression language actually not XPath based?
##########
File path:
daffodil-schematron/src/test/scala/org/apache/daffodil/validation/schematron/TestBasicValidation.scala
##########
@@ -68,7 +68,7 @@ class TestBasicValidation {
val factory = new TransformerFactoryImpl()
factory.setURIResolver(resolver)
val sch =
getClass.getClassLoader.getResourceAsStream("sch/schematron-1.sch")
- val rules = Transforms.fromSch(sch, factory)
+ val rules = Transforms.from(sch, Sch, factory)
Review comment:
Might be a separate ticket, but it seems to me we want to be able to
write TDML tests with validation settings that will cause them to invoke
schematron as part of the runtime. E.g., define a tdml:testSuite with
defaultValidation="schematron" or a specific tdml:parserTestCase with
validation="schematron"
##########
File path: daffodil-schematron/src/test/resources/xsd/extends-1.dfdl.xsd
##########
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/"
+ xmlns:sch="http://purl.oclc.org/dsdl/schematron">
+
+ <xs:include
schemaLocation="org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd"/>
+ <xs:annotation>
+ <xs:appinfo source="http://www.ogf.org/dfdl/">
+ <dfdl:format ref="GeneralFormat"/>
+ </xs:appinfo>
+ <xs:appinfo>
+ <sch:pattern>
+ <sch:rule abstract="true" id="blank">
+ <sch:assert test="string-length(.) > 0"><sch:name/> is
blank.</sch:assert>
Review comment:
I expected the test expression to have prefixes like fn:string-length(.)
Is the schematron expression language not XPath based? I am also surprised
to see ">" as an operation.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]