ObjectXSD
You can use the ObjectXSD function to generate an XML schema (XSD) for an Optiva object. To generate the XML data for an object, use the ObjectXML function instead.
When to use
You can use this function to generate schemas to validate XML data exported from ObjectXml.
When not to use
You cannot use this function when an object data is needed.
Note: Use
ObjectXml for data retrieval.
Syntax
string ObjectXSD(string Symbol, string objKey, string dtls, string languageCodes = null);
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| objSymbol | string | Yes |
The symbol of the object.
Note: You can use empty quotation marks ("") for the current workflow symbol.
|
| objKey | string | Yes |
The key of the object.
Note: You can use empty quotation marks ("") for the current workflow symbol.
|
| dtls | string | Yes | The detail codes that identify the data sections to include in the XML. Use a semicolon-delimited list to specify multiple detail codes. For example, "HEADER;INGR;TPALL''
Note: An empty string ("") returns only the HEADER detail code.
|
| languageCodes | string | Optional | he language codes used to export enumerated value lists in multiple languages. You can use a semicolon-delimited list to specify multiple language codes. For example, "EN-US;FR-FR;DE-DE"
Note: If you do not specify this parameter, the database default language is used. Usually it is EN-US.
|
Return Value
The application returns the generated XML schema (XSD) as a string.
Prerequisites
You must start the script with Using System.xml if XML documents are part of it.
ObjectXml vs ObjectXsd:
| Feature | ObjectXml | ObjectXsd |
|---|---|---|
| Returns | The XML data (actual values). | The XML schema (structure definition). |
| Purpose | Export/retrieve the object data. | Define/validate the XML structure. |
| Use case | Data export, integration. | Schema validation, documentation. |
| Changes with data | Yes (data values change). | No (structure is consistent). |
| File extension | .xml | .xsd |
Examples
- Example 1
-
Create Schema for Formula.
string sXn2 = ObjectXsd(objectSymbol, objectKey, "HEADER;TPALL"); MessageList(sXn2);
- Description
- This action creates a schema for the current symbol and object combination. This example is for a formula.