ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum IndexWebSphere Message Broker SupportData for DFDL xsd

Post new topicReply to topic
Data for DFDL xsd View previous topic :: View next topic
Author Message
mqbrks
PostPosted: Thu May 04, 2017 8:32 am Post subject: Data for DFDL xsd Reply with quote

Acolyte

Joined: 17 Jan 2012
Posts: 52

Hi All,

I am trying to prepare a file for the xsd(dfdl) and require help to fix the data.
This is my xsd
Code:
<?xml version="1.0" encoding="UTF-8"?><xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/" xmlns:fmt="http://www.ibm.com/dfdl/RecordFixLengthFieldFormat" xmlns:ibmDfdlExtn="http://www.ibm.com/dfdl/extensions" xmlns:ibmSchExtn="http://www.ibm.com/schema/extensions" xmlns:ref="http://www.ibm.com/dfdl/RecordSeparatedFieldFormat">
<xsd:import namespace="http://www.ibm.com/dfdl/RecordSeparatedFieldFormat" schemaLocation="../IBMdefined/RecordSeparatedFieldFormat.xsd"/>
<xsd:import namespace="http://www.ibm.com/dfdl/RecordFixLengthFieldFormat" schemaLocation="../IBMdefined/RecordFixLengthFieldFormat.xsd"/>
<xsd:complexType name="EmployeesInfo_909">
<xsd:sequence dfdl:terminator="$$$">
<xsd:element dfdl:lengthKind="delimited" dfdl:occursCountKind="implicit" dfdl:terminator="~^" minOccurs="0" name="FileName" type="xsd:string"/>
<xsd:element dfdl:initiator="" dfdl:lengthKind="implicit" dfdl:occursCountKind="implicit" maxOccurs="unbounded" name="EmployeeInfo">
<xsd:complexType>
<xsd:sequence dfdl:terminator="&amp;">
<xsd:element dfdl:lengthKind="delimited" dfdl:terminator="|" name="Company" type="xsd:string"/>
<xsd:element dfdl:lengthKind="delimited" dfdl:terminator="|" name="RegistrationId" type="xsd:string"/>
<xsd:element dfdl:lengthKind="delimited" dfdl:terminator="|" name="PersonName" type="xsd:string"/>
<xsd:element dfdl:lengthKind="delimited" name="PersonInfo">
<xsd:complexType>
<xsd:sequence dfdl:separatorSuppressionPolicy="trailingEmpty" dfdl:terminator="|">
<xsd:element dfdl:length="45" dfdl:lengthKind="explicit" dfdl:lengthUnits="characters" name="Name" type="xsd:string"/>
<xsd:element dfdl:length="45" dfdl:lengthKind="explicit" dfdl:lengthUnits="characters" name="Type" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element dfdl:lengthKind="delimited" dfdl:terminator="|" name="Address" type="xsd:string"/>
<xsd:element dfdl:lengthKind="delimited" dfdl:terminator="|" name="City" type="xsd:string"/>
<xsd:element dfdl:lengthKind="delimited" dfdl:terminator="|" name="State" type="xsd:string"/>
<xsd:element dfdl:lengthKind="delimited" dfdl:terminator="|" name="MotherName" type="xsd:string"/>
<xsd:element dfdl:lengthKind="delimited" dfdl:terminator="|" name="FatherName" type="xsd:string"/>
<xsd:element dfdl:length="1" dfdl:lengthKind="explicit" dfdl:lengthUnits="characters" name="EndOfRecord" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:element dfdl:lengthKind="implicit" dfdl:occursCountKind="implicit" ibmSchExtn:docRoot="true" name="EmployeesInfo_909" type="EmployeesInfo_909"/>
<xsd:annotation>
<xsd:appinfo source="http://www.ogf.org/dfdl/">
<dfdl:format byteOrder="{$dfdl:byteOrder}" documentFinalTerminatorCanBeMissing="yes" encoding="{$dfdl:encoding}" escapeSchemeRef="fmt:RecordEscapeScheme" ref="fmt:RecordFixLengthFieldsFormat" separatorSuppressionPolicy="anyEmpty"/>
</xsd:appinfo>
</xsd:annotation>
</xsd:schema>


