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 Index » WebSphere Message Broker (ACE) Support » DFDL 'occurscountkind=implicit' behavior?

Post new topic  Reply to topic
 DFDL 'occurscountkind=implicit' behavior? « View previous topic :: View next topic » 
Author Message
rsk33
PostPosted: Thu May 26, 2016 10:45 pm    Post subject: DFDL 'occurscountkind=implicit' behavior? Reply with quote

Centurion

Joined: 21 Aug 2006
Posts: 141

Hi

I have a question on the behavior of the repeating/array field property 'occurs count kind=implicit' which is min occurs=0 and max occurs=unbounded in DFDL.

should the DFDL implicitly recognizes the end of repeating structure or should we place in sequence and terminates it.

sorry if the question looks very basic i want to know the correct default behaviour or i am missing any property setting.

would appreciate any help.

regards..
Back to top
View user's profile Send private message
mqjeff
PostPosted: Fri May 27, 2016 3:56 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

It's sort of about DFDL recognizing the end of the repeating structure - that is, the last repeat.

It's also about DFDL recognizing the next field after the repeating structure.

So the structure repeats, and DFDL keeps looking for another instance of the structure. When the field it's looking at is *not* the first part of the repeating structure - particularly if DFDL knows that it's the first field in the *next* part of the model... then DFDL knows that the repeat has ended.
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
rsk33
PostPosted: Fri May 27, 2016 12:36 pm    Post subject: Reply with quote

Centurion

Joined: 21 Aug 2006
Posts: 141

In version 9.0.0.4 i tested the below example. it is throwing error exactly at the end of repeating structure. am i missing some property.

complexfield consist of child1 with maxoccurance > 0 and child2 and sequence is separated with ','

testMessage:
message[complexfield[child 1[11],child1[22],child2[33]]]

schema:

[
Code:
<?xml version="1.0" encoding="UTF-8"?><xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:csv="http://www.ibm.com/dfdl/CommaSeparatedFormat" xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/" xmlns:ibmDfdlExtn="http://www.ibm.com/dfdl/extensions" xmlns:ibmSchExtn="http://www.ibm.com/schema/extensions">


    <xsd:import namespace="http://www.ibm.com/dfdl/CommaSeparatedFormat" schemaLocation="IBMdefined/CommaSeparatedFormat.xsd"/>
        <xsd:element dfdl:encoding="UTF-8" dfdl:initiator="message[" dfdl:terminator="]" ibmSchExtn:docRoot="true" name="message">
    <xsd:complexType>
      <xsd:sequence dfdl:encoding="UTF-8" dfdl:separator="">
        <xsd:element dfdl:encoding="UTF-8" dfdl:initiator="complexfield[" dfdl:terminator="]" name="complexfield">
          <xsd:complexType>
            <xsd:sequence dfdl:encoding="UTF-8" dfdl:separator=",">
              <xsd:element dfdl:encoding="UTF-8" dfdl:initiator="child1[" dfdl:terminator="]" maxOccurs="unbounded" minOccurs="0" name="child1" type="xsd:string"/>
              <xsd:element default="" dfdl:encoding="UTF-8" dfdl:initiator="child2[" dfdl:terminator="]" name="child2" type="xsd:string"/>
            </xsd:sequence>
          </xsd:complexType>
        </xsd:element>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>
    <xsd:annotation>
      <xsd:appinfo source="http://www.ogf.org/dfdl/">
         <dfdl:format documentFinalTerminatorCanBeMissing="yes" encoding="UTF-8" escapeSchemeRef="csv:CSVEscapeScheme" ref="csv:CommaSeparatedFormat"/>
      </xsd:appinfo>
   </xsd:annotation>

</xsd:schema>

]

trace:




********************* DFDL Parser Setup Starting *********************
Schema = /GeneralMQLIB/DFDL_General.xsd
**********************************************************************



********************* DFDL Parser Starting *********************
Data = C:\Users\user1\Desktop\moi\mi2\New Text Document.txt
Message = message (/GeneralMQLIB/DFDL_General.xsd)
****************************************************************

