From 0b75afda92ff91a724327cbe44b46d8ec33494f0 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Sun, 1 Apr 2007 09:00:26 +0000 Subject: Mapping schemas and databases to XML and XML Schema. Refactor and document the remaining mapping code. --- doc/src/sgml/func.sgml | 65 +++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 62 insertions(+), 3 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index f8001551e69..db7cd1d1f3b 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -1,4 +1,4 @@ - + Functions and Operators @@ -11427,7 +11427,7 @@ cursor_to_xml(cursor refcursor, count int, nulls boolean, tableforest boolean, t query whose text is passed as parameter query and maps the result set. cursor_to_xml fetches the indicated number of - rows from the cursor specificed by the parameter + rows from the cursor specified by the parameter cursor. This variant is recommendable if large tables have to be mapped, because the result value is built up in memory by each function. @@ -11492,7 +11492,7 @@ cursor_to_xml(cursor refcursor, count int, nulls boolean, tableforest boolean, t values should be included in the output. If true, null values in columns are represented as + ]]> where xsi is the XML namespace prefix for XML Schema Instance. An appropriate namespace declaration will be @@ -11530,6 +11530,65 @@ query_to_xml_and_xmlschema(query text, nulls boolean, tableforest boolean, targe + + In addition, the following functions are available to produce + analogous mappings of entire schemas or the entire current + database. + +schema_to_xml(schema name, nulls boolean, tableforest boolean, targetns text) +schema_to_xmlschema(schema name, nulls boolean, tableforest boolean, targetns text) +schema_to_xml_and_xmlschema(schema name, nulls boolean, tableforest boolean, targetns text) + +database_to_xml(nulls boolean, tableforest boolean, targetns text) +database_to_xmlschema(nulls boolean, tableforest boolean, targetns text) +database_to_xml_and_xmlschema(nulls boolean, tableforest boolean, targetns text) + + + Note that these potentially produce a lot of data, which needs to + be built up in memory. When requesting content mappings of large + schemas or databases, it may be worthwhile to consider mapping the + tables separately instead, possibly even through a cursor. + + + + The result of a schema content mapping looks like this: + + + +table1-mapping + +table2-mapping + +... + +]]> + + where the format of a table mapping depends on the + tableforest parameter as explained above. + + + + The result of a database content mapping looks like this: + + + + + ... + + + + ... + + +... + +]]> + + where the schema mapping is as above. + + As an example for using the output produced by these functions, shows an XSLT stylesheet that -- cgit v1.2.3