Dynamic Xml To Datawindow In PowerBuilder

Dynamic Xml To Datawindow In PowerBuilder

Dynamic Xml To Datawindow In PowerBuilder
Dynamic Xml To Datawindow In PowerBuilder 2

XML Syntax for XML2DW:

  • Syntax 1 (Simple) – All column types are char(4000) and labels are constructed by replacing underscores in the column name with spaces and capitalizing each word

Syntax:

<column>column1 name</column>

<column>column2 name</column>

Example:

<column>col1</column>

<column>col2</column>

<column>col3</column>

  • Syntax 2 (Complex) – NOTE: <value> element is used for dw testing and does not affect the resulting DW syntax. It simply sets that column’s value after syntax creation in the preview. It also doesn’t do anything if the <type> tag is used to change the column type from a type that accepts the entered string.

Syntax:

<column>

<name>column1 name</name>

[<label>column1 label</label>]

[<type>column1 datatype</type>]

[<width>column1 width</width>]

[<value>column1 value</value>]

</column>

<column>

<name>column2 name</name>

[<label>column2 label</label>]

[<type>column2 datatype</type>]

[<width>column2 width</width>]

[<value>column2 value</value>]

</column>

Example:

<column>

<name>col1</name>

<label>Column #1</label>

<type>char(10)</type>

<width>300</width>

<value>abcdefghij</value>

</column>

<column>

<name>col2</name>

<type>number</type>

<width>50</width>

</column>

<column>col3</column>

  • Syntax 3 (Row data)

Syntax:

<tablename_row>

<column1 name>ignored data value1

[<label>column1 label</label>]

[<type>column1 datatype</type>]

[<width>column1 width</width>]

[<value>column1 value</value>]

</column1 name>

<column2 name>ignored data value2

[<label>column2 label</label>]

[<type>column2 datatype</type>]

[<width>column2 width</width>]

[<value>column2 value</value>]

</column2 name>

</tablename_row>

Example:

<table_row>

<col1>column #1</col1>

<col2>6/9/2003

<type>datetime</type>

</col2>

</table_row>

NOTES:

In syntax 2, all subtags are optional except if <name> is not used then all other subtags are ignored.

In syntax 3, all subtags are optional.

In 2 & 3, the order of the subtags does not matter. Also, if a subtag is found more than once for the same column, all instances of it will be ignored for that column.

In all syntaxes, any characters outside the tags are ignored.

Code Example:

Datawindow d_color_list

Datawindow d_dwparms

Datawidow d_dwtype

nv_xml from nonvisualobject

s_dwparms from structure

gf_create_from_xml from function_object

gf_proper_name from function_object

gf_set_default_dw_parms from function_object

w_createdw from window

w_dwparams from window

dynamicxmltodw from application

Find Projects On Github click here

Good Luck!

Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments