blob: cb74c71e7165287cb785ec1df2d27561c5096a60 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<tdml:testSuite suiteName="expressions"
description="lengthKind explicit and occursCountKind expression"
xmlns:tdml="http://www.ibm.com/xmlns/dfdl/testData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:ex="http://example.com" xmlns:fn="http://www.w3.org/2005/xpath-functions">
<tdml:defineSchema name="newRegex">
<dfdl:format ref="ex:daffodilTest1" />
<xs:simpleType name="st1">
<xs:restriction base="xs:string">
<xs:pattern value="\d\d(?=\D+)" />
</xs:restriction>
</xs:simpleType>
<xs:element name="s3">
<xs:complexType>
<xs:sequence>
<xs:element name="e1" type="st1" dfdl:lengthKind="delimited">
<xs:annotation>
<xs:appinfo source="http://www.ogf.org/dfdl/dfdl-1.0/">
<dfdl:assert test="{ dfdl:checkConstraints(.) }"
message="Assertion failed for dfdl:checkConstraints(.)" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element name="extra" type="xs:string" dfdl:lengthKind="delimited"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="s1">
<xs:complexType>
<xs:sequence>
<xs:element name="e1" type="xs:string" dfdl:lengthKind="pattern" dfdl:lengthPattern="\d\d(?=\D+)"/>
<xs:element name="extra" type="xs:string" dfdl:lengthKind="delimited"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="s2">
<xs:complexType>
<xs:sequence>
<xs:element name="e1" type="xs:int" dfdl:lengthKind="pattern" dfdl:lengthPattern="\d\d(?=\D+)">
<xs:annotation>
<xs:appinfo source="http://www.ogf.org/dfdl/dfdl-1.0/">
<dfdl:assert testKind="pattern" testPattern="\d\d(?=\D+)"
message="Assertion failed for pattern '\d\d'" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element name="extra" type="xs:string" dfdl:lengthKind="delimited"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="s4">
<xs:complexType>
<xs:sequence>
<xs:element name="e1" type="xs:string" dfdl:lengthKind="pattern" dfdl:lengthPattern="\U0010ffff"/>
<xs:element name="extra" type="xs:string" dfdl:lengthKind="delimited"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</tdml:defineSchema>
<tdml:defineSchema name="lke1_rel">
<dfdl:format ref="ex:daffodilTest1" />
<xs:element name="e1">
<xs:complexType>
<xs:sequence>
<xs:element name="len" type="xs:int"
dfdl:representation="binary" dfdl:lengthKind="implicit" />
<xs:element name="s1" type="xs:string"
dfdl:lengthKind="explicit" dfdl:length="{ ../ex:len }" />
</xs:sequence>
</xs:complexType>
</xs:element>
</tdml:defineSchema>
<tdml:parserTestCase name="lke1_rel" root="e1"
model="lke1_rel" description="simplest computed length - DFDL-23-011R">
<tdml:document>
<tdml:documentPart type="byte">00000004
</tdml:documentPart>
<tdml:documentPart type="text">abcd</tdml:documentPart>
</tdml:document>
<tdml:infoset>
<tdml:dfdlInfoset>
<ex:e1>
<ex:len>4</ex:len>
<ex:s1>abcd</ex:s1>
</ex:e1>
</tdml:dfdlInfoset>
</tdml:infoset>
</tdml:parserTestCase>
<tdml:defineSchema name="lke1_abs">
<dfdl:format ref="ex:daffodilTest1" />
<xs:element name="e1">
<xs:complexType>
<xs:sequence>
<xs:element name="len" type="xs:int"
dfdl:representation="binary" dfdl:lengthKind="implicit" />
<xs:element name="s1" type="xs:string"
dfdl:lengthKind="explicit" dfdl:length="{ /ex:e1/ex:len }" />
</xs:sequence>
</xs:complexType>
</xs:element>
</tdml:defineSchema>
<tdml:parserTestCase name="lke1_abs" root="e1"
model="lke1_abs" description="simplest computed length - DFDL-23-011R">
<tdml:document>
<tdml:documentPart type="byte">00000004
</tdml:documentPart>
<tdml:documentPart type="text">abcd</tdml:documentPart>
</tdml:document>
<tdml:infoset>
<tdml:dfdlInfoset>
<ex:e1>
<ex:len>4</ex:len>
<ex:s1>abcd</ex:s1>
</ex:e1>
</tdml:dfdlInfoset>
</tdml:infoset>
</tdml:parserTestCase>
<tdml:defineSchema name="ocke1">
<dfdl:format ref="ex:daffodilTest1" />
<xs:element name="e1">
<xs:complexType>
<xs:sequence>
<xs:element name="reps" type="xs:int"
dfdl:representation="binary" dfdl:lengthKind="implicit" />
<xs:element name="scale" type="xs:int"
dfdl:representation="binary" dfdl:lengthKind="implicit" />
<xs:element name="s1" type="xs:string"
dfdl:lengthKind="explicit" dfdl:length="{1}"
dfdl:occursCount="{ ../ex:reps * /ex:e1/ex:scale}"
dfdl:occursCountKind="expression" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
</xs:element>
</tdml:defineSchema>
<tdml:parserTestCase name="ocke1" root="e1" model="ocke1"
description="very simple occursCountKind expression - DFDL-23-011R">
<tdml:document>
<!-- two binary integers get multiplied 2x2=4 -->
<tdml:documentPart type="byte">00000002 00000002
</tdml:documentPart>
<!-- followed by that many characters, each is an element of the array -->
<tdml:documentPart type="text">abcd</tdml:documentPart>
</tdml:document>
<tdml:infoset>
<tdml:dfdlInfoset>
<ex:e1>
<ex:reps>2</ex:reps>
<ex:scale>2</ex:scale>
<ex:s1>a</ex:s1>
<ex:s1>b</ex:s1>
<ex:s1>c</ex:s1>
<ex:s1>d</ex:s1>
</ex:e1>
</tdml:dfdlInfoset>
</tdml:infoset>
</tdml:parserTestCase>
<tdml:defineSchema name="ocke2">
<dfdl:format ref="ex:daffodilTest1" />
<xs:element name="e1">
<xs:complexType>
<xs:sequence>
<xs:element name="scale" type="xs:int"
dfdl:representation="binary" dfdl:lengthKind="implicit" />
<xs:element name="hdr">
<xs:complexType>
<xs:sequence>
<xs:element name="reps" type="xs:int"
dfdl:representation="binary" dfdl:lengthKind="implicit" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="body">
<xs:complexType>
<xs:sequence>
<xs:element name="s1" type="xs:string"
dfdl:lengthKind="explicit" dfdl:length="{1}"
dfdl:occursCount="{ ../../ex:hdr/ex:reps * /ex:e1/ex:scale}"
dfdl:occursCountKind="expression" minOccurs="0"
maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</tdml:defineSchema>
<tdml:parserTestCase name="ocke2" root="e1" model="ocke2"
description="very simple occursCountKind expression - DFDL-23-011R">
<tdml:document>
<!-- two binary integers get multiplied 2x2=4 -->
<tdml:documentPart type="byte">00000003 00000002
</tdml:documentPart>
<!-- followed by that many characters, each is an element of the array -->
<tdml:documentPart type="text">abcdef</tdml:documentPart>
</tdml:document>
<tdml:infoset>
<tdml:dfdlInfoset>
<ex:e1>
<ex:scale>3</ex:scale>
<ex:hdr>
<ex:reps>2</ex:reps>
</ex:hdr>
<ex:body>
<ex:s1>a</ex:s1>
<ex:s1>b</ex:s1>
<ex:s1>c</ex:s1>
<ex:s1>d</ex:s1>
<ex:s1>e</ex:s1>
<ex:s1>f</ex:s1>
</ex:body>
</ex:e1>
</tdml:dfdlInfoset>
</tdml:infoset>
</tdml:parserTestCase>
<tdml:defineSchema name="ArrayOptionalElem-Embedded.dfdl.xsd">
<dfdl:format ref="ex:daffodilTest1" lengthUnits="bytes"
encoding="UTF-8" separator="" initiator="" terminator=""
occursCountKind="parsed" ignoreCase="no" textNumberRep="standard"
representation="text" byteOrder="bigEndian" binaryNumberRep="binary" />
<xs:element name="aoe_01">
<xs:complexType>
<xs:sequence>
<xs:element name="reps" type="xs:int"
dfdl:representation="binary" dfdl:lengthKind="implicit" />
<xs:element name="rows" type="xs:byte"
dfdl:representation="binary" maxOccurs="unbounded"
dfdl:lengthKind="implicit" dfdl:occursCountKind="expression"
dfdl:occursCount="{ ../ex:reps }" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="aoe_02">
<xs:complexType>
<xs:sequence>
<xs:element name="reps" type="xs:unsignedInt"
dfdl:representation="binary" dfdl:lengthKind="implicit" />
<xs:element name="rows" type="xs:byte"
dfdl:representation="binary" maxOccurs="unbounded"
dfdl:occursCountKind="expression" dfdl:occursCount="{ ../ex:reps }" />
</xs:sequence>
</xs:complexType>
</xs:element>
</tdml:defineSchema>
<tdml:parserTestCase name="ArrayOptElem_01" root="aoe_01"
model="ArrayOptionalElem-Embedded.dfdl.xsd" description="occursCountKind expression with relative path - DFDL-23-011R">
<tdml:document>
<tdml:documentPart type="byte">00000003000102
</tdml:documentPart>
</tdml:document>
<tdml:infoset>
<tdml:dfdlInfoset>
<aoe_01>
<reps>3</reps>
<rows>0</rows>
<rows>1</rows>
<rows>2</rows>
</aoe_01>
</tdml:dfdlInfoset>
</tdml:infoset>
</tdml:parserTestCase>
<tdml:parserTestCase name="ArrayOptElem_02" root="aoe_02"
model="ArrayOptionalElem-Embedded.dfdl.xsd"
description="an unsignedInt value in an occursCount expression - DFDL-23-011R">
<tdml:document>
<tdml:documentPart type="byte">00000003000102
</tdml:documentPart>
</tdml:document>
<tdml:infoset>
<tdml:dfdlInfoset>
<aoe_02>
<reps>3</reps>
<rows>0</rows>
<rows>1</rows>
<rows>2</rows>
</aoe_02>
</tdml:dfdlInfoset>
</tdml:infoset>
</tdml:parserTestCase>
<tdml:defineSchema name="expressions-Embedded.dfdl.xsd">
<dfdl:format ref="ex:daffodilTest1" lengthKind="delimited"
lengthUnits="bytes" encoding="US-ASCII" separator="" initiator=""
terminator="" occursCountKind="parsed" ignoreCase="no"
textNumberRep="standard" representation="text" />
<xs:element name="lke_01" dfdl:lengthKind="implicit">
<xs:complexType>
<xs:sequence>
<xs:element name="e1" type="xs:int"
dfdl:lengthKind="explicit" dfdl:length="1" />
<xs:element name="e2" type="xs:int"
dfdl:lengthKind="explicit" dfdl:length="{../ex:e1}" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="lke_02" dfdl:lengthKind="implicit">
<xs:complexType>
<xs:sequence>
<xs:element name="e1" type="xs:int" dfdl:encoding="utf-8"
dfdl:lengthKind="explicit" dfdl:length="1" />
<xs:element name="e2" type="xs:int" dfdl:encoding="utf-8"
dfdl:lengthKind="explicit" dfdl:length="{../ex:e1}" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="ocke" dfdl:lengthKind="implicit">
<xs:complexType>
<xs:sequence dfdl:initiator="">
<xs:element name="nrows" type="xs:int"
dfdl:lengthKind="delimited" dfdl:terminator="," />
<xs:element name="ncols" type="xs:int"
dfdl:lengthKind="delimited" dfdl:terminator="," />
<xs:element name="rows" maxOccurs="unbounded"
dfdl:occursCountKind="expression" dfdl:occursCount="{ ../ex:nrows }">
<xs:complexType>
<xs:sequence>
<xs:element name="cols" type="xs:int"
maxOccurs="unbounded" dfdl:lengthKind="delimited"
dfdl:terminator="," dfdl:occursCountKind="expression"
dfdl:occursCount="{ ../../ex:ncols }" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</tdml:defineSchema>
<tdml:parserTestCase name="lke2_rel" root="lke_01"
model="expressions-Embedded.dfdl.xsd" description="length expression, relative path - DFDL-23-011R">
<tdml:document>3538</tdml:document>
<tdml:infoset>
<tdml:dfdlInfoset>
<lke_01>
<e1>3</e1>
<e2>538</e2>
</lke_01>
</tdml:dfdlInfoset>
</tdml:infoset>
</tdml:parserTestCase>
<tdml:parserTestCase name="lke3_rel" root="lke_02"
model="expressions-Embedded.dfdl.xsd" description="length expression, relative path - DFDL-23-011R">
<tdml:document>3538</tdml:document>
<tdml:infoset>
<tdml:dfdlInfoset>
<lke_02>
<e1>3</e1>
<e2>538</e2>
</lke_02>
</tdml:dfdlInfoset>
</tdml:infoset>
</tdml:parserTestCase>
<tdml:parserTestCase name="ocke_rel" root="ocke"
model="expressions-Embedded.dfdl.xsd" description="occursCountKind expression - DFDL-23-011R">
<tdml:document><![CDATA[2,3,1,2,3,4,5,6,]]></tdml:document>
<tdml:infoset>
<tdml:dfdlInfoset>
<ocke>
<nrows>2</nrows>
<ncols>3</ncols>
<rows>
<cols>1</cols>
<cols>2</cols>
<cols>3</cols>
</rows>
<rows>
<cols>4</cols>
<cols>5</cols>
<cols>6</cols>
</rows>
</ocke>
</tdml:dfdlInfoset>
</tdml:infoset>
</tdml:parserTestCase>
<tdml:defineSchema name="expression-type-errors.dfdl.xsd">
<dfdl:format ref="ex:daffodilTest1" lengthKind="delimited"
lengthUnits="bytes" encoding="UTF-8" separator="" initiator=""
terminator="" occursCountKind="parsed" ignoreCase="no"
textNumberRep="standard" representation="text" />
<xs:element name="e" dfdl:lengthKind="implicit">
<xs:complexType>
<xs:sequence>
<xs:element name="e1" type="xs:string"
dfdl:inputValueCalc="{ 'S' }" />
<xs:element name="e2" type="xs:int"
dfdl:inputValueCalc="{ 2 }" />
<xs:element name="e3" type="xs:int"
dfdl:inputValueCalc="{ ../ex:e2 + ../ex:e1 }" /> <!-- type error adding string to int is n.g. -->
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="f" dfdl:lengthKind="implicit">
<xs:complexType>
<xs:sequence>
<xs:element name="e3" type="xs:int"
dfdl:inputValueCalc="{ 2.5 }" /> <!-- type error as result is not int. -->
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="g" dfdl:lengthKind="implicit">
<xs:complexType>
<xs:sequence>
<xs:element name="e1" type="xs:string"
dfdl:inputValueCalc="{ 'notAnInt' }" />
<xs:element name="e3" type="xs:int"
dfdl:inputValueCalc="{ ../ex:e1 }" /> <!-- type error -->
</xs:sequence>
</xs:complexType>
</xs:element>
</tdml:defineSchema>
<tdml:parserTestCase name="expression-type-error1"
root="e" model="expression-type-errors.dfdl.xsd"
description="get a type error from an expression at runtime - DFDL-23-006R">
<tdml:document />
<tdml:errors>
<tdml:error>Parse Error</tdml:error>
<tdml:error>convert</tdml:error>
<tdml:error>double</tdml:error>
</tdml:errors>
</tdml:parserTestCase>
<tdml:parserTestCase name="expression-type-error2"
root="f" model="expression-type-errors.dfdl.xsd"
description="get a type error from an expression at runtime - DFDL-23-006R">
<tdml:document />
<tdml:errors>
<tdml:error>Schema Definition Error</tdml:error>
<tdml:error>convert</tdml:error>
</tdml:errors>
</tdml:parserTestCase>
<tdml:parserTestCase name="expression-type-error3"
root="g" model="expression-type-errors.dfdl.xsd"
description="get a type error from an expression at runtime - DFDL-23-006R">
<tdml:document />
<tdml:errors>
<tdml:error>Parse Error</tdml:error>
<tdml:error>NaN</tdml:error>
</tdml:errors>
<!-- <tdml:infoset> <tdml:dfdlInfoset xmlns="http://example.com"> <g>
<e1>notAnInt</e1>
<e3>2</e3> </g> </tdml:dfdlInfoset> </tdml:infoset> -->
</tdml:parserTestCase>
<tdml:defineSchema name="unknown-prefix">
<dfdl:format ref="ex:daffodilTest1" />
<xs:element name="theElementName" type="xs:int"
dfdl:inputValueCalc="{ theUnknownPrefix:x }" />
</tdml:defineSchema>
<tdml:parserTestCase name="expression-unknown-prefix"
root="theElementName" model="unknown-prefix"
description="get compilation time error due to unknown prefix - DFDL-2-001R requirement makes a reference to this test -Assigned to requirement DFDL-23-011R">
<tdml:document />
<tdml:errors>
<tdml:error>Schema Definition</tdml:error>
<tdml:error>theUnknownPrefix</tdml:error>
<tdml:error>theElementName</tdml:error>
</tdml:errors>
</tdml:parserTestCase>
<!--- begin ssustrich's test -->
<tdml:defineSchema name="expresion_path_error">
<dfdl:format ref="ex:daffodilTest1" />
<xs:element name="e1">
<xs:complexType>
<xs:sequence>
<xs:element name="reps" type="xs:int"
dfdl:representation="binary" dfdl:lengthKind="implicit" />
<xs:element name="scale" type="xs:int"
dfdl:representation="binary" dfdl:lengthKind="implicit" />
<xs:element name="s1" type="xs:string"
dfdl:lengthKind="explicit" dfdl:length="{1}"
dfdl:occursCount="{ ../../ex:reps * /ex:e1/ex:scale}"
dfdl:occursCountKind="expression" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
</xs:element>
</tdml:defineSchema>
<tdml:parserTestCase name="expresion_bad_path_to_element"
root="e1" model="expresion_path_error"
description="very simple occursCountKind expression - DFDL-23-011R">
<tdml:document>
<!-- two binary integers get multiplied 2x2=4 -->
<tdml:documentPart type="byte">00000002 00000002
</tdml:documentPart>
<!-- followed by that many characters, each is an element of the array -->
<tdml:documentPart type="text">abcd</tdml:documentPart>
</tdml:document>
<tdml:errors>
<tdml:error />
</tdml:errors>
<!-- <tdml:infoset> <tdml:dfdlInfoset> <ex:e1> <ex:reps>2</ex:reps> <ex:scale>2</ex:scale>
<ex:s1>a</ex:s1> <ex:s1>b</ex:s1> <ex:s1>c</ex:s1> <ex:s1>d</ex:s1>
</ex:e1>
</tdml:dfdlInfoset> </tdml:infoset> -->
</tdml:parserTestCase>
<!--- end ssustrich's test -->
<tdml:defineSchema name="v">
<dfdl:format ref="ex:daffodilTest1" />
<xs:element name="e">
<xs:complexType>
<xs:sequence>
<xs:element name="cnt" type="xs:int"
dfdl:lengthKind="delimited" />
<xs:element name="a" minOccurs="0" maxOccurs="unbounded"
dfdl:occursCountKind="expression" dfdl:occursCount="{ xs:int(../ex:cnt) }">
<xs:complexType>
<xs:sequence>
<xs:element name="v" type="xs:int"
dfdl:inputValueCalc="{ dfdl:position() }" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="f">
<xs:complexType>
<xs:sequence>
<xs:element name="cnt1" type="xs:int"
dfdl:lengthKind="delimited" dfdl:terminator=";" />
<xs:element name="a" minOccurs="0" maxOccurs="unbounded"
dfdl:occursCountKind="expression" dfdl:occursCount="{ xs:int(../ex:cnt1) }">
<xs:complexType>
<xs:sequence>
<xs:element name="v" type="xs:int"
dfdl:inputValueCalc="{ dfdl:position() }" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="cnt2" type="xs:int"
dfdl:lengthKind="delimited" />
<xs:element name="a" minOccurs="0" maxOccurs="unbounded"
dfdl:occursCountKind="expression" dfdl:occursCount="{ xs:int(../ex:cnt2) }">
<xs:complexType>
<xs:sequence>
<xs:element name="v" type="xs:int"
dfdl:inputValueCalc="{ dfdl:position() }" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="g">
<xs:complexType>
<xs:sequence>
<xs:element name="cnt1" type="xs:int"
dfdl:lengthKind="delimited" dfdl:terminator=";" />
<xs:element name="a" minOccurs="0" maxOccurs="unbounded"
dfdl:occursCountKind="expression" dfdl:occursCount="{ xs:int(../ex:cnt1) }">
<xs:complexType>
<xs:sequence>
<xs:element name="v" type="xs:int"
dfdl:inputValueCalc="{ dfdl:position() }" />
<xs:element name="cnt2" type="xs:int"
dfdl:lengthKind="delimited" dfdl:terminator=";" />
<xs:element name="b" minOccurs="0" maxOccurs="unbounded"
dfdl:occursCountKind="expression" dfdl:occursCount="{ xs:int(../ex:cnt2) }">
<xs:complexType>
<xs:sequence>
<xs:element name="w" type="xs:int"
dfdl:inputValueCalc="{ dfdl:position() }" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="h">
<xs:complexType>
<xs:sequence>
<xs:element name="cnt" type="xs:int"
dfdl:lengthKind="delimited" />
<xs:element name="a" minOccurs="0" maxOccurs="unbounded"
dfdl:occursCountKind="expression" dfdl:occursCount="{ xs:int(../ex:cnt) }">
<xs:complexType>
<xs:sequence>
<xs:element name="v" type="xs:int"
dfdl:inputValueCalc="{ if (dfdl:position() mod 2 eq 1) then 0 else dfdl:position() }" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="noFunc">
<xs:complexType>
<xs:sequence>
<xs:element name="err" type="xs:int"
dfdl:inputValueCalc="{ dfdl:notAFunction(1, 2, 3) }" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="constantFunction">
<xs:complexType>
<xs:sequence>
<xs:element name="six" type="xs:int"
dfdl:length="{ fn:string-length('123456') }"
dfdl:lengthKind="explicit" />
</xs:sequence>
</xs:complexType>
</xs:element>
</tdml:defineSchema>
<tdml:parserTestCase name="nonFunctionIsDetected"
root="noFunc" model="v"
description="Schema definition error in general syntax of DFDL expression - DFDL-23-063R">
<tdml:document />
<tdml:errors>
<tdml:error>notAFunction</tdml:error>
<tdml:error>arity 3</tdml:error>
</tdml:errors>
</tdml:parserTestCase>
<tdml:parserTestCase name="constantFunction1"
root="constantFunction" model="v"
description="Use of fn:string-length() - DFDL-23-101R">
<tdml:document>999999</tdml:document>
<tdml:infoset>
<tdml:dfdlInfoset>
<constantFunction>
<six>999999</six>
</constantFunction>
</tdml:dfdlInfoset>
</tdml:infoset>
</tdml:parserTestCase>
<tdml:parserTestCase name="dfdlPosition1" root="e"
model="v" description="Use of dfdl:position() - DFDL-23-134R">
<tdml:document>1</tdml:document>
<tdml:infoset>
<tdml:dfdlInfoset>
<e>
<cnt>1</cnt>
<a>
<v>1</v>
</a>
</e>
</tdml:dfdlInfoset>
</tdml:infoset>
</tdml:parserTestCase>
<tdml:parserTestCase name="dfdlPosition2" root="e"
model="v" description="Use of dfdl:position() - DFDL-23-134R">
<tdml:document>2</tdml:document>
<tdml:infoset>
<tdml:dfdlInfoset>
<e>
<cnt>2</cnt>
<a>
<v>1</v>
</a>
<a>
<v>2</v>
</a>
</e>
</tdml:dfdlInfoset>
</tdml:infoset>
</tdml:parserTestCase>
<tdml:parserTestCase name="dfdlPosition3" root="f"
model="v" description="Use of dfdl:position() - DFDL-23-134R">
<tdml:document>2;2</tdml:document>
<tdml:infoset>
<tdml:dfdlInfoset>
<f>
<cnt1>2</cnt1>
<a>
<v>1</v>
</a>
<a>
<v>2</v>
</a>
<cnt2>2</cnt2>
<a>
<v>1</v>
</a>
<a>
<v>2</v>
</a>
</f>
</tdml:dfdlInfoset>
</tdml:infoset>
</tdml:parserTestCase>
<tdml:parserTestCase name="dfdlPosition4" root="g"
model="v" description="nested array case. Tests indexes are kept independently.">
<tdml:document><![CDATA[2;2;2;]]></tdml:document>
<tdml:infoset>
<tdml:dfdlInfoset>
<g>
<cnt1>2</cnt1>
<a>
<v>1</v>
<cnt2>2</cnt2>
<b>
<w>1</w>
</b>
<b>
<w>2</w>
</b>
</a>
<a>
<v>2</v>
<cnt2>2</cnt2>
<b>
<w>1</w>
</b>
<b>
<w>2</w>
</b>
</a>
</g>
</tdml:dfdlInfoset>
</tdml:infoset>
</tdml:parserTestCase>
<tdml:parserTestCase name="dfdlPosition5" root="h"
model="v">
<tdml:document>6</tdml:document>
<tdml:infoset>
<tdml:dfdlInfoset>
<h>
<cnt>6</cnt>
<a>
<v>0</v>
</a>
<a>
<v>2</v>
</a>
<a>
<v>0</v>
</a>
<a>
<v>4</v>
</a>
<a>
<v>0</v>
</a>
<a>
<v>6</v>
</a>
</h>
</tdml:dfdlInfoset>
</tdml:infoset>
</tdml:parserTestCase>
<tdml:defineSchema name="checkConstraints">
<dfdl:format ref="ex:daffodilTest1" />
<xs:element name="e1">
<xs:complexType>
<xs:sequence>
<xs:element name="cnt" type="xs:int"
dfdl:lengthKind="delimited" />
<xs:element name="a" minOccurs="0" maxOccurs="unbounded"
dfdl:occursCountKind="expression" dfdl:occursCount="{ xs:int(../ex:cnt) }">
<xs:complexType>
<xs:sequence>
<xs:element name="v" type="xs:int"
dfdl:inputValueCalc="{ dfdl:checkConstraints(.) }" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="e2" dfdl:lengthKind="delimited">
<xs:annotation>
<xs:appinfo source="http://www.ogf.org/dfdl/dfdl-1.0/">
<dfdl:assert test="{ dfdl:checkConstraints(.) }"
message="Assertion failed for dfdl:checkConstraints(.)" />
</xs:appinfo>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:int">
<xs:pattern value="[0-9]+" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="e3" dfdl:lengthKind="delimited">
<xs:annotation>
<xs:appinfo source="http://www.ogf.org/dfdl/dfdl-1.0/">
<dfdl:assert test="{ dfdl:checkConstraints(.) }"
message="Assertion failed for dfdl:checkConstraints(.)" />
</xs:appinfo>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="ex:st1">
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="e4" dfdl:lengthKind="delimited">
<xs:annotation>
<xs:appinfo source="http://www.ogf.org/dfdl/dfdl-1.0/">
<dfdl:assert test="{ dfdl:checkConstraints(.) }"
message="Assertion failed for dfdl:checkConstraints(.)" />
</xs:appinfo>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="ex:st1">
<xs:pattern value="1" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="e5">
<xs:complexType>
<xs:sequence dfdl:initiatedContent="no"
dfdl:separatorPosition="infix" dfdl:separator=",">
<xs:element name="a" minOccurs="0" maxOccurs="3"
type="xs:int" dfdl:occursCountKind="parsed" dfdl:lengthKind="delimited">
<xs:annotation>
<xs:appinfo source="http://www.ogf.org/dfdl/dfdl-1.0/">
<dfdl:assert test="{ dfdl:checkConstraints(.) }"
message="Assertion failed for dfdl:checkConstraints(.)" />
</xs:appinfo>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="e6">
<xs:complexType>
<xs:sequence dfdl:initiatedContent="no"
dfdl:separatorPosition="infix" dfdl:separator=",">
<xs:element name="a" minOccurs="0" maxOccurs="unbounded"
type="xs:int" dfdl:occursCountKind="parsed" dfdl:lengthKind="delimited">
<xs:annotation>
<xs:appinfo source="http://www.ogf.org/dfdl/dfdl-1.0/">
<dfdl:assert test="{ dfdl:checkConstraints(.) }"
message="Assertion failed for dfdl:checkConstraints(.)" />
</xs:appinfo>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:simpleType name="st1">
<xs:restriction base="ex:st2">
<xs:pattern value="[0-9]+" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="st2">
<xs:restriction base="ex:st3">
<xs:pattern value="[0-9]{3}" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="st3">
<xs:restriction base="xs:string">
<xs:pattern value="[0-9]*" />
</xs:restriction>
</xs:simpleType>
</tdml:defineSchema>
<tdml:parserTestCase name="dfdlCheckConstraints"
root="e1" model="checkConstraints" description="DFDL-23-135R">
<!-- check constraints should return true as there are no constraints
on
the data as a result the data values should be '1' -->
<tdml:document>6</tdml:document>
<tdml:infoset>
<tdml:dfdlInfoset>
<e1>
<cnt>6</cnt>
<a>
<v>1</v>
</a>
<a>
<v>1</v>
</a>
<a>
<v>1</v>
</a>
<a>
<v>1</v>
</a>
<a>
<v>1</v>
</a>
<a>
<v>1</v>
</a>
</e1>
</tdml:dfdlInfoset>
</tdml:infoset>
</tdml:parserTestCase>
<tdml:defineSchema name="repeatFlags">
<dfdl:format ref="ex:daffodilTest1" />
<xs:element name="e">
<xs:complexType>
<xs:sequence dfdl:separator="">
<xs:element name="present" type="xs:int"
dfdl:lengthKind="explicit" dfdl:length="1" />
<xs:element name="s" minOccurs="0" maxOccurs="1"
dfdl:occursCountKind="expression" dfdl:occursCount="{ ../ex:present }">
<xs:complexType>
<xs:sequence>
<xs:element name="r" minOccurs="1" maxOccurs="unbounded"
dfdl:occursCountKind="parsed">
<xs:complexType>
<xs:sequence>
<xs:annotation>
<xs:appinfo source="http://www.ogf.org/dfdl/dfdl-1.0/">
<dfdl:discriminator><![CDATA[{
dfdl:position() = 1
or
fn:trace(../ex:r,"r")[dfdl:position() - 1]/ex:more = 1
}]]></dfdl:discriminator>
</xs:appinfo>
</xs:annotation>
<xs:element name="more" type="xs:int"
dfdl:lengthKind="explicit" dfdl:length="1" />
<xs:element name="c" type="xs:string"
dfdl:lengthKind="explicit" dfdl:length="1" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="extra" type="xs:string" dfdl:lengthKind="delimited"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</tdml:defineSchema>
<!--
Test Name: repeatFlags1
Schema: repeatFlags
Purpose: This test demonstrates the use of presence and repeat flags. In this case, the presence flag is 0,
so there are no occurrences.
-->
<tdml:parserTestCase name="repeatFlags1" model="repeatFlags" description="Section 23 - Uses of Expression Language - DFDL-23-003R"
root="e">
<tdml:document>0</tdml:document>
<tdml:infoset>
<tdml:dfdlInfoset>
<e>
<present>0</present>
<extra></extra>
</e>
</tdml:dfdlInfoset>
</tdml:infoset>
</tdml:parserTestCase>
<!--
Test Name: repeatFlags2
Schema: repeatFlags
Purpose: This test demonstrates the use of presence and repeat flags. In this case, the presence flag is 1,
so there is at least one occurrence. The repeat flag is 0, so there is only one occurrence, which
in this case is the character "A".
-->
<tdml:parserTestCase name="repeatFlags2" model="repeatFlags" description="Section 23 - Uses of Expression Language - DFDL-23-003R"
root="e">
<tdml:document>10A</tdml:document>
<tdml:infoset>
<tdml:dfdlInfoset>
<e>
<present>1</present>
<s>
<r>
<more>0</more>
<c>A</c>
</r>
</s>
<extra></extra>
</e>
</tdml:dfdlInfoset>
</tdml:infoset>
</tdml:parserTestCase>
<!--
Test Name: repeatFlags3
Schema: repeatFlags
Purpose: This test demonstrates the use of presence and repeat flags. In this case, the presence flag is 1,
so there is at least one occurrence. The repeat flag is 1, so there is at least one more, etc.
-->
<tdml:parserTestCase name="repeatFlags3" model="repeatFlags" description="Section 23 - Uses of Expression Language - DFDL-23-003R"
root="e">
<tdml:document>11A1B1C0D</tdml:document>
<tdml:infoset>
<tdml:dfdlInfoset>
<e>
<present>1</present>
<s>
<r>
<more>1</more>
<c>A</c>
</r>
<r>
<more>1</more>
<c>B</c>
</r>
<r>
<more>1</more>
<c>C</c>
</r>
<r>
<more>0</more>
<c>D</c>
</r>
</s>
<extra></extra>
</e>
</tdml:dfdlInfoset>
</tdml:infoset>
</tdml:parserTestCase>
<!--
Test Name: repeatFlags4
Schema: repeatFlags
Purpose: This test demonstrates the use of presence and repeat flags. In this case, though the fourth repeat bit
is 0, there is more data, which should be caught by the "extra" element and not included in the primary
element tree
-->
<tdml:parserTestCase name="repeatFlags4" model="repeatFlags" description="Section 23 - Uses of Expression Language - DFDL-23-003R"
root="e">
<tdml:document>11A1B1C0D1E1F0G</tdml:document>
<tdml:infoset>
<tdml:dfdlInfoset>
<e>
<present>1</present>
<s>
<r>
<more>1</more>
<c>A</c>
</r>
<r>
<more>1</more>
<c>B</c>
</r>
<r>
<more>1</more>
<c>C</c>
</r>
<r>
<more>0</more>
<c>D</c>
</r>
</s>
<extra>1E1F0G</extra>
</e>
</tdml:dfdlInfoset>
</tdml:infoset>
</tdml:parserTestCase>
<!--
Test Name: repeatFlags5
Schema: repeatFlags
Purpose: This test demonstrates the use of presence and repeat flags. In this case, the presence flag is 0, but there
is still data in the document. This data should be consumed by the "extra" element and not included in the primary
element tree
-->
<tdml:parserTestCase name="repeatFlags5" model="repeatFlags" description="Section 23 - Uses of Expression Language - DFDL-23-003R"
root="e">
<tdml:document>01A1B1C1D1E1F0G</tdml:document>
<tdml:infoset>
<tdml:dfdlInfoset>
<e>
<present>0</present>
<extra>1A1B1C1D1E1F0G</extra>
</e>
</tdml:dfdlInfoset>
</tdml:infoset>
</tdml:parserTestCase>
<tdml:defineSchema name="repeatBitFlags">
<dfdl:format ref="ex:daffodilTest1" lengthUnits="bits"
lengthKind="implicit" alignment="1" alignmentUnits="bits"
representation="binary" byteOrder="bigEndian" />
<xs:element name="bit1" type="xs:unsignedInt"
dfdl:lengthKind="explicit" dfdl:length="1" dfdl:byteOrder="littleEndian" />
<!-- intended for use in arrays with occursCountKind='parsed' environments -->
<xs:group name="more">
<xs:sequence>
<xs:annotation>
<xs:appinfo source="http://www.ogf.org/dfdl/dfdl-1.0/">
<dfdl:discriminator><![CDATA[{
dfdl:position() = 1
or
../ex:r[dfdl:position() - 1]/ex:more = 1
}]]></dfdl:discriminator>
</xs:appinfo>
</xs:annotation>
<xs:element name="more" type="xs:unsignedInt"
dfdl:lengthKind="explicit" dfdl:length="1" />
</xs:sequence>
</xs:group>
<xs:element name="e">
<xs:complexType>
<xs:sequence>
<xs:element name="present" type="xs:unsignedInt"
dfdl:lengthKind="explicit" dfdl:length="1" />
<xs:element name="s" minOccurs="0" maxOccurs="1"
dfdl:occursCountKind="expression" dfdl:occursCount="{ ../ex:present }">
<xs:complexType>
<xs:sequence>
<xs:element name="r" minOccurs="1" maxOccurs="unbounded"
dfdl:occursCountKind="parsed">
<xs:complexType>
<xs:sequence>
<xs:group ref="ex:more" />
<xs:element name="c" type="xs:unsignedInt"
dfdl:lengthKind="explicit" dfdl:length="3" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="f">
<xs:complexType>
<xs:sequence dfdl:separator="">
<xs:element name="present" type="xs:unsignedInt"
dfdl:lengthKind="explicit" dfdl:length="1" />
<xs:element name="s" minOccurs="0" maxOccurs="1"
dfdl:occursCountKind="expression" dfdl:occursCount="{ ../ex:present }">
<xs:complexType>
<xs:sequence>
<xs:element name="r" minOccurs="1" maxOccurs="unbounded"
dfdl:occursCountKind="parsed">
<xs:complexType>
<xs:sequence>
<xs:group ref="ex:more" />
<xs:element name="c" type="xs:unsignedInt"
dfdl:lengthKind="explicit" dfdl:length="3" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="extra" minOccurs="0" type="xs:unsignedInt" dfdl:lengthKind="explicit" dfdl:length="8"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</tdml:defineSchema>
<tdml:parserTestCase name="bit1" model="repeatBitFlags"
root="bit1">
<tdml:document>
<tdml:documentPart type="bits">1</tdml:documentPart>
</tdml:document>
<tdml:infoset>
<tdml:dfdlInfoset>
<bit1>1</bit1>
</tdml:dfdlInfoset>
</tdml:infoset>
</tdml:parserTestCase>
<!--
Test Name: repeatBitFlags1
Schema: repeatBitFlags
Purpose: This test demonstrates the use of presence and repeat bits. In this case, the presence bit is 0,
so there are no occurrences.
-->
<tdml:parserTestCase name="repeatBitFlags1" model="repeatBitFlags" description="Section 23 - Uses of Expression Language - DFDL-23-003R"
root="e">
<tdml:document>
<tdml:documentPart type="bits">0</tdml:documentPart>
</tdml:document>
<tdml:infoset>
<tdml:dfdlInfoset>
<e>
<present>0</present>
</e>
</tdml:dfdlInfoset>
</tdml:infoset>
</tdml:parserTestCase>
<!--
Test Name: repeatBitFlags2
Schema: repeatBitFlags
Purpose: This test demonstrates the use of presence and repeat bits. In this case, the presence bit is 1,
so there is at least one occurrence. The repeat bit is zero, so there will only be one occurrence,
which in this case is the binary representation (in 3 bits) of 1.
-->
<tdml:parserTestCase name="repeatBitFlags2" model="repeatBitFlags" description="Section 23 - Uses of Expression Language - DFDL-23-003R"
root="e">
<tdml:document>
<tdml:documentPart type="bits">1 0 001</tdml:documentPart>
</tdml:document>
<tdml:infoset>
<tdml:dfdlInfoset>
<e>
<present>1</present>
<s>
<r>
<more>0</more>
<c>1</c>
</r>
</s>
</e>
</tdml:dfdlInfoset>
</tdml:infoset>
</tdml:parserTestCase>
<!--
Test Name: repeatBitFlags3
Schema: repeatBitFlags
Purpose: This test demonstrates the use of presence and repeat bits. In this case, the presence bit is 1,
so there is at least one occurrence. The repeat bit is 1, so after this occurrence there will be at least one more.
After the first occurrence of the c element, the next repeat bit is also 1, followed by the next occurrence, etc.
Eventually the repeat bit is 0, so the last bit of data is consumed, and parsing stops.
-->
<tdml:parserTestCase name="repeatBitFlags3" model="repeatBitFlags" description="Section 23 - Uses of Expression Language - DFDL-23-003R"
root="e">
<tdml:document>
<tdml:documentPart type="bits">1 1 001 1 010 1 011 0 100</tdml:documentPart>
</tdml:document>
<tdml:infoset>
<tdml:dfdlInfoset>
<e>
<present>1</present>
<s>
<r>
<more>1</more>
<c>1</c>
</r>
<r>
<more>1</more>
<c>2</c>
</r>
<r>
<more>1</more>
<c>3</c>
</r>
<r>
<more>0</more>
<c>4</c>
</r>
</s>
</e>
</tdml:dfdlInfoset>
</tdml:infoset>
</tdml:parserTestCase>
<!--
Test Name: repeatBitFlags4
Schema: repeatBitFlags
Purpose: This test demonstrates the use of presence and repeat bits. In this case, the presence bit is 1,
so there is at least one occurrence. The repeat bit is zero, so there will only be one occurrence.
However, the document has extra data and the test runner should complain that there is leftover data.
-->
<tdml:parserTestCase name="repeatBitFlags4" model="repeatBitFlags" description="Section 23 - Uses of Expression Language - DFDL-23-003R"
root="e">
<tdml:document>
<tdml:documentPart type="bits">1 0 001 0 010</tdml:documentPart>
</tdml:document>
<tdml:errors>
<tdml:error>Left over data</tdml:error>
</tdml:errors>
</tdml:parserTestCase>
<!--
Test Name: repeatBitFlags5
Schema: repeatBitFlags
Purpose: This test demonstrates the use of presence and repeat bits. In this case, the presence bit is 1,
so there is at least one occurrence. The repeat bit is zero, so there will only be one occurrence.
However, the document has extra data which should be parsed as the "extra" element.
-->
<tdml:parserTestCase name="repeatBitFlags5" model="repeatBitFlags" description="Section 23 - Uses of Expression Language - DFDL-23-003R"
root="f">
<tdml:document>
<tdml:documentPart type="bits">1 1 001 0 010 1 101 0 111</tdml:documentPart>
</tdml:document>
<tdml:infoset>
<tdml:dfdlInfoset>
<f>
<present>1</present>
<s>
<r>
<more>1</more>
<c>1</c>
</r>
<r>
<more>0</more>
<c>2</c>
</r>
</s>
<extra>215</extra>
</f>
</tdml:dfdlInfoset>
</tdml:infoset>
</tdml:parserTestCase>
<!--
Test Name: repeatBitFlags6
Schema: repeatBitFlags
Purpose: This test demonstrates the use of presence and repeat bits. In this case, the presence bit is 1,
so there is at least one occurrence. The repeat bit is 1, so there will be another occurrence, and so forth.
In this case the optional extra element should not be needed.
-->
<tdml:parserTestCase name="repeatBitFlags6" model="repeatBitFlags" description="Section 23 - Uses of Expression Language - DFDL-23-003R"
root="f">
<tdml:document>
<tdml:documentPart type="bits">1 1 001 1 010 1 101 0 111</tdml:documentPart>
</tdml:document>
<tdml:infoset>
<tdml:dfdlInfoset>
<f>
<present>1</present>
<s>
<r>
<more>1</more>
<c>1</c>
</r>
<r>
<more>1</more>
<c>2</c>
</r>
<r>
<more>1</more>
<c>5</c>
</r>
<r>
<more>0</more>
<c>7</c>
</r>
</s>
</f>
</tdml:dfdlInfoset>
</tdml:infoset>
</tdml:parserTestCase>
<!--
Test Name: invalid_enum_1
Schema: expressions_broken.dfdl.xsd
Purpose: This test demonstrates that it is a schema definition error if a value other than one of the
enumerated values is specified for a schema property.
-->
<tdml:parserTestCase name="invalid_enum_1" model="expressions_broken.dfdl.xsd"
description="Section 06 - DFDL Expressions - DFDL-6-083R" root="e1">
<tdml:document>
<tdml:documentPart type="text">word</tdml:documentPart>
</tdml:document>
<tdml:errors>
<tdml:error>Schema Definition Error</tdml:error>
<tdml:error>Value 'hieroglyphs' is not facet-valid with respect to enumeration</tdml:error>
</tdml:errors>
</tdml:parserTestCase>
<!--
Test Name: invalid_enum_2
Schema: expressions_broken_2.dfdl.xsd
Purpose: This test demonstrates that it is a schema definition error if the case of the specified value
does not match the expected case for the enumeration.
-->
<tdml:parserTestCase name="invalid_enum_2" model="expressions_broken_2.dfdl.xsd"
description="Section 06 - DFDL Expressions - DFDL-6-084R" root="e1">
<tdml:document>
<tdml:documentPart type="text">word</tdml:documentPart>
</tdml:document>
<tdml:errors>
<tdml:error>Schema Definition Error</tdml:error>
<tdml:error>Value 'TExT' is not facet-valid with respect to enumeration</tdml:error>
</tdml:errors>
</tdml:parserTestCase>
<!--
Test Name: invalid_enum_3
Schema: expressions_broken_3.dfdl
Purpose: This test demonstrates that enumerations are strings unless otherwise stated.
-->
<tdml:parserTestCase name="invalid_enum_3" model="expressions_broken_3.dfdl.xsd"
description="Section 06 - DFDL Expressions - DFDL-6-085R" root="e1">
<tdml:document>
<tdml:documentPart type="text">word</tdml:documentPart>
</tdml:document>
<tdml:errors>
<tdml:error>Schema Definition Error</tdml:error>
<tdml:error>Value '0' is not facet-valid with respect to enumeration</tdml:error>
</tdml:errors>
</tdml:parserTestCase>
<tdml:defineSchema name="expressionRules">
<dfdl:format ref="ex:daffodilTest1" lengthKind="delimited"
lengthUnits="bytes" encoding="US-ASCII" separator="" initiator=""
terminator="" occursCountKind="parsed" ignoreCase="no"
textNumberRep="standard" representation="text" />
<xs:element name="e_01" dfdl:lengthKind="implicit">
<xs:complexType>
<xs:sequence dfdl:separator=".">
<xs:element name="e1" type="xs:int"
dfdl:lengthKind="explicit" dfdl:length="1" />
<xs:element name="e2" type="xs:string"
dfdl:lengthKind="delimited" dfdl:inputValueCalc="{fn:concat(../ex:e1, '}')}" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="e_02" dfdl:lengthKind="implicit">
<xs:complexType>
<xs:sequence dfdl:separator=".">
<xs:element name="e1" type="xs:int"
dfdl:lengthKind="explicit" dfdl:length="1" />
<xs:element name="e2" type="xs:string"
dfdl:lengthKind="delimited" dfdl:inputValueCalc="{'}'}" />
</xs:sequence>
</xs:complexType>
</xs:element>
<!--
<xs:element name="e_03" dfdl:lengthKind="implicit">
<xs:complexType>
<xs:sequence dfdl:separator=".">
<xs:element name="e1" type="xs:int"
dfdl:lengthKind="explicit" dfdl:length="1" />
<xs:element name="e2" type="xs:string"
dfdl:lengthKind="delimited" dfdl:inputValueCalc="{{" />
</xs:sequence>
</xs:complexType>
</xs:element>
-->
</tdml:defineSchema>
<!--
Test Name: expressionRules01
Schema: expressionRules
Root: e_01
Purpose: This test demonstrates that { used anywhere but the first position in an expression is treated as a literal
-->
<tdml:parserTestCase name="expressionRules01" root="e_01"
model="expressionRules" description="Section 6 - DFDL Expressions - DFDL-06-076R">
<tdml:document>3</tdml:document>
<tdml:infoset>
<tdml:dfdlInfoset>
<ex:e_01>
<ex:e1>3</ex:e1>
<ex:e2>3}</ex:e2>
</ex:e_01>
</tdml:dfdlInfoset>
</tdml:infoset>
</tdml:parserTestCase>
<!--
Test Name: expressionRules02
Schema: expressionRules
Root: e_02
Purpose: This test demonstrates that } used anywhere but the first position in an expression is treated as a literal
-->
<tdml:parserTestCase name="expressionRules02" root="e_02"
model="expressionRules" description="Section 6 - DFDL Expressions - DFDL-06-077R">
<tdml:document>3</tdml:document>
<tdml:infoset>
<tdml:dfdlInfoset>
<ex:e_02>
<ex:e1>3</ex:e1>
<ex:e2>}</ex:e2>
</ex:e_02>
</tdml:dfdlInfoset>
</tdml:infoset>
</tdml:parserTestCase>
<!--
Test Name: expressionRules03
Schema: expressionRules
Root: e_03
Purpose: This test demonstrates that {{ as the first characters are treated as the literal '{' and not a DFDL expression
-->
<tdml:parserTestCase name="expressionRules03" root="e_03"
model="expressionRules" description="Section 6 - DFDL Expressions - DFDL-06-078R">
<tdml:document>3</tdml:document>
<tdml:infoset>
<tdml:dfdlInfoset>
<ex:e_01>
<ex:e1>3</ex:e1>
<ex:e2>}</ex:e2>
</ex:e_01>
</tdml:dfdlInfoset>
</tdml:infoset>
</tdml:parserTestCase>
<!--
Test Name: regexLookahead
Schema: newRegex
Root: s1
Purpose: This test demonstrates the use of a lookahead regex to determine the length
-->
<tdml:parserTestCase name="regexLookahead" root="s1"
model="newRegex" description="Section - - DFDL-R">
<tdml:document>45someletters</tdml:document>
<tdml:infoset>
<tdml:dfdlInfoset>
<s1>
<e1>45</e1>
<extra>someletters</extra>
</s1>
</tdml:dfdlInfoset>
</tdml:infoset>
</tdml:parserTestCase>
<!--
Test Name: regexLookaheadFail
Schema: newRegex
Root: s1
Purpose: This test demonstrates the case that a lookahead regex fails to find a match
-->
<tdml:parserTestCase name="regexLookaheadFail" root="s1"
model="newRegex" description="Section - - DFDL-R">
<tdml:document>45</tdml:document>
<tdml:errors>
<tdml:error>Parse Error</tdml:error>
<tdml:error>StringPatternMatched</tdml:error>
<tdml:error>No match found!</tdml:error>
</tdml:errors>
</tdml:parserTestCase>
<!--
Test Name: regexLookaheadFail2
Schema: newRegex
Root: s3
Purpose: This test demonstrates that the pattern facet uses the XML Schema Regex library, which does not have lookaheads
-->
<tdml:parserTestCase name="regexLookaheadFail2" root="s3"
model="newRegex" description="Section - - DFDL-R">
<tdml:document>45someletters</tdml:document>
<tdml:errors>
<tdml:error>Assertion failed for dfdl:checkConstraints</tdml:error>
</tdml:errors>
</tdml:parserTestCase>
<!--
Test Name: regexCompatFail
Schema: newRegex
Root: s4
Purpose: This test
-->
<tdml:parserTestCase name="regexCompatFail" root="s4"
model="newRegex" description="Section - - DFDL-R">
<tdml:document>45someletters</tdml:document>
<tdml:infoset>
<tdml:dfdlInfoset>
<s1>
<e1>45</e1>
<extra>someletters</extra>
</s1>
</tdml:dfdlInfoset>
</tdml:infoset>
</tdml:parserTestCase>
<!--
Test Name: indexLimit
Schema: csv.dfdl.xsd
Purpose: This test attempts to find an upper-limit to array indexing within expressions.
It parses a large csv file, hides the actual data, and prints out the 29,030th entry.
-->
<tdml:parserTestCase name="indexLimit" model="csv_mod_hidden.dfdl.xsd" root="file"
description="Section 23 - Uses of Expression Language - DFDL-23-003R">
<tdml:document>
<tdml:documentPart type="file">csv_1.6m</tdml:documentPart>
</tdml:document>
<tdml:infoset>
<tdml:dfdlInfoset>
<file>
<header>
<title>last</title>
<title>first</title>
<title>sigil</title>
</header>
<scoop>lannister</scoop>
</file>
</tdml:dfdlInfoset>
</tdml:infoset>
</tdml:parserTestCase>
</tdml:testSuite>