www.openlinksw.com
docs.openlinksw.com

Book Home

Contents
Preface

Virtuoso Functions Guide

Administration
Aggregate Functions
Array Manipulation
BPEL APIs
Backup
Compression
Cursor
Date & Time Manipulation
Debug
Dictionary Manipulation
Encoding & Decoding
File Manipulation
Free Text
Hashing / Cryptographic
LDAP
Locale
Mail
Miscellaneous
Number
Phrases
RDF data
Remote SQL Data Source
Replication
SOAP
SQL
String
Transaction
Type Mapping
UDDI
User Defined Types & The CLR
VAD
Virtuoso Java PL API
Virtuoso Server Extension Interface (VSEI)
Web & Internet
XML
xmlagg
xmlattributes
xmladdattribute
xmlappendchildren
xmlconcat
xmlelement
xmlforest
xmlinsertafter
xmlinsertbefore
xmlreplace
xmltype.xmltype
xmltype.createnonsch...
xmltype.createschema...
xmltype.createxml
xmltype.existsnode
xmltype.extract
xmltype.getclobval
xmltype.getnamespace
xmltype.getnumval
xmltype.getrooteleme...
xmltype.getschemaurl
xmltype.getstringval
xmltype.isfragment
xmltype.isschemabase...
xmltype.isschemavali...
xmltype.isschemavali...
xmltype.schemavalida...
xmltype.setschemaval...
xmltype.toobject
xmltype.transform
xmlupdate
xper navigation
createxml
isentity
serialize_to_utf8_xm...
tidy_html
tidy_list_errors
updatexml
xml_add_system_path
xml_auto
xml_auto_dtd
xml_auto_schema
xml_create_tables_fr...
xml_cut
xml_doc_output_optio...
xml_get_system_paths
xml_load_mapping_sch...
xml_load_schema_decl
xml_namespace_scope
xml_persistent
xml_set_ns_decl
xml_template
xml_tree
xml_tree_doc
xml_tree_doc_media_t...
xml_uri_get
xml_validate_dtd
xml_validate_schema
xml_view_dtd
xml_view_schema
xmlsql_update
xpath_eval
xper_cut
xper_doc
xper_locate_words
xpf_extension
xpf_extension_remove
xquery_eval
xslt
xslt_format_number
xslt_sheet
xslt_stale
xte_head
xte_node
xte_node_from_nodebl...
xte_nodebld_acc
xte_nodebld_final
xte_nodebld_init
xtree_doc
XPATH & XQUERY

Functions Index

XMLType.createSchemaBasedXML

Returns a copy of the given instance with new schema reference.
XMLType.createSchemaBasedXML ([in schema_url varchar]);
Description

The function creates a new instance of XMLType by copying the given one and assigning a new schema URL to it. Parameterschema_url specifies a new URL; if it is omitted then a non-schema based instance is created like the XMLType.createNonSchemaBasedXML() function.

The returned copy has an internal "validated" flag set to 0, even if the new URL is equal to the URL of the original instance.

Parameters
schema_url – The location of a schema of a new instance.
Return Types

The member function returns a new instance of XMLType.

Examples
Converting a non schema-based instance to schema-based one

The procedure creates a schema-based copy of a sample non schema-based instance.

create procedure schema_assignment_test ()
{
  declare orig_instance XMLType;
  declare schema_based_copy XMLType;
  declare PROBE varchar;
  result_names (PROBE);
  orig_instance := XMLType ('<sample-xml/>');
  result (concat (
    '"orig_instance" is declared as non schema-based, URI=',
    cast (orig_instance.getSchemaURL() as varchar) ) );
  schema_based_copy := orig_instance.createSchemaBasedXML (
    'http://www.example.com/test.xsd' );
  result (concat (
    '"schema_based_copy" is schema-based, URI=',
    schema_based_copy.getSchemaURL() ) );
}

schema_assignment_test()
PROBE
VARCHAR
_______________________________________________________________________________

"orig_instance" is declared as non schema-based, URI=
"schema_based_copy" is schema-based, URI=http://www.example.com/test.xsd

2 Rows. -- 00000 msec.

See Also

XMLType.createNonSchemaBasedXML()