Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -297,29 +297,32 @@ object NodeInfo extends Enum {
/**
* Nothing is the bottom of the type lattice.
*
* It is the return type of the dfdlx:error() function. It's a subtype of
* It is the return type of the fn:error() function. It's a subtype of
* every type (except some special singletons like ArrayType).
*/
lazy val Nothing = new TypeNode(
Seq(
Boolean,
Complex,
Array,
ArrayIndex,
Double,
Float,
Date,
Time,
DateTime,
UnsignedByte,
Byte,
HexBinary,
AnyURI,
String,
NonEmptyString
),
Nil
) with Boolean.Kind
protected sealed trait NothingKind extends NodeInfo.Kind
case object Nothing
extends TypeNode(
Seq(
Boolean,
Complex,
Array,
ArrayIndex,
Double,
Float,
Date,
Time,
DateTime,
UnsignedByte,
Byte,
HexBinary,
AnyURI,
String,
NonEmptyString
),
Nil
)
with Boolean.Kind
with Complex.Kind
with Array.Kind
with ArrayIndex.Kind
Expand All @@ -332,7 +335,9 @@ object NodeInfo extends Enum {
with Byte.Kind
with HexBinary.Kind
with NonEmptyString.Kind
with AnyURI.Kind
with AnyURI.Kind {
sealed trait Kind extends NothingKind
}

/**
* All complex types are represented by this one type object.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,15 @@
</xs:complexType>
</xs:element>

<xs:element name="err_05">
<xs:complexType>
<xs:sequence>
<xs:element name="err1" type="xs:string"
dfdl:outputValueCalc="{fn:round-half-to-even(fn:error('This is the error string'))}" />
</xs:sequence>
</xs:complexType>
</xs:element>

<xs:element name="refSimpleElementWithOvc">
<xs:complexType>
<xs:sequence>
Expand Down Expand Up @@ -766,6 +775,26 @@

</tdml:unparserTestCase>

<tdml:unparserTestCase name="errorInRoundHalfToEven"
root="err_05" model="outputValueCalc-Embedded.dfdl.xsd"
description="Calling fn:error() inside fn:round-half-to-even()">
<tdml:infoset>
<tdml:dfdlInfoset xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ex:err_05>
<err1>a</err1>
</ex:err_05>
</tdml:dfdlInfoset>
</tdml:infoset>
<tdml:document />

<tdml:errors>
<tdml:error>Unparse Error</tdml:error>
<tdml:error>This is the error string</tdml:error>
</tdml:errors>

</tdml:unparserTestCase>

<tdml:unparserTestCase name="refSimpleTypeElemWithOvc"
root="refSimpleElementWithOvc" model="outputValueCalc-Embedded.dfdl.xsd"
description="An element referencing a simpleType Elem with an OVC" roundTrip="false">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class TestOutputValueCalc1 extends TdmlTests {
@Test def errorOneArg = test
@Test def errorTwoArg = test
@Test def errorThreeArg = test
@Test def errorInRoundHalfToEven = test

// DAFFODIL-1701
@Test def refSimpleTypeElemWithOvc = test
Expand Down
Loading