Can I prevent data from getting into the infoset?

Suppose I have an email address with 3 parts, a display name, a local part, and a domain. "James Garriss" <jgarriss@mitre.org> Display name = James Garriss Local part = jgarriss Domain = mitre.org DFDL is capable of parsing and validating these as three elements. No problem. But let's suppose that I don't want one of these elements, the display name, to make it into the infoset. I just want to drop it on the floor after I parse it. Question #1: Can I do that? If so, how? Alternatively, suppose I want it in the infoset, but then I want to programmatically remove it from the infoset *before* I unparse it. Question #2: Is that possible? If so, how? TIA

The DFDL mechanism is dfdl:hiddenGroupRef. It is fully described in the spec section 14.5, with an example. There is a bigger example in section 17, which shows how to use dfdl:hiddenGroupRef and dfdl:inputValueCalc and dfdl:outputValueCalc to 'synthesise' items in the infoset from hidden items in the data. None of these three properties are supported by IBM DFDL as yet. You can do what you want with the infoset post-parse, that is beyond the scope of the DFDL spec. But bear in mind that if an element is minOccurs > '0' then the serializer will expect it to be there, and give an error unless you supply a default value. You need to be careful what you drop as well. Dropping DisplayName might make sense, so your data looks like <jgarriss@mitre.org>, but dropping Domain might result in “James Garriss” <jgarriss@>, it depends on what is being treated as delimiters. Regards Steve Hanson Architect, 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/03/2013 12:42 Subject: [DFDL-WG] Can I prevent data from getting into the infoset? Sent by: dfdl-wg-bounces@ogf.org Suppose I have an email address with 3 parts, a display name, a local part, and a domain. “James Garriss” <jgarriss@mitre.org> Display name = James Garriss Local part = jgarriss Domain = mitre.org DFDL is capable of parsing and validating these as three elements. No problem. But let’s suppose that I don’t want one of these elements, the display name, to make it into the infoset. I just want to drop it on the floor after I parse it. Question #1: Can I do that? If so, how? Alternatively, suppose I want it in the infoset, but then I want to programmatically remove it from the infoset *before* I unparse it. Question #2: Is that possible? If so, how? TIA-- 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