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 sequence/choice variable length

Post new topic  Reply to topic Goto page 1, 2  Next
 DFDL sequence/choice variable length « View previous topic :: View next topic » 
Author Message
mqjeff
PostPosted: Tue Jan 10, 2012 6:03 am    Post subject: DFDL sequence/choice variable length Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

I'm trying to build a DFDL model of something where each individual field is a tagged/delimited element, but the entire message consists of an unordered unlimited repeat of different types of records.

That is, the message consists of
Code:
RecordA
RecordB
RecordC

Where there can be any number of each type of record and they can appear in any order.
Each Record consists of some required fields and some optional fields, most of which can appear in any order.

I'm having some trouble getting DFDL to recognize that a given Record has completed, and that it should then start to look for another repeat of any of the record types.
Back to top
View user's profile Send private message
kimbert
PostPosted: Tue Jan 10, 2012 6:29 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
there can be any number of each type of record and they can appear in any order.
That sounds like a repeating choice. In DFDL, the choice group itself cannot repeat, so you will need a repeating element whose content is a choice group. That might mean that you model has one more element than you would ideally like it to have.

If you've already tried that then I will need to see the model and a DFDL trace to analyze exactly what is going on - these questions have an unfortunate habit of coming down to the specific details of the model and the data format ( as you know).
Quote:
Each Record consists of some required fields and some optional fields, most of which can appear in any order.
I'm having some trouble getting DFDL to recognize that a given Record has completed...
If the records are tagged then the details of the record content should not be relevant to this problem. That's good news, because it means we just need to get the wrapping right.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Jan 10, 2012 7:08 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Here's the xsd
Code:
<?xml version="1.0" encoding="UTF-8"?><xsd:schema xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/" xmlns:ibmDfdlExtn="http://www.ibm.com/dfdl/extensions" xmlns:recSepFieldsFmt="http://www.ibm.com/dfdl/RecordSeparatedFieldFormat" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <xsd:import namespace="http://www.ibm.com/dfdl/RecordSeparatedFieldFormat" schemaLocation="IBMdefined/RecordSeparatedFieldFormat.xsd"/>
   <xsd:annotation>
      <xsd:appinfo source="http://www.ogf.org/dfdl/">
         <dfdl:format byteOrder="{$dfdl:byteOrder}" documentFinalTerminatorCanBeMissing="yes" encoding="{$dfdl:encoding}" escapeSchemeRef="recSepFieldsFmt:RecordEscapeScheme" initiatedContent="yes" occursCountKind="parsed" ref="recSepFieldsFmt:RecordSeparatedFieldsFormat" separator="%SP;" separatorPolicy="suppressed"/>
      </xsd:appinfo>
   </xsd:annotation>


   <xsd:element dfdl:lengthKind="implicit" dfdl:ref="recSepFieldsFmt:RecordSeparatedFieldsFormat" ibmDfdlExtn:docRoot="true" ibmDfdlExtn:sampleValue="" name="mqsc">
      <xsd:complexType>
         <xsd:sequence dfdl:initiatedContent="no">
            <xsd:element dfdl:initiator="" dfdl:lengthKind="implicit" dfdl:occursCountKind="implicit" maxOccurs="unbounded" name="command" type="commandComplexType"/>
         </xsd:sequence>
      </xsd:complexType>

   </xsd:element>
   <xsd:complexType name="commandComplexType">
      <xsd:choice dfdl:outputNewLine="{$dfdl:outputNewLine}">
         <xsd:element dfdl:initiator="%WSP*;DEFINE%WSP*;" dfdl:occursCountKind="explicit" dfdl:lengthKind="implicit" dfdl:outputNewLine="{$dfdl:outputNewLine}" dfdl:terminator="%NL;" name="DEFINE" type="DEFINEComplexType">

         </xsd:element>
         <xsd:element dfdl:initiator="*" name="COMMENT" type="xsd:string"/>
      </xsd:choice>
   </xsd:complexType>
   <xsd:complexType name="DEFINEComplexType">
      <xsd:choice dfdl:outputNewLine="{$dfdl:outputNewLine}" dfdl:separator="" dfdl:separatorPosition="postfix">
         <xsd:element dfdl:ignoreCase="yes" dfdl:initiator="QLOCAL" dfdl:outputNewLine="{$dfdl:outputNewLine}" dfdl:terminator="" name="QLOCAL">
            <xsd:complexType>
               <xsd:sequence dfdl:outputNewLine="{$dfdl:outputNewLine}" dfdl:separator="%WSP*;">
                  <xsd:element dfdl:emptyValueDelimiterPolicy="initiator" dfdl:ignoreCase="yes" dfdl:initiator="(" dfdl:nilValueDelimiterPolicy="initiator" dfdl:outputNewLine="{$dfdl:outputNewLine}" dfdl:terminator=")" dfdl:textStringPadCharacter="%SP;" name="QNAME" type="xsd:string"/>
               </xsd:sequence>
            </xsd:complexType>
         </xsd:element>
      </xsd:choice>
   </xsd:complexType>
