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 » Need DFDL library to not trim the leading spaces

Post new topic  Reply to topic Goto page 1, 2  Next
 Need DFDL library to not trim the leading spaces « View previous topic :: View next topic » 
Author Message
somsayan
PostPosted: Thu Apr 16, 2015 8:30 am    Post subject: Need DFDL library to not trim the leading spaces Reply with quote

Apprentice

Joined: 06 Apr 2007
Posts: 49

Hi All,

We are using Message Broker 8.0.0.4 on AIX box. The requirement we have is to extract IDOCs out of SAP and for that we have built a flow and it processes the particular IDOC using DFDL.
The IDOC has a particular field in the segment that is right justified and it is padded with ' ' (Space). Naturally the DFDL that got generated via IDOC discovery is trimming the space in front of the data.

Now comes the unnatural requirement to 'not trim' the data. How can we achieve this?

We have tried the to change the XSD to incorporate the requirement
Code:

<xsd:element maxOccurs="1" minOccurs="0" name="FIELD1" nillable="true">
<xsd:annotation xml:space="preserve">
<xsd:appinfo source="http://www.ibm.com/xmlns/prod/websphere/j2ca/sap/metadata">
<sapasi:sapALEPropertyTypeMetadata>
<sapasi:FieldName>FIELD1</sapasi:FieldName>
<sapasi:SegmentHierarchy>0</sapasi:SegmentHierarchy>
<sapasi:OffSet>21</sapasi:OffSet>
<sapasi:PrimaryKey>false</sapasi:PrimaryKey>
<sapasi:MaxLength>229</sapasi:MaxLength>
<sapasi:ForeignBOKeyRef/>
</sapasi:sapALEPropertyTypeMetadata>
</xsd:appinfo>
</xsd:annotation>

<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="229"/>
[color=red]<xsd:whiteSpace value="preserve"/>[/color]
</xsd:restriction>
</xsd:simpleType>
</xsd:element>


But this is not working.

Can anyone suggest a way out ?
Back to top
View user's profile Send private message
mqjeff
PostPosted: Thu Apr 16, 2015 8:46 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

probably just make it a fixed length field.
Back to top
View user's profile Send private message
somsayan
PostPosted: Thu Apr 16, 2015 9:10 am    Post subject: Reply with quote

Apprentice

Joined: 06 Apr 2007
Posts: 49

Hi mqjeff,

It is a fixed length field. Its the DFDL that trims out the leading and trailing ' '.
What I would like is to not trim that. Hence added the <xsd:whiteSpace value="preserve"/>line in the xsd. But that doesn't seem to work.
Is there any other way to make it work ?
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Thu Apr 16, 2015 9:16 am    Post subject: Reply with quote

Grand High Poobah

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

somsayan wrote:
Hi mqjeff,

It is a fixed length field. Its the DFDL that trims out the leading and trailing ' '.
What I would like is to not trim that. Hence added the <xsd:whiteSpace value="preserve"/>line in the xsd. But that doesn't seem to work.
Is there any other way to make it work ?

I presume your DFDL field is set to right justified padded... What type of value is in this field. If it is something that needs to keep the leading blanks, than a right justified field is may be not the way to go...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
kimbert
PostPosted: Thu Apr 16, 2015 1:13 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
What I would like is to not trim that. Hence added the <xsd:whiteSpace value="preserve"/>line in the xsd.
Everything that you need to know about padding and trimming in DFDL is in the specification:
http://www-01.ibm.com/support/knowledgecenter/SSMKHH_10.0.0/com.ibm.dfdl.spec.doc/dfdl_index.htm
The xsd:whiteSpace facet is not useful for DFDL because it does not allow the required amount of control over white space handling. So the specification explicitly states that it is not used.
_________________
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
shanson
PostPosted: Fri Apr 17, 2015 6:39 am    Post subject: Reply with quote

Partisan

Joined: 17 Oct 2003
Posts: 344
Location: IBM Hursley

Add dfdl:textTrimKind="none" to all the elements for which you do not want trimming to occur.
Back to top
View user's profile Send private message
somsayan
PostPosted: Mon Apr 20, 2015 4:31 am    Post subject: Reply with quote

Apprentice

Joined: 06 Apr 2007
Posts: 49

Hi Shanson, kimbert

Thanks for your reply. But when we are generating the library using Discovery, we are creating only xsd files and there are no dfdl files created.

Are we missing something ?
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Apr 20, 2015 4:35 am    Post subject: Reply with quote

Grand High Poobah

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

somsayan wrote:
Hi Shanson, kimbert

Thanks for your reply. But when we are generating the library using Discovery, we are creating only xsd files and there are no dfdl files created.

Are we missing something ?

Don't use Discovery. Get and example and Use the DFDL editor's discovery facilities?
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
shanson
PostPosted: Mon Apr 20, 2015 6:34 am    Post subject: Reply with quote

Partisan

Joined: 17 Oct 2003
Posts: 344
Location: IBM Hursley

Please explain exactly what your message flow is doing.

If you are using adapter discovery to create the xsds then you will be using DataObject domain and not DFDL.

Are you using a generic IDoc, and trying to parse it using DFDL?
Back to top
View user's profile Send private message
somsayan
PostPosted: Mon Apr 20, 2015 7:23 am    Post subject: Reply with quote

Apprentice

Joined: 06 Apr 2007
Posts: 49

Hi shanson,

I'm using DataObject and not DFDL. Sorry for the confusion.
Back to top
View user's profile Send private message
jhosie
PostPosted: Tue Apr 21, 2015 4:15 am    Post subject: Reply with quote

Apprentice

Joined: 12 May 2005
Posts: 28

The recommended way to configure the DataObject parsing is to use the Adapter wizard rather than editing the xsd directly.

You can reconfigure an existing adapter by right clicking on it and chosing "iterative discovery".

In that wizard, on the page with the title "Service Generation and Deployment Configuration", expand the Advanced twistie, and you will see "ALE Data Format configuration" and in that section an option to "Trim ALE IDoc field data". It defaults to true (checked) but it you unckeck it, I am pretty sure that will mean that your white space will be preserved.
Back to top
View user's profile Send private message
somsayan
PostPosted: Tue Apr 21, 2015 7:11 am    Post subject: Reply with quote

Apprentice

Joined: 06 Apr 2007
Posts: 49

jhosie wrote:

In that wizard, on the page with the title "Service Generation and Deployment Configuration", expand the Advanced twistie, and you will see "ALE Data Format configuration" and in that section an option to "Trim ALE IDoc field data". It defaults to true (checked) but it you unckeck it, I am pretty sure that will mean that your white space will be preserved.


Hi jhosie,

That was the first option we tried. We couldn't make it to work.
Back to top
View user's profile Send private message
shanson
PostPosted: Tue Apr 21, 2015 8:20 am    Post subject: Reply with quote

Partisan

Joined: 17 Oct 2003
Posts: 344
Location: IBM Hursley

Is there any difference between the xsd created with the option checked, and the xsd created with the option not checked?
Back to top
View user's profile Send private message
somsayan
PostPosted: Tue Apr 21, 2015 1:08 pm    Post subject: Reply with quote

Apprentice

Joined: 06 Apr 2007
Posts: 49

shanson wrote:
Is there any difference between the xsd created with the option checked, and the xsd created with the option not checked?


No there isn't any difference between the contents of the two xsd's.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Apr 22, 2015 4:26 am    Post subject: Reply with quote

Grand High Poobah

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

Can you explain why you need the trailing spaces?
SAP doesn't care so much about the trailing spaces... It will fill them in as it creates and populates the field....
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
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 » Need DFDL library to not trim the leading spaces
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.