stevedlawrence commented on code in PR #12:
URL: https://github.com/apache/daffodil-schema.g8/pull/12#discussion_r1974056861


##########
src/main/g8/$if(namespaced.truthy)$src$else$.$endif$/$if(namespaced.truthy)$main$else$src$endif$/$if(namespaced.truthy)$resources$else$.$endif$/$if(namespaced.truthy)$$package$$else$.$endif$/$if(namespaced.truthy)$$name__camel$$else$.$endif$/$if(namespaced.truthy)$xsd$else$.$endif$/$name__camel$Root.dfdl.xsd:
##########
@@ -0,0 +1,68 @@
+<?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:fn="http://www.w3.org/2005/xpath-functions";
+  xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/";
+  xmlns:$name;format="camel"$='urn:$package$.$name;format="camel"$'
+  elementFormDefault="unqualified">
+
+  <!--
+  This file defines a root element for the data format.
+
+  You may not need to modify this file.
+  Rather, the details of the format are in the 
"$name;format="camel"$Type.dfdl.xsd" file.
+
+  Notice this element is in no namespace, which is recommended for
+  root elements in DFDL schemas. This keeps the DFDL schema compatible with
+  parsing data not only into XML, but into other representations like JSON 
which don't
+  have namespaces.
+
+  Use of this root element is entirely optional.
+
+  Tests built into the schema project will use this root element.
+  However, users can use this root element, or use the schema as a library by
+  defining their own local or global element and using the top level complex 
type for
+  the format in the "$name;format="camel"$Type.dfdl.xsd" file, just as
+  this root element does.
+
+  It is recommended that top-level root element(s) are in no namespace
+  and contain only a type reference to a complex type defined in the
+  schema's namespace. That is, they are _one-line_ element declarations.
+  -->
+  <xs:import
+    namespace='urn:$package$.$name;format="camel"$'
+    schemaLocation='$name;format="camel"$Type.dfdl.xsd' />
+
+  <xs:annotation>
+    <xs:appinfo source="http://www.ogf.org/dfdl/";>
+      <dfdl:format ref='$name;format="camel"$:$name;format="camel"$BaseFormat' 
/>
+    </xs:appinfo>
+  </xs:annotation>
+
+  <xs:element name='$name;format="camel"$' 
type='$name;format="camel"$:$name;format="camel"$Type' />
+
+  <!--
+  If you need more root elements just for testing, don't add them here,
+  Add them in the test resources directory so they won't be part of the
+  final DFDL schema
+  -->
+
+  </xs:schema>

Review Comment:
   Remove indentation of the closing xs:schema tag.



##########
src/main/g8/build.sbt:
##########
@@ -20,6 +20,10 @@ organization := "$package$"
 
 version := "0.1.0-SNAPSHOT"
 
+// if you need a specific version of Daffodil, you can uncomment and edit
+// this line to refer to a specific daffodil version.
+// daffodilVersion := "3.10.0"

Review Comment:
   Thoughts on removing this? I try to avoid adding specific versions to 
templates, even as examples, just because they never get updated and quickly 
look outdated. Plus, the link below details all the available settings, and 
daffodilVersion is the version one discussed. 



##########
README.md:
##########
@@ -28,10 +28,22 @@ sbt new apache/daffodil-schema.g8
 ```
 
 This command prompts for various properties and creates a bare-bones directory
-structure that follows the recommended [DFDL Schema Project Layout]. This
-includes git and sbt configuration files, a basic DFDL schema file, and [TDML]
+structure that follows the recommended [DFDL Schema Project Layout] and most 
recent
+best practices from the [DFDL Schema Style Guide]. This
+includes git and sbt configuration files, basic DFDL schema files, and [TDML]
 and test files.
 
+Once you have generated your schema directory, typing `sbt test` will work and 
+run a TDML test. Of course, the initial DFDL schema has no fields, the test 
data file is empty, and 
+the expected XML Infoset file is an empty element. But, it's working and you 
can
+keep it working as you fill in the details of the schema and add tests. 
+
+The schema project is set up to use the `daffodil-sbt` plugin for SBT as part 
of the
+SBT build and test. 
+This provides capabilities to compile your DFDL schema into binary form and 
package it for 
+distribution. 
+You can read more about `daffodil-sbt` here: [Apache daffodil-sbt Plugin]
+

Review Comment:
   I just realized we still list the "daffodil_version" property below, that is 
no longer need since this was updated to use the sbt-daffodil plugin for 
specifying daffodil version.. Could you update this readme while you're at it? 



##########
src/main/g8/default.properties:
##########
@@ -16,4 +16,4 @@
 name=format
 extension=dat
 package=com.example
-namespaced=yes
+namespaced=no

Review Comment:
   Don't we still want things namespaced to avoid possible conflicts with file 
names? I thought this should only be set to know for testing/example projects?



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to