</xsd:schema>


Here's the input
Code:
DEFINE QLOCAL(TEST)
*this is a comment

and here's the trace
Code:


********************* DFDL Parser Setup Starting *********************
Schema = /MQSC/mqsc.xsd
**********************************************************************

Jan 10, 2012 10:06:10 AM   info: Offset: 0. Root element 'mqsc' identified.
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/schemaElement::mqsc), 50]



********************* DFDL Parser Starting *********************
Data = /MQSC/test.mqsc
Message = mqsc (/MQSC/mqsc.xsd)
****************************************************************

Jan 10, 2012 10:06:10 AM   info: Offset: 0. Starting to process element 'mqsc'.
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/schemaElement::mqsc), 54]

Jan 10, 2012 10:06:10 AM   info: Offset: 0. Up to '-1' occurrences of element 'command' will be expected because occursCountKind='implicit' and maxOccurs='-1'.
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/schemaElement::mqsc/type::0/model::sequence/schemaElement::command), 134]

Jan 10, 2012 10:06:10 AM   info: Offset: 0. Starting to process element 'command'.
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/schemaElement::mqsc/type::0/model::sequence/schemaElement::command), 57]

Jan 10, 2012 10:06:10 AM   info: Offset: 0. Choice branch 'DEFINE' encountered. The DFDL parser will return to this position if this branch of the choice is not found in the data stream.
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/type::commandComplexType/model::choice/schemaElement::DEFINE), 161]

Jan 10, 2012 10:06:10 AM   info: Offset: 0. Element 'DEFINE' has occursCountKind='parsed'. The number of occurrences of element 'DEFINE' will be determined by reading the input data stream, and the maxOccurs property will not control the number of occurrences that are parsed.
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/type::commandComplexType/model::choice/schemaElement::DEFINE), 251]

Jan 10, 2012 10:06:10 AM   info: Offset: 0. Starting to process element 'DEFINE'.
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/type::commandComplexType/model::choice/schemaElement::DEFINE), 56]

Jan 10, 2012 10:06:10 AM   info: Offset: 0. Found initiator '%WSP*;DEFINE%WSP*;' for element 'DEFINE'
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/type::commandComplexType/model::choice/schemaElement::DEFINE), 76]

Jan 10, 2012 10:06:10 AM   info: Offset: 7. Choice branch 'QLOCAL' encountered. The DFDL parser will return to this position if this branch of the choice is not found in the data stream.
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/type::DEFINEComplexType/model::choice/schemaElement::QLOCAL), 161]

Jan 10, 2012 10:06:10 AM   info: Offset: 7. Element 'QLOCAL' has occursCountKind='parsed'. The number of occurrences of element 'QLOCAL' will be determined by reading the input data stream, and the maxOccurs property will not control the number of occurrences that are parsed.
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/type::DEFINEComplexType/model::choice/schemaElement::QLOCAL), 251]

