Respin of this example:
Here's the example as suggested by Jonathan of how to issue an error that I previously was suggesting needed fn:error. I'm convinced this is sufficient and we can avoid the need for fn:error now.
<xs:element name="magic_number" type="ex:uint32" dfdl:byteOrder="bigEndian">
<xs:annotation>
<xs:appinfo source="http://www.ogf.org/dfdl/">
<dfdl:assert
test="{ (xs:unsignedInt(.) eq dfdl:unsignedInt('xa1b2c3d4')) |
(xs:unsignedInt(.) eq dfdl:unsignedInt('xd4c3b2a1')) }"
message="{ fn:concat(
'Magic number ',
dfdl:hexBinary(dfdl:unsignedInt(.)),
' was not 0xA1B2C3D4 (for bigEndian) or 0xD4C3B2A1 (for littleEndian).' }" />
<dfdl:setVariable ref="ex:bOrd">{ xs:unsignedInt(.) }<dfdl:setVariable>
</xs:appinfo>
</xs:annotation>
</xs:element>On Wed, Jul 24, 2013 at 11:58 AM, Steve Hanson <smh@uk.ibm.com> wrote:
Mike, I think you meant:
test="{ (xs:unsignedInt(.) eq dfdl:unsignedInt('xa1b2c3d4')) |
(xs:unsignedInt(.) eq dfdl:unsignedInt('xd4c3b2a1')) }"
Regards
Steve Hanson
Architect, IBM Data Format Description Language (DFDL)
Co-Chair, OGF DFDL Working Group
IBM SWG, Hursley, UK
smh@uk.ibm.com
tel:+44-1962-815848
From: Mike Beckerle <mbeckerle.dfdl@gmail.com>
To: dfdl-wg@ogf.org,
Date: 24/07/2013 16:46
Subject: [DFDL-WG] still no need for fn:error
Sent by: dfdl-wg-bounces@ogf.org
Here's the example as suggested by Jonathan of how to issue an error that I previously was suggesting needed fn:error. I'm convinced this is sufficient and we can avoid the need for fn:error now.
<xs:element name="magic_number" type="ex:uint32" dfdl:byteOrder="bigEndian">
<xs:annotation>
<xs:appinfo source="http://www.ogf.org/dfdl/">
<dfdl:assert
test="{ (xs:unsignedInt(.) eq dfdl:unsignedInt('xa1b2c3d4')) |
(xs:unsignedInt(.) eq dfdl:unsignedInt('xd4c3b2a1')) }"
message="{ fn:concat(
'Magic number ',
dfdl:hexBinary(dfdl:unsignedInt(.)),
' was not 0xA1B2C3D4 (for bigEndian) or 0xD4C3B2A1 (for littleEndian).' }" />
<dfdl:setVariable ref="ex:bOrd">{ xs:unsignedInt(.) }<dfdl:setVariable>
</xs:appinfo>
</xs:annotation>
</xs:element>
--
Mike Beckerle | OGF DFDL Workgroup Co-Chair | Tresys Technology | www.tresys.com
--
dfdl-wg mailing list
dfdl-wg@ogf.org
https://www.ogf.org/mailman/listinfo/dfdl-wg
Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
--
Mike Beckerle | OGF DFDL Workgroup Co-Chair | Tresys Technology | www.tresys.com