473,386 Members | 1,958 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,386 software developers and data experts.

Complex validation of business rules possible with XML Schema? Any other validation "languages"?

Note: My XML experience to date has (unfortunately) been limited to reading
and thinking, rather than implementation.

Anyway, I am in the process of trying to figure out the most efficient way
to validate and transform some very large (potentially over 100MB) XML
documents. This is related to another question I will post next, but for
now, I want to focus on one particular topic.

The data in question has particular business rules that must be validated,
and I'm not sure if XML Schema can handle this or not. For example, a
certain attribute of a child element might only be valid depending on a
corresponding (but different) attribute in a parent or sibling element.

1. Can XML Schema handle complex validation rules such as this?
2. Can processing instructions be used (with supporting code) to handle
validation rules that are too complex for XML Schema?
3. Are there any other general-purpose XML "languages" for describing
complex validation rules for XML documents?

In general, how efficient is validation with XML Schema - does it require
the entire document to be loaded into memory at once?

Thanks for any help,

Mike

Jul 20 '05 #1
1 2820
In article <bY********************@giganews.com>,
Mike <mm********@yahoo.com> wrote:

% The data in question has particular business rules that must be validated,
% and I'm not sure if XML Schema can handle this or not. For example, a
% certain attribute of a child element might only be valid depending on a
% corresponding (but different) attribute in a parent or sibling element.

% 1. Can XML Schema handle complex validation rules such as this?

Not directly.

% 2. Can processing instructions be used (with supporting code) to handle
% validation rules that are too complex for XML Schema?

The `XML Schema' way of doing this is to define annotations which can be
handled by your processor.

% 3. Are there any other general-purpose XML "languages" for describing
% complex validation rules for XML documents?

Look at RELAX NG. It can do grouping with attributes (i.e., if this attribute
is present, that one must be, or if that one is present, this must not be).
I don't know enough to say whether it can do structural validation based
on attribute values (ie, this element must be present if that attribute
is set to `bob'), but it might.

% In general, how efficient is validation with XML Schema - does it require
% the entire document to be loaded into memory at once?

It seems common to apply XML Schemas to DOM trees, and that typically
involves reading the entire document. I've typically used non-XML
validation mechanisms when dealing with large amounts of data.
--

Patrick TJ McPhee
East York Canada
pt**@interlog.com
Jul 20 '05 #2

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

Similar topics

49
by: Ville Vainio | last post by:
I don't know if you have seen this before, but here goes: http://text.userlinux.com/white_paper.html There is a jab at Python, though, mentioning that Ruby is more "refined". -- Ville...
13
by: Don Vaillancourt | last post by:
What's going on with Javascript. At the beginning there was the "undefined" value which represented an object which really didn't exist then came the null keyword. But yesterday I stumbled...
81
by: Matt | last post by:
I have 2 questions: 1. strlen returns an unsigned (size_t) quantity. Why is an unsigned value more approprate than a signed value? Why is unsighned value less appropriate? 2. Would there...
9
by: bubbakittee | last post by:
I am designing a package of functions to be used by people with very little programming experience (if any) and very little patience. I don't want to scare them with programmerish words like...
11
by: Joseph S. | last post by:
Hi all, how do I avoid typing the keyword "$this->" every time I need to reference a member of a class inside the class? (coming from a world of cozy auto-complete enabled Java / .Net IDEs I...
9
by: Roger Withnell | last post by:
I am building a website in Russian. What options do I have to make the "Browse" button display in other languages? Thanking you in anticipation. Posted Via Usenet.com Premium Usenet...
84
by: aarklon | last post by:
Hi all, I found an interesting article here:- http://en.wikipedia.org/wiki/Criticism_of_the_C_programming_language well what do you guys think of this article....??? Is it constructive...
8
by: ssecorp | last post by:
I first learned about OO from Java. I much prefer to program in Python though. However I am consufed about 2 things. 1. Why do I have to pass self into every method in a class? Since I am...
1
by: per9000 | last post by:
We have a big application written without thought of supporting multiple languages with lots of strings in a default "english". Now the client wants to support any language (with a latin alphabet)...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.