Jan 10, 2012 10:06:10 AM   info: Offset: 7. Starting to process element 'QLOCAL'.
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/type::DEFINEComplexType/model::choice/schemaElement::QLOCAL), 56]

Jan 10, 2012 10:06:10 AM   info: Offset: 7. Found initiator 'QLOCAL' for element 'QLOCAL'
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/type::DEFINEComplexType/model::choice/schemaElement::QLOCAL), 64]

Jan 10, 2012 10:06:10 AM   info: Offset: 13. Element 'QNAME' has occursCountKind='parsed'. The number of occurrences of element 'QNAME' will be determined by reading the input data stream, and the maxOccurs property will not control the number of occurrences that are parsed.
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/type::DEFINEComplexType/model::choice/schemaElement::QLOCAL/type::0/model::sequence/schemaElement::QNAME), 250]

Jan 10, 2012 10:06:10 AM   info: Offset: 13. Starting to process element 'QNAME'.
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/type::DEFINEComplexType/model::choice/schemaElement::QLOCAL/type::0/model::sequence/schemaElement::QNAME), 56]

Jan 10, 2012 10:06:10 AM   info: Offset: 13. Found initiator '(' for element 'QNAME'
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/type::DEFINEComplexType/model::choice/schemaElement::QLOCAL/type::0/model::sequence/schemaElement::QNAME), 59]

Jan 10, 2012 10:06:10 AM   info: Offset: 14. Found delimited value: 'TEST' for element 'QNAME'.
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/type::DEFINEComplexType/model::choice/schemaElement::QLOCAL/type::0/model::sequence/schemaElement::QNAME), 70]

Jan 10, 2012 10:06:10 AM   info: Offset: 18. Found terminator ')' for element 'QNAME'.
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/type::DEFINEComplexType/model::choice/schemaElement::QLOCAL/type::0/model::sequence/schemaElement::QNAME), 61]

Jan 10, 2012 10:06:10 AM   info: Offset: 19. Finished processing element 'QNAME'.
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/type::DEFINEComplexType/model::choice/schemaElement::QLOCAL/type::0/model::sequence/schemaElement::QNAME), 56]

Jan 10, 2012 10:06:10 AM   info: Offset: 19. Optional element 'QNAME' encountered. The DFDL parser will return to this position if the element is not present in the data stream.
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/type::DEFINEComplexType/model::choice/schemaElement::QLOCAL/type::0/model::sequence/schemaElement::QNAME), 152]

Jan 10, 2012 10:06:10 AM   info: Offset: 19. Found separator '%WSP*;' owned by the 'sequence' group contained within element 'QLOCAL'.
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/type::DEFINEComplexType/model::choice/schemaElement::QLOCAL/type::0/model::sequence), 109]

Jan 10, 2012 10:06:10 AM   info: Offset: 20. Starting to process element 'QNAME'.
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/type::DEFINEComplexType/model::choice/schemaElement::QLOCAL/type::0/model::sequence/schemaElement::QNAME), 56]

Jan 10, 2012 10:06:10 AM   info: Offset: 20. Did not find initiator for 'QNAME'
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/type::DEFINEComplexType/model::choice/schemaElement::QLOCAL/type::0/model::sequence/schemaElement::QNAME), 54]

Jan 10, 2012 10:06:10 AM   info: Offset: 20. Element 'QNAME' is missing because the initiator was not found in the data stream.
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/type::DEFINEComplexType/model::choice/schemaElement::QLOCAL/type::0/model::sequence/schemaElement::QNAME), 102]

Jan 10, 2012 10:06:10 AM   error: CTDP3041E: Initiator is missing for element 'QNAME'.

Jan 10, 2012 10:06:10 AM   info: offset: 20. Parser was unable to resolve data on the current branch and will evaluate the next available branch beginning at offset '20' owned by the 'sequence' group contained within element 'QLOCAL'.
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/type::DEFINEComplexType/model::choice/schemaElement::QLOCAL/type::0/model::sequence), 209]

