
It sounds like you need two DFDL schemas and two parse operations. The first schema models the whole message. It takes the whole data stream as input and creates an infoset for Header, Field1, Field2, Field3. The second schema models just Field 4 using leadingSkip and trailingSkip to position correctly. It takes the Header from the first infoset as input, and creates an infoset for Field4. <xs:element name="Field4" type="xs:hexBinary" dfdl:lengthKind="explicit" dfdl:length="3" dfdl:lengthUnits="bytes" dfdl:leadingSkip="316" dfdl:trailingSkip="193" dfdl:alignmentUnits="bytes" /> 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: Miguel Vieira <carlos.vieira@gmv.com> To: Steve Hanson/UK/IBM@IBMGB Cc: "dfdl-wg@ogf.org" <dfdl-wg@ogf.org> Date: 17/09/2012 18:04 Subject: RE: [DFDL-WG] Specify field based on the beggining of the binary file Hi Steve! I need them both. From: Steve Hanson [mailto:smh@uk.ibm.com] Sent: segunda-feira, 17 de Setembro de 2012 18:00 To: Miguel Vieira Cc: dfdl-wg@ogf.org Subject: RE: [DFDL-WG] Specify field based on the beggining of the binary file Is Field4 the only part of the Header that is of interest? Do you want the full Header (as a 512 byte BLOB) and Field4 in the infoset? 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: Miguel Vieira <carlos.vieira@gmv.com> To: Steve Hanson/UK/IBM@IBMGB Cc: "dfdl-wg@ogf.org" <dfdl-wg@ogf.org> Date: 17/09/2012 16:06 Subject: RE: [DFDL-WG] Specify field based on the beggining of the binary file First of all: Thanks! J My binary data specification is: Header: 512Bytes; Field1: 21504 bytes (21KB); Field2: 5Bytes; Field3: 1Byte; Field4: 3 Bytes ßStating at byte 316 counting from the beginning of the file. This means that Field4 is placed inside the Header field. “leadingSkipBytes” or “alignment” would do, but can you specify the place you start counting? Thanks. Miguel From: Steve Hanson [mailto:smh@uk.ibm.com] Sent: segunda-feira, 17 de Setembro de 2012 15:41 To: Miguel Vieira Cc: dfdl-wg@ogf.org Subject: Re: [DFDL-WG] Specify field based on the beggining of the binary file Miguel, please can you send us a graphic of the data in question, I want to make sure I have understood your data correctly. 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: Miguel Vieira <carlos.vieira@gmv.com> To: "dfdl-wg@ogf.org" <dfdl-wg@ogf.org> Date: 17/09/2012 15:03 Subject: [DFDL-WG] Specify field based on the beggining of the binary file Sent by: dfdl-wg-bounces@ogf.org Hi! I have a binary file specification that specifies some fields referenced by the beginning of the binary info. For instance imagine that there is a field with 1024Bytes and the next one starts at byte 512 counting from the beginning of the info. Is it possible to do that using dfdl? I’ve seen dfdl:floating, but I can’t find much info on that. Thanks. P Please consider the environment before printing this e-mail. This message including any attachments may contain confidential information, according to our Information Security Management System, and intended solely for a specific individual to whom they are addressed. Any unauthorised copy, disclosure or distribution of this message is strictly forbidden. If you have received this transmission in error, please notify the sender immediately and delete it. Este mensaje, y en su caso, cualquier fichero anexo al mismo, puede contener información clasificada por su emisor como confidencial en el marco de su Sistema de Gestión de Seguridad de la Información siendo para uso exclusivo del destinatario, quedando prohibida su divulgación copia o distribución a terceros sin la autorización expresa del remitente. Si Vd. ha recibido este mensaje erróneamente, se ruega lo notifique al remitente y proceda a su borrado. Gracias por su colaboración. Esta mensagem, incluindo qualquer ficheiro anexo, pode conter informação confidencial, de acordo com nosso Sistema de Gestão de Segurança da Informação, sendo para uso exclusivo do destinatário e estando proibida a sua divulgação, cópia ou distribuição a terceiros sem autorização expressa do remetente da mesma. Se recebeu esta mensagem por engano, por favor avise de imediato o remetente e apague-a. Obrigado pela sua colaboração. -- 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 P Please consider the environment before printing this e-mail. This message including any attachments may contain confidential information, according to our Information Security Management System, and intended solely for a specific individual to whom they are addressed. Any unauthorised copy, disclosure or distribution of this message is strictly forbidden. If you have received this transmission in error, please notify the sender immediately and delete it. Este mensaje, y en su caso, cualquier fichero anexo al mismo, puede contener informacin clasificada por su emisor como confidencial en el marco de su Sistema de Gestin de Seguridad de la Informacin siendo para uso exclusivo del destinatario, quedando prohibida su divulgacin copia o distribucin a terceros sin la autorizacin expresa del remitente. Si Vd. ha recibido este mensaje errneamente, se ruega lo notifique al remitente y proceda a su borrado. Gracias por su colaboracin. Esta mensagem, incluindo qualquer ficheiro anexo, pode conter informao confidencial, de acordo com nosso Sistema de Gesto de Segurana da Informao, sendo para uso exclusivo do destinatrio e estando proibida a sua divulgao, cpia ou distribuio a terceiros sem autorizao expressa do remetente da mesma. Se recebeu esta mensagem por engano, por favor avise de imediato o remetente e apague-a. Obrigado pela sua colaborao. 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 P Please consider the environment before printing this e-mail. This message including any attachments may contain confidential information, according to our Information Security Management System, and intended solely for a specific individual to whom they are addressed. Any unauthorised copy, disclosure or distribution of this message is strictly forbidden. If you have received this transmission in error, please notify the sender immediately and delete it. Este mensaje, y en su caso, cualquier fichero anexo al mismo, puede contener informacin clasificada por su emisor como confidencial en el marco de su Sistema de Gestin de Seguridad de la Informacin siendo para uso exclusivo del destinatario, quedando prohibida su divulgacin copia o distribucin a terceros sin la autorizacin expresa del remitente. Si Vd. ha recibido este mensaje errneamente, se ruega lo notifique al remitente y proceda a su borrado. Gracias por su colaboracin. Esta mensagem, incluindo qualquer ficheiro anexo, pode conter informao confidencial, de acordo com nosso Sistema de Gesto de Segurana da Informao, sendo para uso exclusivo do destinatrio e estando proibida a sua divulgao, cpia ou distribuio a terceiros sem autorizao expressa do remetente da mesma. Se recebeu esta mensagem por engano, por favor avise de imediato o remetente e apague-a. Obrigado pela sua colaborao. 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