post-schema/application validation

W

wumingshi

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 example, using XPath or
Java method. So is there a concept and/or standard for post-schema
validation or application validation? Is there any hook in XML
standards that allow me to hook up with my customized validation?
Additionally and more specificly, when using XForm, is there any hook
to the customized validation?

Thanks in advance!

Xiao Ma
 
T

Tjerk Wolterink

wumingshi said:
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 example, using XPath or
Java method. So is there a concept and/or standard for post-schema
validation or application validation? Is there any hook in XML
standards that allow me to hook up with my customized validation?
Additionally and more specificly, when using XForm, is there any hook
to the customized validation?

Thanks in advance!

Xiao Ma

I don't think you can extends XSD, because it is a standard, every xsd document
must follow the standard,

a possibility is to check your own validation rules using your own code.
But in that case an xml document could be valid (xsd valid) but now valid
in your own rules.

When using XForms you should check your own rules at the server side and react
on that, but if you can try to put the validtion rules also in the xform itself,
because in that way you can decrease the number of trips to server-client a
client has to make.

But remember, you cannot rely on xform validation, you should check it on the
server-side also.
 
A

ajm

if you forgive me for saying so your question is rather vague (!)
but let me try to give you a couple of pointers ;) first it
helps to distinguish between grammer and assertion based
validation and second between data and application validation.

on the first point there are two broad possibilities - validation
that checks grammer (e.g., does X has the correct attributes,
children etc.) e.g., Schema, DTD etc. and validation that checks
assertions (e.g., do all the values attributes of children of X
add up to 100 etc.) - here the best option is Schematron. I like
to combine the two and Schema/Schematron is a good combination.
(the latter sounds like what you meant by XPath validation?)

the point of XML validation, however, is to ensure that the data
is in a certain state and I would suggest that you do not mix
application and data validation (e.g., "validation rules using
Java" etc.). data validation should confirm invariants and
expectation v.v. the data - perhaps it is up to the application, not
to validate per se but to work under those assumptions (e.g., it is
ok to process an XML document because it is known that X and Y are
true etc.) if you had a specific example of what you meant though...

if you feel strongly about application binding then you probably
want to look at XMI or binding frameworks perhaps - choices here
depend a bit on your choice of language etc. I personally wouldn't
focus too much on the fact that it is XForms you are interested in
since it is likely not to matter too much precisely what vocabulary
you are using.

hth
ajm.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top