case insensitivity

In IMF, headers are generally case insensitive. Thus these are equivalent: Content-Type: text/html Content-Type: TEXT/HTML Content-Type: Text/Html Content-Type: tExT/hTmL Does DFDL have a way to tell the parser to parse text in a case-insensitive manner? A quick search of the spec didn't reveal anything.

DFDL 1.0 has dfdl:ignoreCase 'yes' for use when parsing delimiters and other cases where the DFDL parser is trying to match against a user-specified string, but there is no property for changing the case of data when it is inserted into the infoset. That sort of thing is typically considered a post parse transformation step. However you can achieve the same effect by using an additional dummy element that uses dfdl:inputValueCalc. <xs:sequence> <xs:element name="ContentTypeRaw" type="xs:string" dfdl:lengthKind="delimited" ... /> <xs:element name="ContentType" type="xs:string" dfdl:inputValueCalc="{fn:lower-case(../ContentTypeRaw}" ... /> </xs:sequence> And if you only want the normalized element to appear in the infoset... <xs:sequence> <xs:sequence dfdl:hiddenGroupRef="ContentTypeRaw" ... /> <xs:element name="ContentType" type="xs:string" dfdl:inputValueCalc="{fn:lower-case(../ContentTypeRaw}" ... /> </xs:sequence> <xs:group name="ContentTypeRaw"> <xs:sequence> <xs:element name="ContentTypeRaw" type="xs:string" dfdl:lengthKind="delimited" ... /> </xs:sequence> </xs:group> 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: "Garriss Jr., James P." <jgarriss@mitre.org> To: "dfdl-wg@ogf.org" <dfdl-wg@ogf.org>, Date: 01/04/2013 14:42 Subject: [DFDL-WG] case insensitivity Sent by: dfdl-wg-bounces@ogf.org In IMF, headers are generally case insensitive. Thus these are equivalent: Content-Type: text/html Content-Type: TEXT/HTML Content-Type: Text/Html Content-Type: tExT/hTmL Does DFDL have a way to tell the parser to parse text in a case-insensitive manner? A quick search of the spec didn’t reveal anything.-- 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
participants (2)
-
Garriss Jr., James P.
-
Steve Hanson