Objective: To Add XML Schema validation and xmlvalidate functions (SQL:2008)
Description: We’ve gone through current support of xml in postgreSQL and found that there is a check for well-formedness of xml document while inserting and updating. We want to extend this feature by adding xml schema validation. We will be providing user with DDL commands for creating and deleting XML Schema, also provision of associating xml schema with table while creation of new table or while altering table structure, we are planning to use libxml2 library. Proposed syntax is given below. 1. End user perspective: 1.1 DDL 1.1.1 Register xmlschema Syntax REGSITER_XML_SCHEMA( “<URL OF SCHEMA>”, “<NAMESPACE>” , “<CONTENT OF SCHEMA .XSD FILE>") We will save this information into system catalog 1.1.2 Delete xmlschema Syntax DELETE_XML_SCHEMA( “<URL OF SCHEMA>”) 1.1.3 Modification in Create Table commands Syntax Create table <tablename> (<col_name> <datatype>, <col_name> xml USE_SCHEMA <URL OF SCHEMA> ) We will keep a flag in catalog for xml schema validation for each table. If xml schema is specified then while every insert/update sql query we will call valdate_xml_schema() [currently built in xml_is_well_formed() is called while inserting/updating, we can place our function call just next to it] 1.1.4 Similarly for Alter Table commands 2. Developer perspective 2.1. C-Function for Validation of xml doc 2.1.1 Validating XML Syntax Int<err_code> validate_xml_schema(char xml[], char xml_schema[]) This function will return 0 if validate successfully else return respective error code (which we will define later) We are planning to use libxml2 This function will called while insert/update sql query ________________________________________ From: Andrew Dunstan <and...@dunslane.net> Sent: Thursday, August 08, 2013 6:54 PM To: Kodamasimham Pridhvi (MT2012066) Cc: pgsql-hackers@postgresql.org; Bisen Vikrantsingh Mohansingh MT2012036; r...@iiitb.ac.in Subject: Re: [HACKERS] Proposal for XML Schema Validation On 08/08/2013 12:42 AM, Kodamasimham Pridhvi (MT2012066) wrote: > Hello pgsql-hackers , > With reference to "Add XML Schema validation and xmlvalidate > functions (SQL:2008)" in ToDo list, we have gone through pgsql-mailing > list but we didn't find any significant work in this area, so we are > proposing our own model for xml schema validation . please kindly go > through it and let us know how can we improve it.Please find the > attached proposal document. > > > > Please post your proposal as text, not as a PDF attachment. That's what is preferred on this mailing list. cheers andrew -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers