You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Venkat Reddy <va...@googlemail.com> on 2009/10/20 16:30:49 UTC

TLE value truncation (AFP extension)

Hi,

Please help me in finding the code related to this TLE value truncation 
happening for more than 254 bytes. The corresponding bug is already 
raised...

https://issues.apache.org/bugzilla/show_bug.cgi?id=47941

The MODCA documentation clearly states that 254 bytes allowed for the TLE value. I would like to take your inputs before digging into the code...

1. Is the behaviour correct (truncating after 254 bytes)?
2. Do we need to warn the user in this case?

Please point me to the code points and guide me to resolve this problem, if you can...

Thanks,
Venkat.


Re: TLE value truncation (AFP extension)

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
On 22.10.2009 13:07:27 Venkat Reddy wrote:
> Hi Jeremias,
> 
> I have gone through the code you metioned in 
> (org.apache.fop.afp.modca.TagLogicalElement, line 128), couldn't find 
> any truncation happening there for more than 254 bytes, but the afp 
> output file showing the TLE value upto 254 bytes..
> I have a doubt here...
> 
> 1. Is the FOP code truncating the TLE value (I couldn't find any 
> truncation functionality in the above fop code)?

No, that's the point. The truncation is missing. That's why there is
this bug.

> 2. If FOP is not truncating, then the viewer is showing only 254 bytes...

...and other AFP consumers might actually do something wrong or fail.

The spec says that the X'36' triplet can be at most 254 bytes long.
Subtract from that the 4 bytes (length + Tid + reserved) before the
actual value leaves a maximum number of bytes for the value of 250. FOP
needs to truncate to that.

> I am viewing the document in AFP Explorer, where it is showing the 
> length (300 for the first TLE value in attached fo file), but only 
> showing few characters in text...
> Could you please help me here, I am little confused in understanding 
> this....
> 
> Thanks,
> Venkat.
> 
> Venkat Reddy wrote:
> > Hi Jeremias,
> >
> > Thanks for the information. I will check the code and specs as you 
> > stated.
> >
> > Cheers,
> > Venkat.
> >
> > Jeremias Maerki wrote:
> >> On 20.10.2009 16:30:49 Venkat Reddy wrote:
> >>  
> >>> Hi,
> >>>
> >>> Please help me in finding the code related to this TLE value 
> >>> truncation happening for more than 254 bytes. The corresponding bug 
> >>> is already raised...
> >>>
> >>> https://issues.apache.org/bugzilla/show_bug.cgi?id=47941
> >>>
> >>> The MODCA documentation clearly states that 254 bytes allowed for 
> >>> the TLE value. I would like to take your inputs before digging into 
> >>> the code...
> >>>
> >>> 1. Is the behaviour correct (truncating after 254 bytes)?
> >>>     
> >>
> >> I think so. There seems to be an unarchitected mechanism [1] to extend
> >> the field length but the spec says its use is discouraged.
> >>
> >> [1] MO:DCA spec, Eighth Edition, "Structured Field Syntax", SFI
> >> semantics, Bytes 6-7, page 21/22.
> >>
> >>  
> >>> 2. Do we need to warn the user in this case?
> >>>     
> >>
> >> If the truncated part is not just whitespace, then yes, IMO.
> >>
> >>  
> >>> Please point me to the code points and guide me to resolve this 
> >>> problem, if you can...
> >>>     
> >>
> >> org.apache.fop.afp.modca.TagLogicalElement, line 128.
> >> Simply check if the value is longer than allowed and then check if the
> >> truncated part contains anything other than spaces.
> >>
> >>  
> >>> Thanks,
> >>> Venkat.
> >>>     
> >>
> >>
> >>
> >>
> >> Jeremias Maerki
> >>
> >>
> >>   
> >
> >
> 




Jeremias Maerki


Re: TLE value truncation (AFP extension)

Posted by Adrian Cumiskey <de...@cumiskey.com>.
Hi Venkat,

