ABL keyword as fieldname in a dynamic temp-table and READ-XML - Forum - OpenEdge Development - Progress Community

ABL keyword as fieldname in a dynamic temp-table and READ-XML

 Forum

ABL keyword as fieldname in a dynamic temp-table and READ-XML

This question is answered

Good evening,

a dynamic temp-table can contain a field named "TITLE" (an ABL keyword) - a static temp-table cannot - OK.

When I WRITE-XML such a dynamic temp-table (with schema), the resulting XML contains as expected the field named "TITLE" in both the schema and the data section.

However, when I create a dynamic dataset (no tables added yet) and READ-XML the xml file, the resulting temp-table in the dataset contains a field named "TITLE1" - probably to workaround the ABL keyword restriction. However, as a dynamic temp-table can contain a field named "TITLE" this does not seem to be required.

Is that a bug - or a feature? And is there a way to turn that behavior off? 

Architect of the SmartComponent Library and WinKit

Consultingwerk Ltd.

Verified Answer
  • Hi ,

    It looks like it could be a bug so I would report it to your local TS center.

    In case it's not obvious you can work around this using SERIALIZE-NAME.

    e.g. After ht:temp-table-prepare( "tt" ), add

    ht:DEFAULT-BUFFER-HANDLE:BUFFER-FIELD("title"):SERIALIZE-NAME = "title".

    Ken Mc

    Kenneth S. McIntosh

    Principal Technical Support Engineer

     

     

All Replies
  • I do not see this happening on 11.7.4, 12.0 or 12.2 esap-2 - see abldojo.services.progress.com:443/

    Maybe something else going on?

  • CustomerForm.xml

    Here's my repro (12.1).:

    BLOCK-LEVEL ON ERROR UNDO, THROW.
    
    DEFINE VARIABLE hDataset AS HANDLE NO-UNDO.
    DEFINE VARIABLE hBuffer AS HANDLE NO-UNDO.
    DEFINE VARIABLE i AS INTEGER NO-UNDO.
    
    /* ***************************  Main Block  *************************** */
    
    CREATE DATASET hDataset .
    
    hDataset:READ-XML ("file", "Repository/Cache/Default/CustomerForm.xml", ?, ?, ?) .
    
    ASSIGN hBuffer = hDataset::MetaForm .
    
    DO i = 1 TO hBuffer:NUM-FIELDS:
        DISPLAY hBuffer:BUFFER-FIELD (i):NAME FORMAT "x(40)" WITH DOWN.
        DOWN 1 .
    END.

    Architect of the SmartComponent Library and WinKit

    Consultingwerk Ltd.

  • Oops - I was simplifying a bit too much. New nice concise repro here

    def var ht as handle.
    def var hb as handle.
    def var lcc as longchar extent 2.
    def var hds as handle extent 2.
    def var hf as handle no-undo extent 2.
    
    
    create dataset hds[1].
    create temp-table ht.
    ht:add-new-field( "title", "character" ).
    ht:temp-table-prepare( "tt" ).
    
    hb = ht:default-buffer-handle.
    hds[1]:add-buffer( hb ).
    hb:buffer-create().
    hb:buffer-field( "title" ):buffer-value = "forbidden".
    
    hds[1]:write-xml( "longchar", lcc[1], true, ?, ?, true ).
    
    message 'initial' skip(1) string( lcc[1] ) skip(2).
    
    create dataset hds[2].
    hds[2]:read-xml( "longchar", lcc[1], ?, ?, ? ).
    
    hds[2]:write-xml( "longchar", lcc[2], true ).
    
    message 'ds' skip(1) string( lcc[2] ) skip(2).
    
    message 'field name:' hds[2]::tt:buffer-field(1):name.
    
  • Not sure if that should make me happy or not … thanks for trying Stefan.
     
    If nobody from development or anybody else has an idea I’ll log this with tech support. Didn’t find anything in the documentation about such a behavior.

    Architect of the SmartComponent Library and WinKit

    Consultingwerk Ltd.

  • Not sure why Stefan's post has disappeared ... but here's his Dojo that reproduces the issue:

    abldojo.services.progress.com/

    Architect of the SmartComponent Library and WinKit

    Consultingwerk Ltd.

  • The "rich" editor mutilated my post, after cleaning it up it went into the moderation queue. I could be a spammer...

  • Oh sure!
     
    Von: Stefan Drissen <bounce-14941@community.progress.com>
    Gesendet: Montag, 10. Februar 2020 23:41
    An: TU.OE.Development@community.progress.com
    Betreff: RE: [Technical Users - OE Development] ABL keyword as fieldname in a dynamic temp-table and READ-XML
     
    Update from Progress Community
     

    The "rich" editor mutilated my post, after cleaning it up it went into the moderation queue. I could be a spammer...

    View online

     

    You received this notification because you subscribed to the forum.  To unsubscribe from only this thread, go here.

    Flag this post as spam/abuse.

     

    Architect of the SmartComponent Library and WinKit

    Consultingwerk Ltd.

  • Hi ,

    It looks like it could be a bug so I would report it to your local TS center.

    In case it's not obvious you can work around this using SERIALIZE-NAME.

    e.g. After ht:temp-table-prepare( "tt" ), add

    ht:DEFAULT-BUFFER-HANDLE:BUFFER-FIELD("title"):SERIALIZE-NAME = "title".

    Ken Mc

    Kenneth S. McIntosh

    Principal Technical Support Engineer

     

     

  • Wow - as clunky as it sounds - it actually works - I think Mike will be happy (and he can report his bug to TS).

  • Thanks Ken. That does the trick.

    So I need to add the lower case version of the field name as the serialize name to enforce the prodata:fieldName="TITLE" in the schema section of the XML document.

    I'll log this with your colleagues in R'dam tomorrow.

    Architect of the SmartComponent Library and WinKit

    Consultingwerk Ltd.