Am trying to parse CSV example after installing latest version of 3.0.0.

* Apache Daffodil Examples
  https://daffodil.apache.org/examples

* DFDLSchemas / CSV
  https://github.com/DFDLSchemas/CSV

* csv.dfdl.xsd
  
https://github.com/DFDLSchemas/CSV/blob/master/src/main/resources/com/tresys/csv/xsd/csv.dfdl.xsd

Had to go searching for

* <xs:include schemaLocation="org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd" 
/>

and found a copy at

* 
https://github.com/apache/incubator-daffodil/blob/master/daffodil-lib/src/main/resources/org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd

and also looked around for example data, which matches excerpt on examples page:

* 
https://raw.githubusercontent.com/DFDLSchemas/CSV/master/src/test/resources/com/tresys/csv/data/simpleCSV.csv

Then, using Ant invocation as follows,

    <target name="daffodil.parse.csv"  description="daffodil.apache.org 
example">
        <echo>daffodil parse csv</echo>
        <exec executable="daffodil"  dir="." vmlauncher="false">
            <arg value="parse"/>
            <arg value="--schema"/>
            <arg value="examples/csv/csv.dfdl.xsd"/>
            <arg value="--output"/>
            <arg value="examples/csv/simpleCSV.parse.xml"/>
            <arg value="examples/csv/simpleCSV.csv"/>
        </exec>
    </target>

... was able to produce attached simpleCSV.parse.xml (attached) which in turn 
matches following and result on HTML page,

* 
https://github.com/DFDLSchemas/CSV/blob/master/src/test/resources/com/tresys/csv/infosets/simpleCSV.xml

So that's good.  However am also getting a lot of Daffodil schema warnings:

daffodil.parse.csv:
daffodil parse csv
[warning] Schema Definition Warning: dfdl:encodingErrorPolicy="error" is not 
yet implemented. The 'replace' value will be used.
Schema context: title Location line 59 column 16 in 
RobodataDFDL/examples/csv/csv.dfdl.xsd
[warning] Schema Definition Warning: dfdl:encodingErrorPolicy="error" is not 
yet implemented. The 'replace' value will be used.
Schema context: item Location line 66 column 16 in 
RobodataDFDL/examples/csv/csv.dfdl.xsd
[warning] Schema Definition Warning: dfdl:encodingErrorPolicy="error" is not 
yet implemented. The 'replace' value will be used.
Schema context: sequence[1] Location line 54 column 8 in 
RobodataDFDL/examples/csv/csv.dfdl.xsd
[warning] Schema Definition Warning: dfdl:encodingErrorPolicy="error" is not 
yet implemented. The 'replace' value will be used.
Schema context: sequence[1] Location line 58 column 14 in 
RobodataDFDL/examples/csv/csv.dfdl.xsd
[warning] Schema Definition Warning: dfdl:encodingErrorPolicy="error" is not 
yet implemented. The 'replace' value will be used.
Schema context: sequence[1] Location line 65 column 14 in 
RobodataDFDL/examples/csv/csv.dfdl.xsd
[warning] Schema Definition Warning: dfdl:encodingErrorPolicy="error" is not 
yet implemented. The 'replace' value will be used.
Schema context: header Location line 55 column 10 in 
RobodataDFDL/examples/csv/csv.dfdl.xsd
[warning] Schema Definition Warning: dfdl:encodingErrorPolicy="error" is not 
yet implemented. The 'replace' value will be used.
Schema context: record Location line 63 column 10 in 
RobodataDFDL/examples/csv/csv.dfdl.xsd
[warning] Schema Definition Warning: dfdl:encodingErrorPolicy="error" is not 
yet implemented. The 'replace' value will be used.
Schema context: element reference ex:file Location line 36 in 
RobodataDFDL/examples/csv/csv.dfdl.xsd
BUILD SUCCESSFUL (total time: 3 seconds)

Wondering please:

a. am i using the correct DFDLGeneralFormat.dfdl.xsd file for this example,
b. is there a more recent version that is suitable for version 3.0.0 ?

Thanks for all feedback.

all the best, Don
--
Don Brutzman  Naval Postgraduate School, Code USW/Br       brutz...@nps.edu
Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149
X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman
<?xml version="1.0" encoding="UTF-8"?>
<ex:file xmlns:ex="http://example.com";>
  <header>
    <title>last</title>
    <title>first</title>
    <title>middle</title>
    <title>DOB</title>
  </header>
  <record>
    <item>smith</item>
    <item>robert</item>
    <item>brandon</item>
    <item>1988-03-24</item>
  </record>
  <record>
    <item>johnson</item>
    <item>john</item>
    <item>henry</item>
    <item>1986-01-23</item>
  </record>
  <record>
    <item>jones</item>
    <item>arya</item>
    <item>cat</item>
    <item>1986-02-19</item>
  </record>
</ex:file>

Reply via email to