Jan 10, 2012 10:06:10 AM   info: Offset: 19. Occurrence '2' of element 'QNAME' was not found in the data. occursCountKind is 'parsed' so no more occurrences of this element will be expected.
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/type::DEFINEComplexType/model::choice/schemaElement::QLOCAL/type::0/model::sequence/schemaElement::QNAME), 166]

Jan 10, 2012 10:06:10 AM   info: Offset: 19. Finished processing element 'QLOCAL'.
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/type::DEFINEComplexType/model::choice/schemaElement::QLOCAL), 57]

Jan 10, 2012 10:06:10 AM   info: Offset: 19. Did not find terminator for 'DEFINE'.  Expected terminator list is '%NL;'.
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/type::commandComplexType/model::choice/schemaElement::DEFINE), 94]

Jan 10, 2012 10:06:10 AM   fatal: CTDP3042E: Terminator is missing for element 'DEFINE'.



********************* DFDL Parser Setup Starting *********************
Schema = /MQSC/mqsc.xsd
**********************************************************************

Jan 10, 2012 10:06:54 AM   info: Offset: 0. Root element 'mqsc' identified.
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/schemaElement::mqsc), 50]



********************* DFDL Parser Starting *********************
Data = /MQSC/test.mqsc
Message = mqsc (/MQSC/mqsc.xsd)
****************************************************************

Jan 10, 2012 10:06:54 AM   info: Offset: 0. Starting to process element 'mqsc'.
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/schemaElement::mqsc), 54]

Jan 10, 2012 10:06:54 AM   info: Offset: 0. Up to '-1' occurrences of element 'command' will be expected because occursCountKind='implicit' and maxOccurs='-1'.
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/schemaElement::mqsc/type::0/model::sequence/schemaElement::command), 134]

Jan 10, 2012 10:06:54 AM   info: Offset: 0. Starting to process element 'command'.
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/schemaElement::mqsc/type::0/model::sequence/schemaElement::command), 57]

Jan 10, 2012 10:06:54 AM   info: Offset: 0. Choice branch 'DEFINE' encountered. The DFDL parser will return to this position if this branch of the choice is not found in the data stream.
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/type::commandComplexType/model::choice/schemaElement::DEFINE), 161]

Jan 10, 2012 10:06:54 AM   info: Offset: 0. Element 'DEFINE' has occursCountKind='parsed'. The number of occurrences of element 'DEFINE' will be determined by reading the input data stream, and the maxOccurs property will not control the number of occurrences that are parsed.
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/type::commandComplexType/model::choice/schemaElement::DEFINE), 251]

Jan 10, 2012 10:06:54 AM   info: Offset: 0. Starting to process element 'DEFINE'.
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/type::commandComplexType/model::choice/schemaElement::DEFINE), 56]

Jan 10, 2012 10:06:54 AM   info: Offset: 0. Found initiator '%WSP*;DEFINE%WSP*;' for element 'DEFINE'
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/type::commandComplexType/model::choice/schemaElement::DEFINE), 76]

Jan 10, 2012 10:06:54 AM   info: Offset: 7. Choice branch 'QLOCAL' encountered. The DFDL parser will return to this position if this branch of the choice is not found in the data stream.
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/type::DEFINEComplexType/model::choice/schemaElement::QLOCAL), 161]

Jan 10, 2012 10:06:54 AM   info: Offset: 7. Element 'QLOCAL' has occursCountKind='parsed'. The number of occurrences of element 'QLOCAL' will be determined by reading the input data stream, and the maxOccurs property will not control the number of occurrences that are parsed.
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/type::DEFINEComplexType/model::choice/schemaElement::QLOCAL), 251]

Jan 10, 2012 10:06:54 AM   info: Offset: 7. Starting to process element 'QLOCAL'.
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/type::DEFINEComplexType/model::choice/schemaElement::QLOCAL), 56]

Jan 10, 2012 10:06:54 AM   info: Offset: 7. Found initiator 'QLOCAL' for element 'QLOCAL'
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/type::DEFINEComplexType/model::choice/schemaElement::QLOCAL), 64]

