# 22. Virtuoso Functions Guide - XMLType.isSchemaValid

Chapter Contents | Prev | Next
Keyword Search:
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
Remote SQL Data Source
Replication
SOAP
SQL
String
Transaction
Type Mapping
UDDI
User Defined Types & The CLR
Virtuoso Java PL API
Virtuoso Server Extension Interface (VSEI)
Web Server & 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_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.isSchemaValid

Validates the given XMLType instance against an arbitrary XML schema, returns 1 if successful, 0 if errors are detected.
XMLType.isSchemaValid ([in schema_url varchar], [in top_element_name varchar]);
Description

The function validates the given XMLType instance against the XML schema located at schema_url. The name of the current node of the XML entity should match top_element_name if it is specified.

The schema_url is optional for schema based instances: the default value is the URI of the associated schema of the instance. For non-schema based instances the schema_url is required, an error is signalled otherwise.

The function does not use or modify internal "validated" flag that is e.g. used by XMLType.schemaValidate(). It is true even if the given schema_url is equal to the URI of own schema of the instance.

Parameters
schema_url – The URI of the schema to apply.
top_element_name – The allowed name of top level element of the instance.
Return Types

The function returns 1 if the validation is passed, 0 if it is failed.

Examples
Failed schema validation

The example creates an XMLType instance that is a document with a single element node"bad" and tries to validate it against XMLschema "file://xmlschema/test0001/clean.xsd" that does not match actual content of the document. The call of isSchemaValid() returns zero indicating failed validation.

    select XMLType('<bad />', 'file://xmlschema/test0001/clean.xsd').isSchemaValid()
    callret
    INTEGER
    _______________________________________________________________________________

    0

    1 Rows. -- 00000 msec.

See Also

XMLType.isSchemaValidated()

XMLType.setSchemaValidated()

XMLType.schemaValidate()