Return type:
WRITE-XML ( target-type, file stream stream-handle memptr handle longchar, formatted , encoding , schema-location , write-xmlschema, min-xmlschema , write-before-image , omit-initial-values)A CHARACTER expression that specifies the target XML document type. Valid values are: "FILE", "STREAM", "STREAM-HANDLE", "MEMPTR", "HANDLE", and "LONGCHAR".A CHARACTER expression that specifies the name of a file to which the AVM writes the XML document text. You can specify an absolute pathname or a relative pathname (based on the current working directory). If a file with the specified name already exists, the AVM verifies that the file is writeable and overwrites the file. The pathname can contain Unicode characters. See OpenEdge Development: Internationalizing Applications for more information about Unicode.A CHARACTER expression that specifies the name of a stream. If you specify the empty string (""), the AVM writes the XML document text to the default unnamed output stream. For WebSpeed, write the XML document text to the WebSpeed-defined output stream (WEBSTREAM).For more information about using ABL unnamed output streams, see the DEFINE STREAM statement reference entry and the chapter on alternate I/O sources in OpenEdge Development: Programming Interfaces. For more information about using WebSpeed-defined output streams, see OpenEdge Application Server: Developing WebSpeed Applications.The AVM saves the XML document text to the LONGCHAR variable in the code page that corresponds to the character encoding you specify in the encoding option. If you do not specify a character encoding for the XML document text, the AVM saves the LONGCHAR variable in UTF-8.If the LONGCHAR variable’s code page is fixed (that is, set using the FIX-CODEPAGE statement) and the fixed code page is not equivalent to the character encoding you specify in the encoding option, the WRITE-XML( ) method returns an error and the XML document is not saved to the LONGCHAR.If you specify the Unknown value (?), the method uses the default value of FALSE.The encoding name must be an Internet Assigned Numbers Authority (IANA) name supported by the ABL XML Parser. For a list of supported IANA encodings and their corresponding ABL code pages, see Table 77 in the ENCODING attribute reference entry.
Note: The AVM records this character encoding in the encoding declaration in the XML document’s prologue. If you specify the empty string ("") or the Unknown value (?), the AVM uses the default encoding of UTF-8. In this case, the AVM does not record the character encoding in the XML document’s encoding declaration.An optional CHARACTER expression that specifies the name of an external XML Schema file. The method uses this value to set the xsi:schemaLocation or xsi:noNamespaceSchemaLocation attribute in the XML document. If the ProDataSet or temp-table object’s NAMESPACE-URI attribute is the empty string ("") or the Unknown value (?), the method adds the xsi:noNamespaceSchemaLocation attribute in the XML document and sets it to this value. If the NAMESPACE-URI attribute is not the empty string ("") or the Unknown value (?), the method adds the xsi:schemaLocation attribute to the XML document with a value of "namespace-uri<space>schema-location". The default value is the Unknown value (?). The filename can contain Unicode characters.If you specify TRUE, you cannot specify schema-location. If you specify FALSE, you must also specify min-xmlschema as FALSE. If you specify the Unknown value (?), the method uses the default value of FALSE.
Note: If you specify TRUE and the NAMESPACE-URI attribute value for a temp-table buffer within a ProDataSet object is different than that of the ProDataSet object, the method creates a separate XML Schema file for the temp-table definition. The namespace URI for the temp-table is imported into the ProDataSet schema, with a schemaLocation pointing to a separate XML Schema file containing the temp-table definition. Multiple namespaces are supported only when target-type is "FILE". If the ProDataSet object contains multiple namespaces and target-type is not "FILE", the method generates an error and returns FALSE.An optional LOGICAL expression where TRUE directs the AVM to write the minimum amount of schema when it writes the XML Schema representation of the object, and FALSE directs the AVM to write the complete schema including ABL-specific schema attributes. The default value is FALSE. If you specify the Unknown value (?), the method uses the default value of FALSE.When TRUE, ABL-specific schema information (such as, field format, non-unique indexes, and so on) is omitted from the XML Schema. If the ABL data type of the temp-table field is not the default ABL data type for the XML Schema type, the AVM writes the prodata:dataType XML Schema attribute for the field. If the initial value of the temp-table field is TODAY, NOW, or UNKNOWN (and UNKNOWN is not the default initial value for the field’s data type), the AVM writes the prodata:initial XML Schema attribute for the field.An optional LOGICAL expression where TRUE directs the AVM to write any before-image table data and error information in addition to the ProDataSet object data, and FALSE directs the AVM to write only the ProDataSet object data. The default value is FALSE. If you specify the Unknown value (?), the method uses the default value of FALSE.An optional LOGICAL expression where TRUE directs the AVM to exclude temp-table fields containing their initial values from the XML document, and FALSE directs the AVM to include all temp-table field data in the XML. The default value is FALSE. If you specify the Unknown value (?), the method uses the default value of FALSE.For example, .NET can read an XML Schema and XML data document into a dynamic ADO .NET DataSet using its ReadXmlSchema( ) and ReadXml( ) APIs, but missing elements are always interpreted as a null (the Unknown value (?) in ABL terms) DataColumn in the DataTable. They do recognize the initial value definition in the XML Schema when creating rows in the DataTable directly (initial value in the XML Schema gets translated to the DefaultValue property on the DataColumn), but do not with ReadXml( ).
Using the ADD-PARENT-ID-RELATION( ) method on a dynamic ProDataSet object
© 2013 Progress Software Corporation and/or its subsidiaries or affiliates. |