Jan 10, 2012 10:06:54 AM   info: Offset: 13. Element 'QNAME' has occursCountKind='parsed'. The number of occurrences of element 'QNAME' will be determined by reading the input data stream, and the maxOccurs property will not control the number of occurrences that are parsed.
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/type::DEFINEComplexType/model::choice/schemaElement::QLOCAL/type::0/model::sequence/schemaElement::QNAME), 250]

Jan 10, 2012 10:06:54 AM   info: Offset: 13. Starting to process element 'QNAME'.
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/type::DEFINEComplexType/model::choice/schemaElement::QLOCAL/type::0/model::sequence/schemaElement::QNAME), 56]

Jan 10, 2012 10:06:54 AM   info: Offset: 13. Found initiator '(' for element 'QNAME'
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/type::DEFINEComplexType/model::choice/schemaElement::QLOCAL/type::0/model::sequence/schemaElement::QNAME), 59]

Jan 10, 2012 10:06:54 AM   info: Offset: 14. Found delimited value: 'TEST' for element 'QNAME'.
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/type::DEFINEComplexType/model::choice/schemaElement::QLOCAL/type::0/model::sequence/schemaElement::QNAME), 70]

Jan 10, 2012 10:06:54 AM   info: Offset: 18. Found terminator ')' for element 'QNAME'.
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/type::DEFINEComplexType/model::choice/schemaElement::QLOCAL/type::0/model::sequence/schemaElement::QNAME), 61]

Jan 10, 2012 10:06:54 AM   info: Offset: 19. Finished processing element 'QNAME'.
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/type::DEFINEComplexType/model::choice/schemaElement::QLOCAL/type::0/model::sequence/schemaElement::QNAME), 56]

Jan 10, 2012 10:06:54 AM   info: Offset: 19. Optional element 'QNAME' encountered. The DFDL parser will return to this position if the element is not present in the data stream.
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/type::DEFINEComplexType/model::choice/schemaElement::QLOCAL/type::0/model::sequence/schemaElement::QNAME), 152]

Jan 10, 2012 10:06:54 AM   info: Offset: 19. Found separator '%WSP*;' owned by the 'sequence' group contained within element 'QLOCAL'.
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/type::DEFINEComplexType/model::choice/schemaElement::QLOCAL/type::0/model::sequence), 109]

Jan 10, 2012 10:06:54 AM   info: Offset: 21. Starting to process element 'QNAME'.
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/type::DEFINEComplexType/model::choice/schemaElement::QLOCAL/type::0/model::sequence/schemaElement::QNAME), 56]

Jan 10, 2012 10:06:54 AM   info: Offset: 21. Did not find initiator for 'QNAME'
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/type::DEFINEComplexType/model::choice/schemaElement::QLOCAL/type::0/model::sequence/schemaElement::QNAME), 54]

Jan 10, 2012 10:06:54 AM   info: Offset: 21. Element 'QNAME' is missing because the initiator was not found in the data stream.
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/type::DEFINEComplexType/model::choice/schemaElement::QLOCAL/type::0/model::sequence/schemaElement::QNAME), 102]

Jan 10, 2012 10:06:54 AM   error: CTDP3041E: Initiator is missing for element 'QNAME'.

Jan 10, 2012 10:06:54 AM   info: offset: 21. Parser was unable to resolve data on the current branch and will evaluate the next available branch beginning at offset '21' owned by the 'sequence' group contained within element 'QLOCAL'.
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/type::DEFINEComplexType/model::choice/schemaElement::QLOCAL/type::0/model::sequence), 209]

Jan 10, 2012 10:06:54 AM   info: Offset: 19. Occurrence '2' of element 'QNAME' was not found in the data. occursCountKind is 'parsed' so no more occurrences of this element will be expected.
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/type::DEFINEComplexType/model::choice/schemaElement::QLOCAL/type::0/model::sequence/schemaElement::QNAME), 166]

