473,473 Members | 1,573 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Best Practices - Xml document validation

Hello grp:

Given the following scenario, I'm hoping someone can suggest the best method
for accomplishing xml validation.

We have a system that accepts requests in the form of xml messages. We
publish schemas detailing the contents and constraints of these requests.
The service is available to both outside and internal consumers. We use
xsd.exe to generate a 'type-safe' document from these schemas. The document
structure is too broad to go into every detail but I will try and sum up as
best I can some of the constraints. It is a composite-like pattern where
several elements act as containers for subtypes. Here is a basic structure
that the system supports:

request --root
applicantInfo --made up of address information, names, phone #'s etc...
package -- packages contain 1 or more products
product -- a product that makes up a package - abstract
element

It is no trouble to validate the schema of the doc to the 'product' node but
then it gets a little more difficult. Certain products require 'upstream'
applicant information to be present when the request is submitted for those
products but it is not ALWAYS required.

EX: System receives a request for a 'credit report' product. Credit
reports require a full address (at least 1).

By the time I am validating the credit report product nodes, I've already
validated the applicant information. At the time the applicant information
was validated, address information wasn't madatory but the discovery of a
credit report product makes it mandatory. I cannot require an address in all
cases since most other products don't require one and it's not reasonable to
expect one.

In the past (this is several generations of the system deep), we've always
used the schema for a baseline validation of the minimal set of information
common to all requests and then used XPath to validate the upstream
information once its dependencies are discovered. Whereas it's always
worked, I never felt it was a good method for doing so and was hoping there
is a more elegant method for addressing this. I should state that this is a
system rewrite and under the new system, the complications get even worse due
to customers have the ability to define their own dependencies in addition to
our baseline information. Individual customers making these requests might
have a different set of minimal information than what our default schemas
require. Also, their individual users might also have different requirements
than what the customer's baseline information requires.

EX: Customer XYZ requires all the default information we require to submit
a request, plus they require a phone number to be filled out in all cases
regardless of product. XYZ's user Tammy has to inherit all of her company's
required fields plus she is required to gather a fullname when a certain
product is selected but not in other products.

The example described above makes the situation even worse because now the
baseline (minimal) information required to make a product request changes per
customer and potentially per user and still depends on the products chosen to
make certain information required at runtime.

I have a pretty solid membership model that can address the customer/user
issue and gather their required attributes in a request but I am missing is
the way to apply it to the validation routine. You can see why I really don't
want use XPath to validate the upstream information since it could change
dramatically per customer/user and it becomes very hard to store this info
reliably. I will if I have to but I'm hoping someone can suggest an
alternative.
Thanks all,

Nov 7 '06 #1
1 1421
I know this might be a little too 'verbose' but does anyone have any
suggestions? I'm really at a point in design when I need to solve this issue.

Thanks,
Drew Wildner

Nov 21 '06 #2

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

Similar topics

55
by: Jonas Smithson | last post by:
I've seen a few attractive multi-column sites whose geometry is based on pure CSS-P, but they're what you might call "code afficionado" sites, where the subject matter of the site is "coding...
16
by: D Witherspoon | last post by:
I am developing a Windows Forms application in VB.NET that will use .NET remoting to access the data tier classes. A very simple way I have come up with is by creating typed (.xsd) datasets. For...
2
by: byrocat | last post by:
I'm chasing after a documetn that was available on one of the Microsoft websites that was titled somethign like "MS SQL Server Best Practices" and detailed a nyumber of best practices about...
136
by: Matt Kruse | last post by:
http://www.JavascriptToolbox.com/bestpractices/ I started writing this up as a guide for some people who were looking for general tips on how to do things the 'right way' with Javascript. Their...
1
by: johnmack | last post by:
In my XML instances I want to use the XLink namespace for attributes on certain elements. I'm having quite a hard time determining how to reflect this properly in my DTD and XML instances. In...
10
by: Mike Logan | last post by:
I am using the "contract first" design methodology. Contract First is design the WSDL first then design the server and client. However I must design my XSD/XML Schema before anything. I am...
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...
4
by: Ned Balzer | last post by:
Hi all, I am pretty new to asp.net; I've done lots of classic asp, but am just beginning to get my mind wrapped around .net. What I'd like to do is include some code that tests if a user is...
41
by: Jim | last post by:
Hi guys, I have an object which represents an "item" in a CMS "component" where an "item" in the most basic form just a field, and a "component" is effectively a table. "item" objects can be...
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.