[Progress Communities] [Progress OpenEdge ABL] SAX WRITE-DATA-ELEMENT: improve unknown value handling

Status
Not open for further replies.
S

Stefan Drissen

Guest
When a character field with an unknown value is passed to the write-data-element method warning 4065 is thrown (**The WRITE-DATA-ELEMENT attribute on the SAX-WRITER widget has invalid arguments): DEFINE TEMP-TABLE tt NO-UNDO FIELD ii AS INT FIELD cc AS CHAR . CREATE tt. ASSIGN tt.ii = 1 tt.cc = "". CREATE tt. ASSIGN tt.ii = 2 tt.cc = ?. DEF VAR hs AS HANDLE NO-UNDO. CREATE SAX-WRITER hs. hs:SET-OUTPUT-DESTINATION( "file", "foo.xml" ). hs:START-DOCUMENT(). hs:START-ELEMENT( "root" ). FOR EACH tt: MESSAGE tt.ii tt.cc. hs:WRITE-DATA-ELEMENT( "bar", tt.cc ). END. hs:END-ELEMENT( "root" ). hs:END-DOCUMENT(). FINALLY: DELETE OBJECT hs. END FINALLY. Since an unknown value is very similar to a null, this could be replaced with any one of the suggestions in: What is the correct way to represent null XML elements?

Continue reading...
 
Status
Not open for further replies.
Top