Jan 10, 2012 10:06:54 AM   info: Offset: 19. Finished processing element 'QLOCAL'.
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/type::DEFINEComplexType/model::choice/schemaElement::QLOCAL), 57]

Jan 10, 2012 10:06:54 AM   info: Offset: 19. Found terminator '%NL;' for element 'DEFINE'.
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/type::commandComplexType/model::choice/schemaElement::DEFINE), 65]

Jan 10, 2012 10:06:54 AM   info: Offset: 21. Finished processing element 'DEFINE'.
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/type::commandComplexType/model::choice/schemaElement::DEFINE), 57]

Jan 10, 2012 10:06:54 AM   info: Offset: 21. Finished processing element 'command'.
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/schemaElement::mqsc/type::0/model::sequence/schemaElement::command), 58]

Jan 10, 2012 10:06:54 AM   info: Offset: 21. Optional element 'command' encountered. The DFDL parser will return to this position if the element is not present in the data stream.
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/schemaElement::mqsc/type::0/model::sequence/schemaElement::command), 154]

Jan 10, 2012 10:06:54 AM   error: CTDP3058E: Separator is missing for 'sequence' group contained within element 'mqsc', xpath: '/mqsc[1]' . 

Jan 10, 2012 10:06:54 AM   info: offset: 21. Parser was unable to resolve data on the current branch and will evaluate the next available branch beginning at offset '21' owned by the 'sequence' group contained within element 'mqsc'.
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/schemaElement::mqsc/type::0/model::sequence), 207]

Jan 10, 2012 10:06:54 AM   info: Offset: 21. Occurrence '2' of element 'command' was not found in the data. occursCountKind is 'parsed' so no more occurrences of this element will be expected.
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/schemaElement::mqsc/type::0/model::sequence/schemaElement::command), 168]