You are right, there is no truncation - but it should, truncation is 
required as pointed out by Harald in the bugzilla ticket 
(https://issues.apache.org/bugzilla/show_bug.cgi?id=47941).  The 
implementation of TagLogicalElement requires some rework anyway, as it 
is just hardwiring Triplets in there.  Don't worry I'll take care of this.

Adrian.

Venkat Reddy wrote:
> Hi Jeremias,
>
> I have gone through the code you metioned in 
> (org.apache.fop.afp.modca.TagLogicalElement, line 128), couldn't find 
> any truncation happening there for more than 254 bytes, but the afp 
> output file showing the TLE value upto 254 bytes..
> I have a doubt here...
>
> 1. Is the FOP code truncating the TLE value (I couldn't find any 
> truncation functionality in the above fop code)?
> 2. If FOP is not truncating, then the viewer is showing only 254 bytes...
>
> I am viewing the document in AFP Explorer, where it is showing the 
> length (300 for the first TLE value in attached fo file), but only 
> showing few characters in text...
> Could you please help me here, I am little confused in understanding 
> this....
>
> Thanks,
> Venkat.
>
> Venkat Reddy wrote:
>> Hi Jeremias,
>>
>> Thanks for the information. I will check the code and specs as you 
>> stated.
>>
>> Cheers,
>> Venkat.
>>
>> Jeremias Maerki wrote:
>>> On 20.10.2009 16:30:49 Venkat Reddy wrote:
>>>  
>>>> Hi,
>>>>
>>>> Please help me in finding the code related to this TLE value 
>>>> truncation happening for more than 254 bytes. The corresponding bug 
>>>> is already raised...
>>>>
>>>> https://issues.apache.org/bugzilla/show_bug.cgi?id=47941
>>>>
>>>> The MODCA documentation clearly states that 254 bytes allowed for 
>>>> the TLE value. I would like to take your inputs before digging into 
>>>> the code...
>>>>
>>>> 1. Is the behaviour correct (truncating after 254 bytes)?
>>>>     
>>>
>>> I think so. There seems to be an unarchitected mechanism [1] to extend
>>> the field length but the spec says its use is discouraged.
>>>
>>> [1] MO:DCA spec, Eighth Edition, "Structured Field Syntax", SFI
>>> semantics, Bytes 6-7, page 21/22.
>>>
>>>  
>>>> 2. Do we need to warn the user in this case?
>>>>     
>>>
>>> If the truncated part is not just whitespace, then yes, IMO.
>>>
>>>  
>>>> Please point me to the code points and guide me to resolve this 
>>>> problem, if you can...
>>>>     
>>>
>>> org.apache.fop.afp.modca.TagLogicalElement, line 128.
>>> Simply check if the value is longer than allowed and then check if the
>>> truncated part contains anything other than spaces.
>>>
>>>  
>>>> Thanks,
>>>> Venkat.
>>>>     
>>>
>>>
>>>
>>>
>>> Jeremias Maerki
>>>
>>>
>>>   
>>
>>
>
> ------------------------------------------------------------------------
>
> <?xml version="1.0" encoding="UTF-8"?>
> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg" xmlns:th="http://www.thunderhead.com/XSL/Extensions" xmlns:rx="http://www.renderx.com/XSL/Extensions" xmlns:afp="http://xmlgraphics.apache.org/fop/extensions/afp">
> 	<fo:layout-master-set>
> 		<fo:simple-page-master margin-left="20mm" margin-bottom="7mm" margin-right="13mm" master-name="PageFront" page-width="210mm" page-height="297mm">
> 			<afp:include-page-overlay name="GEN2TEST"/>
> 			<fo:region-body margin-top="20mm" margin-bottom="15mm" region-name="letterPageBody"/>
> 		</fo:simple-page-master>
> 		<fo:page-sequence-master master-name="FormsSequence">
> 			<fo:repeatable-page-master-alternatives>
> 				<fo:conditional-page-master-reference page-position="first" master-reference="PageFront"/>
> 				<fo:conditional-page-master-reference master-reference="PageFront" page-position="rest"/>
> 				<fo:conditional-page-master-reference master-reference="PageFront" page-position="last"/>
> 			</fo:repeatable-page-master-alternatives>
> 		</fo:page-sequence-master>
> 	</fo:layout-master-set>
> 	<fo:page-sequence initial-page-number="auto" force-page-count="auto" master-reference="FormsSequence">
> 		<afp:tag-logical-element name="JES0" value="JES00927200       90INITIATION     REGULAR        690-501   390- 127    27200021                                                                                                                                                                                                                            "/>
> 		<afp:tag-logical-element name="ACC1" value="ACC1374316469000000    690-501    EN                                                                                00                00                                                                                                                                                                                      "/>
> 		<afp:tag-logical-element name="ADR1" value="ADR1MICKEY MOUSE                                                                                      "/>
> 		<afp:tag-logical-element name="ADR2" value="ADR21234 MAIN STREET                                                                                  "/>
> 		<afp:tag-logical-element name="ADR3" value="ADR3ADDISON, TEXAS 12345-1234                                                                         "/>
> 		<afp:tag-logical-element name="ADR4" value="ADR4                                                                                                  "/>
> 		<afp:tag-logical-element name="ADR5" value="ADR5                                                                                                  "/>
> 		<afp:tag-logical-element name="ADR6" value="ADR6                                                                                                  "/>
> 		<fo:flow flow-name="letterPageBody">
> 			<fo:block>
> 				<fo:block/>
> 			</fo:block>
> 		</fo:flow>
> 	</fo:page-sequence>
> </fo:root>
>   


Re: TLE value truncation (AFP extension)

Posted by Venkat Reddy <va...@googlemail.com>.
Hi Jeremias,

I have gone through the code you metioned in 
(org.apache.fop.afp.modca.TagLogicalElement, line 128), couldn't find 
any truncation happening there for more than 254 bytes, but the afp 
output file showing the TLE value upto 254 bytes..
I have a doubt here...

1. Is the FOP code truncating the TLE value (I couldn't find any 
truncation functionality in the above fop code)?
2. If FOP is not truncating, then the viewer is showing only 254 bytes...

I am viewing the document in AFP Explorer, where it is showing the 
length (300 for the first TLE value in attached fo file), but only 
showing few characters in text...
Could you please help me here, I am little confused in understanding 
this....

Thanks,
Venkat.

Venkat Reddy wrote:
> Hi Jeremias,
>
> Thanks for the information. I will check the code and specs as you 
> stated.
>
> Cheers,
> Venkat.
>
> Jeremias Maerki wrote:
>> On 20.10.2009 16:30:49 Venkat Reddy wrote:
>>  
>>> Hi,
>>>
>>> Please help me in finding the code related to this TLE value 
>>> truncation happening for more than 254 bytes. The corresponding bug 
>>> is already raised...
>>>
>>> https://issues.apache.org/bugzilla/show_bug.cgi?id=47941
>>>
>>> The MODCA documentation clearly states that 254 bytes allowed for 
>>> the TLE value. I would like to take your inputs before digging into 
>>> the code...
>>>
>>> 1. Is the behaviour correct (truncating after 254 bytes)?
>>>     
>>
>> I think so. There seems to be an unarchitected mechanism [1] to extend
>> the field length but the spec says its use is discouraged.
>>
>> [1] MO:DCA spec, Eighth Edition, "Structured Field Syntax", SFI
>> semantics, Bytes 6-7, page 21/22.
>>
>>  
>>> 2. Do we need to warn the user in this case?
>>>     
>>
>> If the truncated part is not just whitespace, then yes, IMO.
>>
>>  
>>> Please point me to the code points and guide me to resolve this 
>>> problem, if you can...
>>>     
>>
>> org.apache.fop.afp.modca.TagLogicalElement, line 128.
>> Simply check if the value is longer than allowed and then check if the
>> truncated part contains anything other than spaces.
>>
>>  
>>> Thanks,
>>> Venkat.
>>>     
>>
>>
>>
>>
>> Jeremias Maerki
>>
>>
>>   
>
>


Re: TLE value truncation (AFP extension)

Posted by Venkat Reddy <va...@googlemail.com>.
Hi Jeremias,

Thanks for the information. I will check the code and specs as you stated.

Cheers,
Venkat.

Jeremias Maerki wrote:
> On 20.10.2009 16:30:49 Venkat Reddy wrote:
>   
>> Hi,
>>
>> Please help me in finding the code related to this TLE value truncation 
>> happening for more than 254 bytes. The corresponding bug is already 
>> raised...
>>
>> https://issues.apache.org/bugzilla/show_bug.cgi?id=47941
>>
>> The MODCA documentation clearly states that 254 bytes allowed for the TLE value. I would like to take your inputs before digging into the code...
>>
>> 1. Is the behaviour correct (truncating after 254 bytes)?
>>     
>
> I think so. There seems to be an unarchitected mechanism [1] to extend
> the field length but the spec says its use is discouraged.
>
> [1] MO:DCA spec, Eighth Edition, "Structured Field Syntax", SFI
> semantics, Bytes 6-7, page 21/22.
>
>   
>> 2. Do we need to warn the user in this case?
>>     
>
> If the truncated part is not just whitespace, then yes, IMO.
>
>   
>> Please point me to the code points and guide me to resolve this problem, if you can...
>>     
>
> org.apache.fop.afp.modca.TagLogicalElement, line 128.
> Simply check if the value is longer than allowed and then check if the
> truncated part contains anything other than spaces.
>
>   
>> Thanks,
>> Venkat.
>>     
>
>
>
>
> Jeremias Maerki
>
>
>   


Re: TLE value truncation (AFP extension)

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
On 20.10.2009 16:30:49 Venkat Reddy wrote:
> Hi,
> 
> Please help me in finding the code related to this TLE value truncation 
> happening for more than 254 bytes. The corresponding bug is already 
> raised...
> 
> https://issues.apache.org/bugzilla/show_bug.cgi?id=47941
> 
> The MODCA documentation clearly states that 254 bytes allowed for the TLE value. I would like to take your inputs before digging into the code...
> 
> 1. Is the behaviour correct (truncating after 254 bytes)?

I think so. There seems to be an unarchitected mechanism [1] to extend
the field length but the spec says its use is discouraged.

[1] MO:DCA spec, Eighth Edition, "Structured Field Syntax", SFI
semantics, Bytes 6-7, page 21/22.

> 2. Do we need to warn the user in this case?

If the truncated part is not just whitespace, then yes, IMO.

> Please point me to the code points and guide me to resolve this problem, if you can...

org.apache.fop.afp.modca.TagLogicalElement, line 128.
Simply check if the value is longer than allowed and then check if the
truncated part contains anything other than spaces.

> Thanks,
> Venkat.




Jeremias Maerki