Setting that controls the type of metadata generated with the XML exported from a DataWindow object using the SaveAs method or a .Data.XML expression.
DataWindow objects
PowerBuilder dot notation:
dw_control.Object.DataWindow.Export.XML.MetaDataType
Describe and Modify argument:
"DataWindow.Export.XML.MetaDataType { = 'value ' }"
Parameter |
Description |
---|---|
value |
(exp) A string specifying a value of the Export.XML.MetaDataType enumerated datatype |
This property must be set to specify the type of metadata generated before you call the SaveAs method with XML! as the SaveAsType to save data as an XML document, or use the .Data.XML expression to save data as an XML string. The metadata is saved into the exported XML itself or into an associated file, depending on the value of the Export.XML.SaveMetaData property.
The Export.XML.MetaDataType property is an enumerated datatype that can hold the following values:
Enumerated value |
Numeric value |
Meaning |
---|---|---|
XMLNone! |
0 |
Metadata (XML Schema or DTD) is not generated when XML is exported |
XMLSchema! |
1 |
XML Schema is generated when XML is exported |
XMLDTD! |
2 |
DTD is generated when XML is exported |
If the data item for a column is null or an empty
string, an empty element is created when you export XML. If
you select XMLSchema!, child elements with null data
items are created with the content "xsi:nil='true'"
.
In the Data Export tab in the Properties view for the DataWindow object, select XML from the Format to Configure list and select a value from the Meta Data Type list.
This statement specifies that no metadata will be generated when the DataWindow is exported to XML:
dw1.Object.DataWindow.Export.XML.MetaDataType = XMLNone!
These statements export the contents of dw1 to the file c:\myxml.xml using the XML export template called t_schema, and generate an external XML schema file at c:\myxml.xsd:
dw1.Modify("DataWindow.Export.XML.UseTemplate = 't_schema'") dw1.Modify("DataWindow.Export.XML.MetaDataType = 1") dw1.Modify("DataWindow.Export.XML.SaveMetaData = 1") dw1.SaveAs("c:\myxml.xml", XML!, false)