Jan 10, 2012 10:06:54 AM   info: Offset: 21. Finished processing element 'mqsc'.
                           [dfdl = /MQSC/mqsc.xsd, scd = #xscd(/schemaElement::mqsc), 55]

Jan 10, 2012 10:06:54 AM   fatal: CTDP3002E: Unexpected data found at offset '21' after parsing completed. Data: '0x2a...'.

Back to top
View user's profile Send private message
Michael Dag
PostPosted: Tue Jan 10, 2012 11:53 am    Post subject: Reply with quote

Jedi Knight

Joined: 13 Jun 2002
Posts: 2607
Location: The Netherlands (Amsterdam)

somehow the content of the message drew my attention
lookin for an MQSC to XML parser? (like MQDocument ?)

or is just meant as a 'sample' ?
_________________
Michael



MQSystems Facebook page
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
fjb_saper
PostPosted: Tue Jan 10, 2012 11:54 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Is he trying to write an "MQSC" parser??
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Tue Jan 10, 2012 12:03 pm    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

I am, indeed, trying to use DFDL to parse and serialize MQSC.

Note, that this is not the same thing as trying to write an MQSC parser.

Nor is it the same thing as looking for an MQSC to XML parser.
Back to top
View user's profile Send private message
Michael Dag
PostPosted: Tue Jan 10, 2012 12:10 pm    Post subject: Reply with quote

Jedi Knight

Joined: 13 Jun 2002
Posts: 2607
Location: The Netherlands (Amsterdam)

OK...

so once you are able to serialize the MQSC with DFDL, what do you want to do with it... *just curious*
_________________
Michael



MQSystems Facebook page
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
mqjeff
PostPosted: Tue Jan 10, 2012 12:39 pm    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Michael Dag wrote:
OK...

so once you are able to serialize the MQSC with DFDL, what do you want to do with it... *just curious*


Dunno. Seems like an interesting thing to play with, though.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Jan 10, 2012 12:51 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

So what is your plan for the message tree? (Just being curious here...)

Code:
Parameters as attributes like
<action><objectype name=objname .... attribute=value/></action>
or
<action>
  <objectype name=objname>
    <attr1>value1</attr1>
    <attrn>valuen</attrn>
  </objectype>
</action>


And even though the order of the parameters is not fixed, it still is not entirely random...

I guess at some point your model would end up mimicking the railroad diagram...

With the difference of the mandatory parameters for each of the operations, I don't know if it is possible to set up a completely generic model...

How do you plan to create the serialization model when the row length is 80 chars? One attribute per line?
And would your model be able to indistinctively parse multiple attributes per row (human writen) or 1 attribute per row (machine written)... to serialize to 1 attribute per row...?

How about content validation?
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Tue Jan 10, 2012 1:16 pm    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

I don't think a DFDL message tree has a notion of attributes. So I don't think I can construct a model that would create a message tree like
Code:
<action><objecttype name=objname.. attribute=value/></action>


The message tree the model is currently trying for is something like
Code:
Command
->DEFINE
->->QLOCAL
->->->QNAME, value="abc"
->->->....
->COMMENT
->->value="abc"

Where "value=" is intended to represent the equivalent of ESQL FIELDVALUE, i.e I'm trying to show a structure of MbElement objects.

Since that's what the message tree is, and not an XML structure.

It's not possible, I believe, to construct a generic model that would not know what is specific to DEFINE vs. SET and QLOCAL vs CHLAUTH and etc.

None of which has anything to do with the issues I'm having getting this model working in the simplified case presented.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Jan 10, 2012 1:19 pm    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Oh, and to clear up any potential confusion.

I posted an XSD, because DFDL uses XSDs to represent it's message models, in the same way that MRM uses XSDs to represent it's message models (at least until they're compiled into dicts).

So don't assume that, just because there's an XSD in this thread, that it is any way relates to XML data or XML parsing.

This thread is only about DFDL and parsing MQSC into a logical message tree and then serializing a logical message tree into MQSC.
Back to top
View user's profile Send private message
Michael Dag
PostPosted: Tue Jan 10, 2012 1:24 pm    Post subject: Reply with quote

Jedi Knight

Joined: 13 Jun 2002
Posts: 2607
Location: The Netherlands (Amsterdam)

clear I am not up to speed on DFDL yet, so thanks for the explanation... the only thing that triggered my response was feeding MQSC into the Broker
_________________
Michael



MQSystems Facebook page
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
mqjeff
PostPosted: Tue Jan 10, 2012 1:27 pm    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Michael Dag wrote:
clear I am not up to speed on DFDL yet, so thanks for the explanation... the only thing that triggered my response was feeding MQSC into the Broker


Mostly explanation was for future readers.

I agree, there's a lot of both interesting and horrible possibilities created by a message flow that can parse MQSC. that's why I'm playing with it. I don't have any *plans* for any of them, however.
Back to top
View user's profile Send private message
kimbert
PostPosted: Tue Jan 10, 2012 3:22 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

OK, I will start by admitting that I haven't actually tried this out so anything that I say could turn out to be wrong.

In the DFDL trace, everything looks fine and dandy until this line:
Code:
Jan 10, 2012 10:06:54 AM   error: CTDP3058E: Separator is missing for 'sequence' group contained within element 'mqsc', xpath: '/mqsc[1]' .

The parser has completely parsed the first line,(first occurrence of element 'command' ) and is expecting the separator for the outermost group. That separator is defined as '%SP;' which is the DFDL character entity representing a single space.
The last thing that the parser successfully matched was the newline that terminates the element 'DEFINE'. I don't see a space after that newline, and I suspect that this is why the parser is complaining.

Now you're going to ask what to do about it. Well, assuming that my diagnosis is correct I think you can just set the separator on the outermost complex type to the empty string.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Jan 11, 2012 4:54 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

kimbert wrote:
Well, assuming that my diagnosis is correct

That's like assuming that gravity works.
kimbert wrote:
I think you can just set the separator on the outermost complex type to the empty string.


That got me to now fail because the comment field doesn't swallow the whole line. Yet. A much easier issue to solve on my own...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » DFDL sequence/choice variable length
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.