Re: Proposal for XML Schema Validation - Mailing list pgsql-hackers
From | Kodamasimham Pridhvi (MT2012066) |
---|---|
Subject | Re: Proposal for XML Schema Validation |
Date | |
Msg-id | da983329e46f481f97bc9f5bc7205f00@HKNPR01MB050.apcprd01.prod.exchangelabs.com Whole thread Raw |
In response to | Re: Proposal for XML Schema Validation (Andrew Dunstan <andrew@dunslane.net>) |
Responses |
Re: Proposal for XML Schema Validation
Re: Proposal for XML Schema Validation |
List | pgsql-hackers |
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 documentwhile inserting and updating. We want to extend this feature by adding xml schema validation. We will be providinguser with DDL commands for creating and deleting XML Schema, also provision of associating xml schema with tablewhile creation of new table or while altering table structure, we are planning to use libxml2 library. Proposed syntaxis given below. 1. End user perspective: 1.1 DDL 1.1.1 Register xmlschema Syntax REGSITER_XML_SCHEMA( “<URL OF SCHEMA>”, “<NAMESPACE>” , “<CONTENTOF 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 validationfor 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 functioncall 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 successfullyelse return respective error code (which we will define later)We are planning to use libxml2This function willcalled while insert/update sql query ________________________________________ From: Andrew Dunstan <andrew@dunslane.net> Sent: Thursday, August 08, 2013 6:54 PM To: Kodamasimham Pridhvi (MT2012066) Cc: pgsql-hackers@postgresql.org; Bisen Vikrantsingh Mohansingh MT2012036; rc@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
pgsql-hackers by date: