6 comments

  1. Hello,

    Fantastic implementation.

    Is it possible somehow to spit out the result of the validation into a separate file instead of just the command prompt console?
    A couple of options come to mind:
    – through a batch file trickery
    – by adding a third optional parameter specifying output file name

    Thanks a lot,
    Yitzhak

    Yitzhak

  2. Here is the answer on my own question above.
    validate.bat whatever.XML whatever.xsd 2> XSDValidationResult.txt

    Yitzhak

  3. Hi,

    WoW Excellent. Thanks a lot for posting this. I never see like this tutorial on the websit.

    Purandaran

  4. Hi,

    Very elaborate article, good!
    A question I have when reading this is, why store business rules in XSD?
    XPath is not really a programming language, when things get a little more complicated, you need code. Then that would mean that you have 2 places where you have business rules: 1. XSD / 2. Business Layer

    What do you think?

    Woutercx

    • You are right in noticing certain limitations in xpath. But what more do you need? Since xpath 2.0 we have all kinds of expressions (primary, logical, arithmetic etc) to express certain rules. The one thing that I am really missing is the ability to validate against external values.

      Do we really need a fully fledged programming language to express business rules? Many business rule engines, have a very limited sub language, to express rules also. You can think of the combination of xsd and xpath as such a language I think.

      Why not make xsd, a part of the business layer? Think of a validating webservice for example, that first checks against an xsd, and if there is anything needed that can’t be covered in xsd xpath, performs some additional checks. Because xsd is a well known w3 standard, the xsd could also be understood by information analysts, or even made by information analysts when defining the specs for the service. You could also keep the xsd external, so the business rules can be adjusted without a full compile, deploy step. Perhaps a central location from which the service could download the latest version? For fast changing rules.

      But yes this, means, code, and xsd..Different kinds of knowledge, different places to maintain..

      Chris van Beek

Comments are closed.