Name

createXML

Synopsis

XMLType createXML ( in src any ,
in schema_uri any ,
in validated any ,
in wellformed any );

Description

This function creates an XMLType instance. It works absolutely identically to the XMLType() constructor and is provided solely for compatibility.

Parameters

src

An XML entity or a value that can be converted to an XML entity.

schema_uri

An URI of the schema of the document. The default is NULL to make result non-schema based.

validated

An integer flag that indicates if the document is already validated against the schema of the document (this is to avoid redundant validations). The default is 0.

wellformed

This parameter is unused and is listed solely for compatibility.

Return Types

The function returns a new instance of XMLType.

Examples

Example24.56.Sample example

create table XMLTYPE_TEST (I integer primary key, XMLVAL long xml)

Done. -- 00000 msec.

insert into XMLTYPE_TEST values (1, createXML('<emp><empno>221</empno><ename>John</ename></emp>'))

Done. -- 00000 msec.

insert into XMLTYPE_TEST values (2, createXML('<po><pono>331</pono><poname>PO_1</poname></po>'))

Done. -- 00000 msec.

select e.XMLVAL.extract ('//empno/text()').getNumVal() as EMPNO
  from XMLTYPE_TEST as e
  where e.XMLVAL.existsNode('/emp/empno') = 1
EMPNO
DECIMAL
_______________________________________________________________________________

221

1 Rows. -- 00000 msec.