# 22. Virtuoso Functions Guide - xslt_sheet

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

## xslt_sheet

declares an XSL stylesheet for use
xslt_sheet (in uri varchar, in entity any);
Description

This function takes a name and the root element of a parsed XML document and defines these as a stylesheet. The unique element child of the entity object's document should be an xsl:stylesheet element. Included or imported stylesheets will be located relative to the base URI of the entity passed to xslt_sheet(). Once a stylesheet thus defined it can be used as the stylesheet argument of xslt.

Parameters
uri – The location of the XSLT style sheet
entity – A valid XSL style sheet, XML entity parsed using the xml_tree_doc() function
Examples
Preparing a Style Sheet from the File System

The xslt_view() function first defines the style sheet from a file. The xslt_sheet() function is called with the name and the root element of the parsed file. xslt_view() next gets the string to process, parses the string as XML and converts the parse tree into an entity object. This is then passed to the xslt() function. The result is another entity object. This is finally serialized as XML text and written into the file xslt.out.

    create procedure xslt_view (in v varchar, in xst varchar)
    {
      declare str, r varchar;
      xslt_sheet (xst, xml_tree_doc (xml_tree  (file_to_string (xst))));
      str := xml_view_string (v);
      r := xslt (xst, xml_tree_doc (xml_tree (str)));
      declare str any;
      str := string_output ();
      http_value (r, 0, str);
      string_to_file ('xslt.out', string_output_string (str), 0);
    }

See Also

xml_tree_doc()