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 » Deploying BAR file with DFDL schema fails

Post new topic  Reply to topic
 Deploying BAR file with DFDL schema fails « View previous topic :: View next topic » 
Author Message
snredditch2
PostPosted: Mon Jul 14, 2014 5:19 pm    Post subject: Deploying BAR file with DFDL schema fails Reply with quote

Newbie

Joined: 14 Jul 2014
Posts: 9

I'm new to the world of DFDL so I thought I'd have a go at parsing the Video Library Sample TDS message using DFDL instead of MRM.

On trying to deploy the BAR file containing the DFDL schema, I am getting the following error:

<CTDM2201E : DFDL property is not expected. Property 'dfdl:separator', object 'xsd:element #Borrowed'.'

If I run 'Test Parse Model' with the following input file:


{Name:[Title:Mr*FirstName:Fred*LastName:Bloggs]&Address:[HouseNo:12*Street:Willow Avenue*Town:Salisbury]&ID:P&PassportNo:J123456TT&Borrowed:[Fast Cars+2003-05-23+3.00]&Borrowed:[Cut To The Chase+2003-05-23+3.75]&Magazine:1}

all is well.

I'm running IBM Integration Bus version 9.0.0.2 on Windows (64 bit)


DFDL schema:
-----------------

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:ibmSchExtn="http://www.ibm.com/schema/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}" encoding="{$dfdl:encoding}" escapeSchemeRef="recSepFieldsFmt:RecordEscapeScheme" occursCountKind="fixed" ref="recSepFieldsFmt:RecordSeparatedFieldsFormat"/>
      </xsd:appinfo>
   </xsd:annotation>

   <xsd:element ibmSchExtn:docRoot="true" name="VideoStoreDetails">
      <xsd:complexType>
         <xsd:sequence dfdl:separator="%CR;%LF;%WSP*;">
            <xsd:element dfdl:initiator="{{" dfdl:terminator="}" dfdl:occursCountKind="implicit" maxOccurs="unbounded" name="body">
                 <xsd:complexType>
                  <xsd:sequence dfdl:separator="&amp;">
                     <xsd:element dfdl:initiator="Name:[" dfdl:terminator="]" name="Name">
                        <xsd:complexType>
                           <xsd:sequence dfdl:separator="*">
                              <xsd:element dfdl:initiator="Title:" dfdl:lengthKind="delimited" name="Tital" type="xsd:string"/>
                              <xsd:element dfdl:initiator="FirstName:" dfdl:lengthKind="delimited" name="FirstName" type="xsd:string"/>
                              <xsd:element dfdl:initiator="LastName:" dfdl:lengthKind="delimited" name="LastName" type="xsd:string"/>
                           </xsd:sequence>
                        </xsd:complexType>
                     </xsd:element>
                     <xsd:element dfdl:initiator="Address:[" dfdl:terminator="]" name="Address">
                        <xsd:complexType>
                           <xsd:sequence dfdl:separator="*">
                              <xsd:element dfdl:initiator="HouseNo:" dfdl:lengthKind="delimited" name="HouseNo" type="xsd:string"/>
                               <xsd:element dfdl:initiator="Street:" dfdl:lengthKind="delimited" name="Street" type="xsd:string"/>
                              <xsd:element dfdl:initiator="Town:" dfdl:lengthKind="delimited" name="Town" type="xsd:string"/>
                           </xsd:sequence>
                        </xsd:complexType>
                     </xsd:element>
                     <xsd:element dfdl:initiator="ID:" dfdl:lengthKind="delimited" name="ID" type="xsd:string"/>
                     <xsd:element dfdl:initiator="PassportNo:" dfdl:lengthKind="delimited" name="PassportNo" type="xsd:string"/>
                     <xsd:element dfdl:initiator="Borrowed:[" dfdl:separator="&amp;Borrowed:[" dfdl:terminator="]" dfdl:occursCountKind="implicit" maxOccurs="unbounded" name="Borrowed">
                        <xsd:complexType>
                           <xsd:sequence dfdl:separator="+">
                              <xsd:element dfdl:lengthKind="delimited" name="VideoTitle" type="xsd:string"/>
                              <xsd:element dfdl:lengthKind="delimited" name="BorrowedDate" type="xsd:string"/>
                              <xsd:element dfdl:lengthKind="delimited" name="Charge" type="xsd:string"/>
                           </xsd:sequence>
                        </xsd:complexType>
                     </xsd:element>
                     <xsd:element dfdl:initiator="Magazine:" dfdl:lengthKind="delimited" name="Magazine" type="xsd:string"/>
                  </xsd:sequence>
               </xsd:complexType>
            </xsd:element>
            </xsd:sequence>
         </xsd:complexType>
      </xsd:element>                  
