class %XML.Utils.SchemaReader
extends %RegisteredObject
This class reads an XML schema and builds class definitions from it.
Schema reading works as follows:
First, the Parser class builds a tree structure
representing the elements within the schema file,
then this class processes the tree to build class definitions.
This class is used by the XML Schema Wizard; it is not
for direct use within applications except through the Process and Reset methods.
Properties which are not marked as internal may be used to control the Process method.
property AddIdentity
as %String;
Input property to optionally add an identity property to persistent classes
that contains an ID, OID or GUID.
Possible values for AddIdentity are "" (none), "ID", "OID" or "GUID".
property CompileClasses
as %Boolean [ InitialExpression = 1 ];
Input property to control compilation of created classes.
Default is to compile classes.
property CompileFlags
as %String [ InitialExpression = "dk" ];
Flags to be used for class compiles.
property Debug
as %Integer [ InitialExpression = 0 ];
Control display of debugging info
Debug level. Additional output for levels >0.
Default is 0.
property GenerateXMLNIL
as %Boolean;
Input property to control the generation of the XMLNIL property parameter.
If GenerateXMLNIL = 1, then generate property parameter XMLNIL=1 for elements with nillable="true".
property KeepEmptyClasses
as %Boolean [ InitialExpression = 0 ];
Input property to control removal of unused classes with no properties.
If true(1), remove unused classes with no properties.
Default is false(0).
property MakeNamespace
as %Boolean;
Input property to control generation of XML namespace information.
If true(1), add NAMESPACE parameter to generated classes.
Default is false(0) unless there are multiple targetNamespaces in which case the default is true(1).
property MakePersistent
as %Boolean [ InitialExpression = 1 ];
Input property to control persistence of generated classes.
If true(1) create persistent classes, else create registered classes.
Default is true.
property MakeRelationships
as %Boolean [ InitialExpression = 1 ];
Input property to control creation of relationships in generated classes.
If true(1), convert list collections of persistent classes to relationships.
Default is true.
property MakeSerial
as %Boolean [ InitialExpression = 0 ];
Input property to control if generated classes are serial.
If true(1) and 'MakePersistent create serial classes, else create registered classes.
Default is true.
property NoArrayProperties
as %Boolean [ InitialExpression = 0 ];
Input property to control use of arrays in created classes.
If true(1), do not reduce properties to use array of cnostruct.
Default is false(0).
property SSLConfiguration
as %String;
The name of the activated TLS/SSL configuration to use for https requests.
property TestFlag
as %Boolean [ InitialExpression = 0 ];
Control test mode.
If true, make output repeatable for unit test, e.g. no dates.
Default is false(0).
method Process(LocationURL As %String, Package As %String = "Test", ByRef Features As %String)
as %Status
Command line interface to Schema Wizard
LocationURL is the filename or the URL of an XML schema.
Package is the name of the package in which the method should place the generated classes.
Features is a Multidimensional Array to Store Additional Settings.
The possible nodes are as follows:
Features("DEFAULTSEQUENCE") If this node is true, the wizard does not set the XMLSEQUENCE parameter in the generated classes.
Features("JAVA") If this node is true, each class includes a Java projection.
Features("NOSEQUENCE") If this node is true, the wizard sets the XMLSEQUENCE parameter to 0 in the generated classes.
Features("POPULATE") If this node is true, each class extends %Populate in addition to %XML.Adaptor.
Features("SQLCOLUMNS") If this node is true, each class property specifies a value for the SqlColumnNumber keyword, so that the properties have the same order in SQL that they have in the schema.
Features("IGNORENULL") If this node is set, the XMLIGNORENULL parameter is set to this value for each class.
method RemoveClassFromList(key As %String)
Remove a class from the list of classes
This method is used internally by Caché. You should not make direct
use of it within your applications. There is no guarantee made about either
the behavior or future operation of this property.
method Reset()
Reset this class instance for reuse.
method XSchema(locationURL As %String, filepath As %String)
as %Status
Command line interface to create an internal XSchema format file from an XML schema.
locationURL is the location of the input XML schema.
filepath is the file path for the new file containing the XSchema.