Read XML Schema into a temp-table, temp-table buffer, or ProDataSet
- Last Updated: June 7, 2019
- 4 minute read
- OpenEdge
- Version 13.0
- Documentation
Syntax
Reading XML Schema using READ-XMLSCHEMA( ) has two distinct meanings,
depending on your use case:
- If you are creating a dynamic object, then reading XML Schema is the process of creating the definition of the dynamic object from the specified XML Schema.
- If the object already has a definition, then reading XML Schema is the process of comparing the existing definition to the specified XML Schema. This comparison is known as verification. Since static objects cannot exist without a definition, the purpose of reading XML Schema into a static object is always verification. If a dynamic object already has its definition, then the purpose of reading XML Schema into it is also verification.
Verification allows you to test the compatibility of the object with the specified XML
Schema document. If the object and XML Schema are not an exact or close match, the
READ-XMLSCHEMA( ) method call fails and returns FALSE.
The verification-mode parameter (described later) controls how close the
match must be.
Note: The XML document must be an XML Schema written in the XML Schema Definition
(XSD) language in the 2001 XML Schema namespace (http://www.w3.org/2001/XMLSchema). Non-OpenEdge applications might use XSD in many
ways. The
READ-XMLSCHEMA( ) method attempts to parse any XSD elements that
form an obvious relational structure into ABL temp-tables and ProDataSets. However, the
method might not be able to handle every XSD element generated by a non-OpenEdge source. The
closer a particular XSD element conforms to what the WRITE-XMLSCHEMA( )
method creates, the more likely that the READ-XMLSCHEMA( ) method will
succeed.Here is the syntax for READ-XMLSCHEMA( ). The method returns
TRUE or FALSE to indicate whether the operation was
successful.
|
- source-type
- A
CHARACTERexpression that specifies the source XML document type. Valid values are: "FILE","MEMPTR", "HANDLE", and"LONGCHAR". - file
- A
CHARACTERexpression that specifies the name of an XML Schema file. You can specify an absolute pathname, a relative pathname (based on the current working directory), or a URL pathname. Valid URL protocols includeFILEandHTTP(the HTTPS protocol is not supported). The AVM verifies that the file exists and is accessible. - memptr
- A
MEMPTRvariable that contains the XML Schema document text. The size of theMEMPTRvariable must match the size of the XML document text. - handle
- A
WEB-CONTEXTsystem handle, X-document object handle, or X-noderef object handle. - longchar
- A
LONGCHARvariable that contains the XML Schema document text. - override-default-mapping
- A
LOGICALexpression whereTRUEdirects the AVM to override the default mapping between XML Schema string and binary data types and ABL data types when creating ABL temp-table definition from an XML Schema. The default value isFALSE. - field-type-mapping
- An optional
CHARACTERexpression that evaluates to a comma-separated list of field name, data type pairs using the following syntax:field-name-1, data-type-1[, field-name-n, data-type-n ]...) - verify-schema-mode
- An optional
CHARACTERexpression that specifies the mode in which theREAD-XMLSCHEMA( )method verifies any XML Schema against an existing ABL definition. The expression must evaluate to "LOOSE" or "STRICT". The default value is "LOOSE".Note: For a dynamic temp-table or ProDataSet temp-table buffer that does not have ABL definition (that is, the object is in theCLEARstate), this option is ignored.