May 27, 2016, 11:24:23 PM info: Offset: 0. Parsing will start from root element 'message'.
[dfdl = /GeneralMQLIB/DFDL_General.xsd, scd = #xscd(/schemaElement::message), 66]

May 27, 2016, 11:24:23 PM info: The default value of '%LF;' was assigned to variable 'outputNewLine' in namespace 'http://www.ogf.org/dfdl/dfdl-1.0/'.
[dfdl = /GeneralMQLIB/DFDL_General.xsd, scd = , 133]

May 27, 2016, 11:24:23 PM info: Offset: 0. Starting to process element 'message'.
[dfdl = /GeneralMQLIB/DFDL_General.xsd, scd = #xscd(/schemaElement::message), 57]

May 27, 2016, 11:24:23 PM info: Offset: 0. Found initiator 'message[' for 'message'
[dfdl = /GeneralMQLIB/DFDL_General.xsd, scd = #xscd(/schemaElement::message), 59]

May 27, 2016, 11:24:23 PM info: Offset: 8. Starting to process element 'complexfield'.
[dfdl = /GeneralMQLIB/DFDL_General.xsd, scd = #xscd(/schemaElement::message/type::0/model::sequence/schemaElement::complexfield), 62]

May 27, 2016, 11:24:23 PM info: Offset: 8. Found initiator 'complexfield[' for 'complexfield'
[dfdl = /GeneralMQLIB/DFDL_General.xsd, scd = #xscd(/schemaElement::message/type::0/model::sequence/schemaElement::complexfield), 69]

May 27, 2016, 11:24:23 PM info: Offset: 21. Up to '-1' occurrences of element 'child1' will be expected because occursCountKind='implicit' and maxOccurs='-1'.
[dfdl = /GeneralMQLIB/DFDL_General.xsd, scd = #xscd(/schemaElement::message/type::0/model::sequence/schemaElement::complexfield/type::0/model::sequence/schemaElement::child1), 134]

May 27, 2016, 11:24:23 PM info: Offset: 21. Optional element 'child1' encountered. The DFDL parser will return to this position if the element is not present in the data stream.
[dfdl = /GeneralMQLIB/DFDL_General.xsd, scd = #xscd(/schemaElement::message/type::0/model::sequence/schemaElement::complexfield/type::0/model::sequence/schemaElement::child1), 153]

May 27, 2016, 11:24:23 PM info: Offset: 21. Starting to process element 'child1'.
[dfdl = /GeneralMQLIB/DFDL_General.xsd, scd = #xscd(/schemaElement::message/type::0/model::sequence/schemaElement::complexfield/type::0/model::sequence/schemaElement::child1), 57]

May 27, 2016, 11:24:23 PM info: Offset: 21. Found initiator 'child1[' for 'child1'
[dfdl = /GeneralMQLIB/DFDL_General.xsd, scd = #xscd(/schemaElement::message/type::0/model::sequence/schemaElement::complexfield/type::0/model::sequence/schemaElement::child1), 58]

May 27, 2016, 11:24:23 PM info: Offset: 28. Found delimited value: '11' for element 'child1'. The delimiter was ']'.
[dfdl = /GeneralMQLIB/DFDL_General.xsd, scd = #xscd(/schemaElement::message/type::0/model::sequence/schemaElement::complexfield/type::0/model::sequence/schemaElement::child1), 93]

May 27, 2016, 11:24:23 PM info: Offset: 30. Found terminator ']' for 'child1'.
[dfdl = /GeneralMQLIB/DFDL_General.xsd, scd = #xscd(/schemaElement::message/type::0/model::sequence/schemaElement::complexfield/type::0/model::sequence/schemaElement::child1), 54]

May 27, 2016, 11:24:23 PM info: Offset: 31. Finished processing element 'child1'.
[dfdl = /GeneralMQLIB/DFDL_General.xsd, scd = #xscd(/schemaElement::message/type::0/model::sequence/schemaElement::complexfield/type::0/model::sequence/schemaElement::child1), 57]

May 27, 2016, 11:24:23 PM info: Offset: 31. Optional element 'child1' encountered. The DFDL parser will return to this position if the element is not present in the data stream.
[dfdl = /GeneralMQLIB/DFDL_General.xsd, scd = #xscd(/schemaElement::message/type::0/model::sequence/schemaElement::complexfield/type::0/model::sequence/schemaElement::child1), 153]

May 27, 2016, 11:24:23 PM info: Offset: 31. Found separator ',' owned by the 'sequence' group contained within element 'complexfield'.
[dfdl = /GeneralMQLIB/DFDL_General.xsd, scd = #xscd(/schemaElement::message/type::0/model::sequence/schemaElement::complexfield/type::0/model::sequence), 110]

May 27, 2016, 11:24:23 PM info: Offset: 32. Starting to process element 'child1'.
[dfdl = /GeneralMQLIB/DFDL_General.xsd, scd = #xscd(/schemaElement::message/type::0/model::sequence/schemaElement::complexfield/type::0/model::sequence/schemaElement::child1), 57]

May 27, 2016, 11:24:23 PM info: Offset: 32. Found initiator 'child1[' for 'child1'
[dfdl = /GeneralMQLIB/DFDL_General.xsd, scd = #xscd(/schemaElement::message/type::0/model::sequence/schemaElement::complexfield/type::0/model::sequence/schemaElement::child1), 58]

May 27, 2016, 11:24:23 PM info: Offset: 39. Found delimited value: '22' for element 'child1'. The delimiter was ']'.
[dfdl = /GeneralMQLIB/DFDL_General.xsd, scd = #xscd(/schemaElement::message/type::0/model::sequence/schemaElement::complexfield/type::0/model::sequence/schemaElement::child1), 93]

May 27, 2016, 11:24:23 PM info: Offset: 41. Found terminator ']' for 'child1'.
[dfdl = /GeneralMQLIB/DFDL_General.xsd, scd = #xscd(/schemaElement::message/type::0/model::sequence/schemaElement::complexfield/type::0/model::sequence/schemaElement::child1), 54]

May 27, 2016, 11:24:23 PM info: Offset: 42. Finished processing element 'child1'.
[dfdl = /GeneralMQLIB/DFDL_General.xsd, scd = #xscd(/schemaElement::message/type::0/model::sequence/schemaElement::complexfield/type::0/model::sequence/schemaElement::child1), 57]

May 27, 2016, 11:24:23 PM info: Offset: 42. Optional element 'child1' encountered. The DFDL parser will return to this position if the element is not present in the data stream.
[dfdl = /GeneralMQLIB/DFDL_General.xsd, scd = #xscd(/schemaElement::message/type::0/model::sequence/schemaElement::complexfield/type::0/model::sequence/schemaElement::child1), 153]

May 27, 2016, 11:24:23 PM info: Offset: 42. Found separator ',' owned by the 'sequence' group contained within element 'complexfield'.
[dfdl = /GeneralMQLIB/DFDL_General.xsd, scd = #xscd(/schemaElement::message/type::0/model::sequence/schemaElement::complexfield/type::0/model::sequence), 110]

May 27, 2016, 11:24:23 PM info: Offset: 43. Starting to process element 'child1'.
[dfdl = /GeneralMQLIB/DFDL_General.xsd, scd = #xscd(/schemaElement::message/type::0/model::sequence/schemaElement::complexfield/type::0/model::sequence/schemaElement::child1), 57]

May 27, 2016, 11:24:23 PM info: Offset: 43. Did not find initiator for 'child1'
[dfdl = /GeneralMQLIB/DFDL_General.xsd, scd = #xscd(/schemaElement::message/type::0/model::sequence/schemaElement::complexfield/type::0/model::sequence/schemaElement::child1), 55]

May 27, 2016, 11:24:23 PM info: Offset: 43. Element 'child1' is empty because the initiator was not found in the data stream.
[dfdl = /GeneralMQLIB/DFDL_General.xsd, scd = #xscd(/schemaElement::message/type::0/model::sequence/schemaElement::complexfield/type::0/model::sequence/schemaElement::child1), 101]

May 27, 2016, 11:24:23 PM error: CTDP3041E: Initiator 'child1[' not found at offset '43' for element '/message[1]/complexfield[1]/child1[3]'.

May 27, 2016, 11:24:23 PM info: Offset: 43. Parser was unable to resolve data on the current branch and will evaluate the next available branch beginning at offset '43' owned by the 'sequence' group contained within element 'complexfield'.
[dfdl = /GeneralMQLIB/DFDL_General.xsd, scd = #xscd(/schemaElement::message/type::0/model::sequence/schemaElement::complexfield/type::0/model::sequence), 215]

May 27, 2016, 11:24:23 PM info: Offset: 43. Occurrence '3' of element 'child1' was not found in the data. occursCountKind is 'implicit' so no more occurrences of this element will be expected.
[dfdl = /GeneralMQLIB/DFDL_General.xsd, scd = #xscd(/schemaElement::message/type::0/model::sequence/schemaElement::complexfield/type::0/model::sequence/schemaElement::child1), 169]

May 27, 2016, 11:24:23 PM error: CTDP3058E: Separator ',' not found at offset '43' for sequence or choice within element '/message[1]/complexfield[1]'.

May 27, 2016, 11:24:23 PM fatal: CTDP3058E: Separator ',' not found at offset '43' for sequence or choice within element '/message[1]/complexfield[1]'.
Back to top
View user's profile Send private message
rsk33
PostPosted: Sun May 29, 2016 5:18 am    Post subject: Reply with quote

Centurion

Joined: 21 Aug 2006
Posts: 141

when i introduced the sequence and terminator for field1 dfdl is successful. i removed the message field in my previous post example in order to simplify .
i want to model without terminator as i likely to map several complex fields in the XML to DFDL. would appreciate help to achieve this alternatively without terminator or to correct if i am missing some property.

Message now
complexfield[field1[11],field1[22];,field2[33]]





Code:


schema:

[
<?xml version="1.0" encoding="UTF-8"?><xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:csv="http://www.ibm.com/dfdl/CommaSeparatedFormat" xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/" xmlns:ibmDfdlExtn="http://www.ibm.com/dfdl/extensions" xmlns:ibmSchExtn="http://www.ibm.com/schema/extensions">


    <xsd:import namespace="http://www.ibm.com/dfdl/CommaSeparatedFormat" schemaLocation="IBMdefined/CommaSeparatedFormat.xsd"/>
                <xsd:element dfdl:encoding="{$dfdl:encoding}" dfdl:initiator="" dfdl:outputNewLine="%CR;%LF;" dfdl:terminator="" ibmSchExtn:docRoot="true" name="message">
    <xsd:complexType>
      <xsd:sequence dfdl:encoding="{$dfdl:encoding}" dfdl:separator="" dfdl:terminator="">
        <xsd:element dfdl:encoding="{$dfdl:encoding}" dfdl:initiator="complexfield[" dfdl:terminator="]" minOccurs="0" name="complexfield">
          <xsd:complexType>
            <xsd:sequence dfdl:encoding="{$dfdl:encoding}" dfdl:initiator="" dfdl:separator="," dfdl:terminator="">
                <xsd:sequence dfdl:terminator=";">
                <xsd:element dfdl:encoding="{$dfdl:encoding}" dfdl:initiator="field1[" dfdl:occursCountKind="implicit" dfdl:terminator="]" maxOccurs="unbounded" minOccurs="0" name="field1" type="xsd:string"/>
              </xsd:sequence>
                            <xsd:element dfdl:initiator="field2[" dfdl:terminator="]" name="field2" type="xsd:string"/>
                        </xsd:sequence>
          </xsd:complexType>
        </xsd:element>
                                        </xsd:sequence>
    </xsd:complexType>
  </xsd:element>
    <xsd:annotation>
      <xsd:appinfo source="http://www.ogf.org/dfdl/">
         <dfdl:format documentFinalTerminatorCanBeMissing="yes" encoding="{$dfdl:encoding}" escapeSchemeRef="csv:CSVEscapeScheme" ref="csv:CommaSeparatedFormat"/>
      </xsd:appinfo>
   </xsd:annotation>




</xsd:schema>


Last edited by rsk33 on Sun May 29, 2016 5:59 am; edited 2 times in total
Back to top
View user's profile Send private message
rsk33
PostPosted: Sun May 29, 2016 5:39 am    Post subject: Reply with quote

Centurion

Joined: 21 Aug 2006
Posts: 141

Code:


schema:


<?xml version="1.0" encoding="UTF-8"?><xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:csv="http://www.ibm.com/dfdl/CommaSeparatedFormat" xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/" xmlns:ibmDfdlExtn="http://www.ibm.com/dfdl/extensions" xmlns:ibmSchExtn="http://www.ibm.com/schema/extensions">


<xsd:import namespace="http://www.ibm.com/dfdl/CommaSeparatedFormat" schemaLocation="IBMdefined/CommaSeparatedFormat.xsd"/>
<xsd:element dfdl:encoding="{$dfdl:encoding}" dfdl:initiator="" dfdl:outputNewLine="%CR;%LF;" dfdl:terminator="" ibmSchExtn:docRoot="true" name="message">
<xsd:complexType>
<xsd:sequence dfdl:encoding="{$dfdl:encoding}" dfdl:separator="" dfdl:terminator="">
<xsd:element dfdl:encoding="{$dfdl:encoding}" dfdl:initiator="complexfield[" dfdl:terminator="]" minOccurs="0" name="complexfield">
<xsd:complexType>
<xsd:sequence dfdl:encoding="{$dfdl:encoding}" dfdl:initiator="" dfdl:separator="," dfdl:terminator="">
<xsd:sequence dfdl:terminator=";">
<xsd:element dfdl:encoding="{$dfdl:encoding}" dfdl:initiator="field1[" dfdl:occursCountKind="implicit" dfdl:terminator="]" maxOccurs="unbounded" minOccurs="0" name="field1" type="xsd:string"/>
</xsd:sequence>
<xsd:element dfdl:initiator="field2[" dfdl:terminator="]" name="field2" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:annotation>
<xsd:appinfo source="http://www.ogf.org/dfdl/">
<dfdl:format documentFinalTerminatorCanBeMissing="yes" encoding="{$dfdl:encoding}" escapeSchemeRef="csv:CSVEscapeScheme" ref="csv:CommaSeparatedFormat"/>
</xsd:appinfo>
</xsd:annotation>




</xsd:schema>
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue May 31, 2016 4:24 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

It looks like you don't have any elements that occur after the one with repeat implicit.

In that case, you should be telling DFDL to stop looking for repeats when it finds the end of file.

If you have simplified your model to remove additional elements afterwards, you need to provide some way that DFDL can tell that the implicit repeat has finished repeating. This can be some kind of terminator or some kind of initiator on the next element... or a few other things that timber will surely suggest sometime soon.
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
timber
PostPosted: Tue May 31, 2016 5:27 am    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1280

Have you tried this on the latest v9 fix pack, or on v10? It looks like a defect to me.
Back to top
View user's profile Send private message
rsk33
PostPosted: Tue May 31, 2016 9:36 am    Post subject: Reply with quote

Centurion

Joined: 21 Aug 2006
Posts: 141

hi timber,

thanks for the response.I was also suspecting about the weird behavior...
i tried in 9.0.0.4 toolkit. Recently we upgraded all our environments to 9.0.0.5 broker.

regards
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » DFDL 'occurscountkind=implicit' behavior?
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.