| <?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. |
| --> |
| |
| <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://example.com" |
| xmlns:tns="http://example.com" xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/" |
| xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> |
| |
| <include schemaLocation="org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd"/> |
| |
| <annotation> |
| <appinfo source="http://www.ogf.org/dfdl/"> |
| <dfdl:format ref="tns:GeneralFormat" initiator="" terminator="" leadingSkip="0" |
| trailingSkip="0" textBidi="no" floating="no" encoding="ASCII" |
| byteOrder="bigEndian" alignment="implicit" alignmentUnits="bits" |
| fillByte="f" occursCountKind="parsed" truncateSpecifiedLengthString="no" |
| ignoreCase="no" representation="text" lengthKind="delimited" |
| nilValueDelimiterPolicy="both" emptyValueDelimiterPolicy="none" |
| documentFinalTerminatorCanBeMissing="yes" initiatedContent="no" |
| separatorSuppressionPolicy="anyEmpty" separatorPosition="infix" |
| textTrimKind="none" /> |
| <dfdl:defineVariable name="var1" external="true" |
| type="xsd:int">-1</dfdl:defineVariable> |
| <dfdl:defineVariable name="var2" type="xsd:int">-2</dfdl:defineVariable> |
| <dfdl:defineVariable name="var3" external="true" |
| type="xsd:int">-3</dfdl:defineVariable> |
| </appinfo> |
| </annotation> |
| <!-- Parsing of CSV --> |
| |
| <element name="row" dfdl:lengthKind="delimited" dfdl:encoding="utf-8"> |
| <complexType> |
| <sequence dfdl:separator="," dfdl:encoding="utf-8"> |
| <element name="cell" type="xsd:int" dfdl:textNumberRep="standard" |
| dfdl:lengthKind="delimited" dfdl:encoding="utf-8" /> |
| <element name="cell" type="xsd:int" |
| dfdl:lengthKind="delimited" dfdl:encoding="utf-8" |
| dfdl:inputValueCalc="{ $tns:var1 }" /> |
| <element name="cell" type="xsd:int" |
| dfdl:lengthKind="delimited" dfdl:encoding="utf-8" |
| dfdl:inputValueCalc="{ $tns:var2 }" /> |
| </sequence> |
| </complexType> |
| </element> |
| |
| <element name="row2" dfdl:lengthKind="delimited" dfdl:encoding="utf-8"> |
| <complexType> |
| <sequence dfdl:separator="," dfdl:encoding="utf-8"> |
| <element name="cell" type="xsd:int" |
| dfdl:lengthKind="delimited" dfdl:encoding="utf-8" |
| dfdl:inputValueCalc="{ $tns:var1 }" /> |
| <element name="cell" type="xsd:int" |
| dfdl:lengthKind="delimited" dfdl:encoding="utf-8" |
| dfdl:inputValueCalc="{ $tns:var2 }" /> |
| <element name="cell" type="xsd:int" |
| dfdl:lengthKind="delimited" dfdl:encoding="utf-8" |
| dfdl:inputValueCalc="{ $tns:var3 }" /> |
| </sequence> |
| </complexType> |
| </element> |
| |
| </schema> |