Re: Proposal for XML Schema Validation

From: "Kodamasimham Pridhvi (MT2012066)" <Pridhvi(dot)Kodamasimham(at)iiitb(dot)org>
To: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Cc: Bisen Vikrantsingh Mohansingh MT2012036 <BisenVikrantsingh(dot)Mohansingh(at)iiitb(dot)org>
Subject: Re: Proposal for XML Schema Validation
Date: 2013-08-08 16:39:26
Message-ID: da983329e46f481f97bc9f5bc7205f00@HKNPR01MB050.apcprd01.prod.exchangelabs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 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 <andrew(at)dunslane(dot)net>
Sent: Thursday, August 08, 2013 6:54 PM
To: Kodamasimham Pridhvi (MT2012066)
Cc: pgsql-hackers(at)postgresql(dot)org; Bisen Vikrantsingh Mohansingh MT2012036; rc(at)iiitb(dot)ac(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2013-08-08 16:50:31 Re: Should we remove "not fast" promotion at all?
Previous Message Thom Brown 2013-08-08 16:31:36 Re: 9.4 regression