</xsd:schema>
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Jul 14, 2014 8:10 pm    Post subject: Reply with quote

Grand High Poobah

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

Looks like your setup for borrowed is not right.
Code:
<xsd:element dfdl:initiator="Borrowed:[" dfdl:separator="&amp;Borrowed:[" dfdl:terminator="]" dfdl:occursCountKind="implicit" maxOccurs="unbounded" name="Borrowed">


I'd have thought it should look like this:
Code:
<xsd:element dfdl:initiator="Borrowed:[" dfdl:separator="&amp;" dfdl:terminator="]" dfdl:occursCountKind="implicit" maxOccurs="unbounded" name="Borrowed">


Note the difference in the separator, but for all I care the separator should come from the preceding sequence, i.e. I would not have it on the element and at best the separator I would have on the element would be for it's subfields i.e. "+", but then you're going to put that on the following sequence.... so... how did you build the model? with the DFDL graphical model builder?

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
snredditch2
PostPosted: Tue Jul 15, 2014 9:37 am    Post subject: Got it working! Reply with quote

Newbie

Joined: 14 Jul 2014
Posts: 9

Inserting an extra sequence - as alluded to in your reply - did the trick, see below:

Code:
<xsd:element name="Borrowed">
   <xsd:complexType>
      <xsd:sequence dfdl:separator="&amp;">
         <xsd:element dfdl:initiator="Borrowed:[" dfdl:terminator="]" dfdl:occursCountKind="implicit" maxOccurs="unbounded" name="BorrowedRec">
            <xsd:complexType>
               <xsd:sequence dfdl:separator="+">
                  <xsd:element dfdl:lengthKind="delimited" name="VideoTitle" type="xsd:string"/>
                  <xsd:element dfdl:lengthKind="delimited" name="BorrowedDate" type="xsd:string"/>
                  <xsd:element dfdl:lengthKind="delimited" name="Charge" type="xsd:string"/>
               </xsd:sequence>
            </xsd:complexType>
         </xsd:element>
      </xsd:sequence>
   </xsd:complexType>                     
</xsd:element>


This generates the following XML for 'Borrowed' :

Code:
<Borrowed>
   <BorrowedRec>
       <VideoTitle xsi:type="xs:string">Fast Cars</VideoTitle>
       <BorrowedDate xsi:type="xs:string">2003-05-23</BorrowedDate>
       <Charge xsi:type="xs:string">3.00</Charge>
  </BorrowedRec>
  <BorrowedRec>
       <VideoTitle xsi:type="xs:string">Cut To The Chase</VideoTitle>
       <BorrowedDate xsi:type="xs:string">2003-05-23</BorrowedDate>
       <Charge xsi:type="xs:string">3.75</Charge>
  </BorrowedRec>
</Borrowed>


It seems you can't put a 'separator' on anything but a 'sequence', although the previous version of the toolkit DID allow you to put a 'separator' on an 'element', but then through it out on deploying the BAR file.

One final question, is there any way to generate 2 occurrences of 'Borrowed' without the further level of 'BorrowedRec'?
Back to top
View user's profile Send private message
kimbert
PostPosted: Tue Jul 15, 2014 12:19 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
It seems you can't put a 'separator' on anything but a 'sequence'
Correct - the DFDL specification says so.

Quote:
is there any way to generate 2 occurrences of 'Borrowed' without the further level of 'BorrowedRec'?
I think that would require you to set maxOccurs>1 on a sequence group. DFDL does not allow sequence or choice groups to repeat.
_________________
Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too.
Back to top
View user's profile Send private message
snredditch2
PostPosted: Tue Jul 15, 2014 12:45 pm    Post subject: Thanks Reply with quote

Newbie

Joined: 14 Jul 2014
Posts: 9

Thank you for your help
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 » Deploying BAR file with DFDL schema fails
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.