During the file CSV generation by data-file engine, it is not possible to choose the end of line char. It is always "CR".
With this improvement it's now possible to define a eol-type attribute on data-file element with value CR or CRLF to use in the csv file result.
Example:
<data-file name="MyCsvTest" separator-style="delimited" type-code="text" delimiter=";" eol-type="CRLF">
<record name="Test">...
</data-file>
Thanks Pierre Gaudin for this proposal.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1819151 13f79535-47bb-0310-9956-ffa450edef68
165 lines
6.9 KiB
XML
165 lines
6.9 KiB
XML
<?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" elementFormDefault="qualified">
|
|
<xs:element name="data-files">
|
|
<xs:complexType>
|
|
<xs:sequence>
|
|
<xs:element maxOccurs="unbounded" ref="data-file"/>
|
|
</xs:sequence>
|
|
</xs:complexType>
|
|
</xs:element>
|
|
<xs:element name="data-file">
|
|
<xs:complexType>
|
|
<xs:sequence>
|
|
<xs:element maxOccurs="unbounded" ref="record"/>
|
|
</xs:sequence>
|
|
<xs:attributeGroup ref="attlist.data-file"/>
|
|
</xs:complexType>
|
|
</xs:element>
|
|
<xs:attributeGroup name="attlist.data-file">
|
|
<xs:attribute name="name" use="required"/>
|
|
<xs:attribute name="type-code" use="required"/>
|
|
<xs:attribute name="sender"/>
|
|
<xs:attribute name="receiver"/>
|
|
<xs:attribute name="delimiter"/>
|
|
<xs:attribute name="start-line"/>
|
|
<xs:attribute name="text-delimiter"/>
|
|
<xs:attribute name="record-length"/>
|
|
<xs:attribute name="separator-style" use="required">
|
|
<xs:simpleType>
|
|
<xs:restriction base="xs:token">
|
|
<xs:enumeration value="fixed-length"/>
|
|
<xs:enumeration value="fixed-record"/>
|
|
<xs:enumeration value="delimited"/>
|
|
</xs:restriction>
|
|
</xs:simpleType>
|
|
</xs:attribute>
|
|
<xs:attribute name="eol-type" default="CR">
|
|
<xs:simpleType>
|
|
<xs:restriction base="xs:token">
|
|
<xs:enumeration value="CR"/>
|
|
<xs:enumeration value="CRLF"/>
|
|
</xs:restriction>
|
|
</xs:simpleType>
|
|
</xs:attribute>
|
|
<xs:attribute name="description"/>
|
|
</xs:attributeGroup>
|
|
<xs:element name="record">
|
|
<xs:complexType>
|
|
<xs:sequence>
|
|
<xs:element maxOccurs="unbounded" ref="field"/>
|
|
</xs:sequence>
|
|
<xs:attributeGroup ref="attlist.record"/>
|
|
</xs:complexType>
|
|
</xs:element>
|
|
<xs:attributeGroup name="attlist.record">
|
|
<xs:attribute name="name" use="required"/>
|
|
<xs:attribute name="type-code"/>
|
|
<xs:attribute name="tc-min"/>
|
|
<xs:attribute name="tc-max"/>
|
|
<xs:attribute name="tc-isnum" default="true">
|
|
<xs:simpleType>
|
|
<xs:restriction base="xs:token">
|
|
<xs:enumeration value="false"/>
|
|
<xs:enumeration value="true"/>
|
|
</xs:restriction>
|
|
</xs:simpleType>
|
|
</xs:attribute>
|
|
<xs:attribute name="tc-position"/>
|
|
<xs:attribute name="tc-length"/>
|
|
<xs:attribute name="description"/>
|
|
<xs:attribute name="parent-name"/>
|
|
<xs:attribute name="limit" default="many">
|
|
<xs:simpleType>
|
|
<xs:restriction base="xs:token">
|
|
<xs:enumeration value="one"/>
|
|
<xs:enumeration value="many"/>
|
|
</xs:restriction>
|
|
</xs:simpleType>
|
|
</xs:attribute>
|
|
</xs:attributeGroup>
|
|
<xs:element name="field">
|
|
<xs:complexType>
|
|
<xs:attributeGroup ref="attlist.field"/>
|
|
</xs:complexType>
|
|
</xs:element>
|
|
<xs:attributeGroup name="attlist.field">
|
|
<xs:attribute name="name" type="xs:string" use="required"/>
|
|
<xs:attribute name="position"/>
|
|
<xs:attribute name="length"/>
|
|
<xs:attribute name="type" use="required">
|
|
<xs:annotation><xs:documentation>The field type is always required. See more about the type attribure in Record.setString() method</xs:documentation></xs:annotation>
|
|
<xs:simpleType>
|
|
<xs:restriction base="xs:token">
|
|
<xs:enumeration value="CustomDate"/>
|
|
<xs:enumeration value="CustomTime"/>
|
|
<xs:enumeration value="FixedPointDouble"/>
|
|
<xs:enumeration value="java.lang.String"/>
|
|
<xs:enumeration value="String"/>
|
|
<xs:enumeration value="java.sql.Timestamp"/>
|
|
<xs:enumeration value="Timestamp"/>
|
|
<xs:enumeration value="java.sql.Time"/>
|
|
<xs:enumeration value="Time"/>
|
|
<xs:enumeration value="java.lang.Integer"/>
|
|
<xs:enumeration value="Integer"/>
|
|
<xs:enumeration value="java.lang.Long"/>
|
|
<xs:enumeration value="Long"/>
|
|
<xs:enumeration value="java.lang.Float"/>
|
|
<xs:enumeration value="Float"/>
|
|
<xs:enumeration value="java.lang.Double"/>
|
|
<xs:enumeration value="Double"/>
|
|
</xs:restriction>
|
|
</xs:simpleType>
|
|
</xs:attribute>
|
|
<xs:attribute name="format">
|
|
<xs:annotation><xs:documentation>You may use EncryptedString if you want to encrypt the string (password for instance). See more in Record.setString() method.</xs:documentation></xs:annotation>
|
|
</xs:attribute>
|
|
|
|
<xs:attribute name="valid-exp"/>
|
|
<xs:attribute name="description"/>
|
|
<xs:attribute name="default-value"/>
|
|
<xs:attribute name="prim-key" default="false">
|
|
<xs:simpleType>
|
|
<xs:restriction base="xs:token">
|
|
<xs:enumeration value="true"/>
|
|
<xs:enumeration value="false"/>
|
|
</xs:restriction>
|
|
</xs:simpleType>
|
|
</xs:attribute>
|
|
<xs:attribute name="ignored" default="false">
|
|
<xs:simpleType>
|
|
<xs:restriction base="xs:token">
|
|
<xs:enumeration value="true"/>
|
|
<xs:enumeration value="false"/>
|
|
</xs:restriction>
|
|
</xs:simpleType>
|
|
</xs:attribute>
|
|
<xs:attribute name="expression" default="false">
|
|
<xs:simpleType>
|
|
<xs:restriction base="xs:token">
|
|
<xs:enumeration value="true"/>
|
|
<xs:enumeration value="false"/>
|
|
</xs:restriction>
|
|
</xs:simpleType>
|
|
</xs:attribute>
|
|
<xs:attribute name="ref-field"/>
|
|
</xs:attributeGroup>
|
|
</xs:schema>
|