post-schema/application validation

Discussion in 'XML' started by wumingshi, Apr 20, 2005.

  1. wumingshi

    wumingshi Guest

    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
    wumingshi, Apr 20, 2005
    #1
    1. Advertising

  2. 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.
    Tjerk Wolterink, Apr 20, 2005
    #2
    1. Advertising

  3. wumingshi

    ajm Guest

    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" <> wrote in message news:<>...
    > 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
    ajm, Apr 21, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page