By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,681 Members | 1,854 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,681 IT Pros & Developers. It's quick & easy.

post-schema/application validation

P: n/a
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

Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
wumingshi wrote:
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.

Jul 20 '05 #2

P: n/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.
"wumingshi" <xm**@yahoo.com> wrote in message news:<11**********************@g14g2000cwa.googleg roups.com>...
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

Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.