473,385 Members | 1,740 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

XSD Validation Question

To you XML validation experts:

I have a schema that validates an XML file, but there are a couple of other
types of validation I'd like to do on it. They are basically string fields
that must be validated against a set of possible codes, but there could be
tens of thousands of possible codes. Naturally, these codes are in a table
in SQL (actually there are a few code types, but the problem is the same for
each).

In the past I have always done this as an additional code step AFTER schema
validation, but I am being asked whether it could be "plugged into" the
schema validation step.

I've taken a look at the XmlDataDocument class which seems to indicate that
I could read a SQL table into a Dataset and use this class to allow XSD
schema validation to reference the range of possible values for the field
type.

Do you have any thoughts on this approach? Could it be made to work and do
you think it would be a "performance pig" ?
Nov 11 '05 #1
2 1544
Maybe this is obvious, but to clarify: the type of validation I am talking
about is like an XSD enumeration, but compared against a set of values in a
SQL database table.

-jv
Nov 11 '05 #2
John Viele wrote:
I have a schema that validates an XML file, but there are a couple of other
types of validation I'd like to do on it. They are basically string fields
that must be validated against a set of possible codes, but there could be
tens of thousands of possible codes. Naturally, these codes are in a table
in SQL (actually there are a few code types, but the problem is the same for
each).

In the past I have always done this as an additional code step AFTER schema
validation, but I am being asked whether it could be "plugged into" the
schema validation step.

I've taken a look at the XmlDataDocument class which seems to indicate that
I could read a SQL table into a Dataset and use this class to allow XSD
schema validation to reference the range of possible values for the field
type.


You can build schema definition for that enumeration on the fly querying
information from database, then including this subschema into main one:
<xs:include schemaLocation="http://server.com/foo.aspx"/>
Then you'd better cache compiled scemas using XmlSchema object.
Alternatively you can plug in your custom validation just before schema
validation - using custom filtering XmlReader, which reads XML as is, but
validates internally certain elements.
--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

Nov 11 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: wumingshi | last post by:
Hi, When validating an XML instance, sometimes the schema is not enough to expression the validation rules. Additional validation rules may be expressed in an application-specific way. For...
9
by: rbronson1976 | last post by:
Hello all, I have a very strange situation -- I have a page that validates (using http://validator.w3.org/) as "XHTML 1.0 Strict" just fine. This page uses this DOCTYPE: <!DOCTYPE html PUBLIC...
16
by: Hosh | last post by:
I have a form on a webpage and want to use JavaScript validation for the form fields. I have searched the web for form validation scripts and have come up with scripts that only validate...
1
by: Colin Basterfield | last post by:
Hi, I have a web form which takes daily sales totals, both counts and monetary value and is done on a weekly basis, so on a Monday morning the User would enter these totals. Each total has a...
14
by: Matt | last post by:
I want to know if ASP.NET Web Forms Validation Controls are Server-Side or Client-Side form validation? Since I think each validator control can select either 1) JavaScript based error dialog or 2)...
5
by: Chris | last post by:
Based upon some prevoius postings on what to do for adding a 'add' row to a datagrid I utilize the footer to create the 'add' row. The only issue is that I have it sharing the 'UpDate_Command' and...
8
by: Joe | last post by:
Hi, I have a form with three text fields and a Submit button. The two text fields have ReqiredFieldValidator and third text field has RegularExpressionValidator. The page validation works fine...
2
by: winnie_us99 | last post by:
Hi All, I am trying to do validation on my text field before going to the next page to create a user. It doesn't look like the next button will fire any validation. Am I missing something? Can...
9
by: julie.siebel | last post by:
Hello all! As embarrassing as it is to admit this, I've been designing db driven websites using javascript and vbscript for about 6-7 years now, and I am *horrible* at form validation. To be...
27
by: Chris | last post by:
Hi, I have a form for uploading documents and inserting the data into a mysql db. I would like to validate the form. I have tried a couple of Javascript form validation functions, but it...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.