The static method creates an XMLType instance from the src XML entity. If the parameter src is not an XML entity then it is converted to it via an internal call of xtree_doc() or xml_tree_doc(). A schema may be associated with an XML entity by passing its URI as schema_uri; this schema can be used later to validate the structire of the document.
The method returns a new instance of XMLType.
The procedure creates two instances (a schema-based and a non schema-based) and demonstrates that these instances are filled with proper data.
create procedure createxml_test () { declare test1 XMLType; declare test2 XMLType; declare PROBE varchar; result_names (PROBE); test1 := createXML ('<test attr="value1"/>'); test2 := createXML ('<test attr="value2"/>', 'http://www.example.com/test.xsd'); result (concat ( '"test1" is created as non schema-based, URI=', cast (test1.getSchemaURL() as varchar) ) ); result (concat ( 'Sample data from "test1": value of test/@attr is ', test1.extract ('test/@attr') ) ); result (concat ( '"test2" is created as schema-based, URI=', test2.getSchemaURL() ) ); result (concat ( 'Sample data from "test2": value of test/@attr is ', test2.extract ('test/@attr') ) ); } createxml_test () PROBE VARCHAR _______________________________________________________________________________ "test1" is created as non schema-based, URI= Sample data from "test1": value of test/@attr is value1 "test2" is created as schema-based, URI=http://www.example.com/test.xsd Sample data from "test2": value of test/@attr is value2 4 Rows. -- 00000 msec.