And this data is parsed successfully

Quote:
ABCD_05042017_0189808000_V~^IBM|1008909|Mike|Mike |Male |Chicago IL|Moline|IL|Ginger|Michael|a&$$$


where as this data, if I have two employeeinfo records, the parsing fails.
Quote:
ABCD_05042017_0189808000_V~^IBM|1008909|Mike|Mike |Male |Chicago IL|Moline|IL|Ginger|Michael|a&IBM|1008909|Mike|Mike |Male |Chicago IL|Moline|IL|Ginger|Michael|a$$$


is there something wrong with the way the data is prepared?

Your inputs pls?
Back to top
View user's profile Send private message
mqjeff
PostPosted: Thu May 04, 2017 8:38 am Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17166

Create a sequence terminated by $$.
Create a repeating record in that sequence terminated by $.
_________________
Read, Think, Try, Repeat
Back to top
View user's profile Send private message
mqbrks
PostPosted: Thu May 04, 2017 9:09 am Post subject: Reply with quote

Acolyte

Joined: 17 Jan 2012
Posts: 52

mqjeff wrote:
Create a sequence terminated by $$.
Create a repeating record in that sequence terminated by $.


yup this is the one right I have shown above in my post?

Quote:
ABCD_05042017_0189808000_V~^IBM|1008909|Mike|Mike |Male |Chicago IL|Moline|IL|Ginger|Michael|a&IBM|1008909|Mike|Mike |Male |Chicago IL|Moline|IL|Ginger|Michael|a$$$

but its failing.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Thu May 04, 2017 9:13 am Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17166

mqbrks wrote:
mqjeff wrote:
Create a sequence terminated by $$.
Create a repeating record in that sequence terminated by $.


yup this is the one right I have shown above in my post?


Yes, taking time to read through the DFDL xsd does seem to show that.

mqbrks wrote:
but its failing.


Well. There's your problem.

Start with "what does 'it's failing' mean"

Then go on to figure out "What does the data (error message, trace, etc.) tell me about the failure".
_________________
Read, Think, Try, Repeat
Back to top
View user's profile Send private message
mqbrks
PostPosted: Thu May 04, 2017 9:27 am Post subject: Reply with quote

Acolyte

Joined: 17 Jan 2012
Posts: 52

mqjeff wrote:

Start with "what does 'it's failing' mean"

Then go on to figure out "What does the data (error message, trace, etc.) tell me about the failure".


May 4, 2017, 1:23:01 PM fatal: CTDP3061E: Terminator '$$$' not found at offset '174' for sequence or choice within element '/EmployeesInfo_909[1]'.

And if I include the terminator $$$ at the end and prepare the data this way
Data
Quote:
ABCD_05042017_0189808000_V~^IBM|1008909|Mike|Mike |Male |Chicago IL|Moline|IL|Ginger|Michael|a&$$$IBM|1008909|Mike|Mike |Male |Chicago IL|Moline|IL|Ginger|Michael|a


Quote:
May 4, 2017, 1:24:41 PM fatal: CTDP3002E: Unexpected data found at offset '177' after parsing completed. Data: '0x49...'.
[/quote]

Basically it doesn't allow me to have two "EmployeeInfo" records.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Thu May 04, 2017 9:29 am Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17166

Oh.

Your terminator is "$$$".

Your terminator on the employee record is $. So you need the terminator on the sequence to be $$, not $$$

Two, not Three. The end of your last employee record will be a $.
_________________
Read, Think, Try, Repeat
Back to top
View user's profile Send private message
mqbrks
PostPosted: Thu May 04, 2017 9:42 am Post subject: Reply with quote

Acolyte

Joined: 17 Jan 2012
Posts: 52

mqjeff wrote:
Oh.

Your terminator is "$$$".

Your terminator on the employee record is $. So you need the terminator on the sequence to be $$, not $$$

Two, not Three. The end of your last employee record will be a $.


Thanks a lot...that worked!
Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexWebSphere Message Broker SupportData for DFDL xsd
Jump to:



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP


Theme by Dustin Baccetti
Powered by phpBB 2001, 2002 phpBB Group

Copyright MQSeries.net. All rights reserved.