Re: [xsl] xml validation

Subject: Re: [xsl] xml validation
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Mon, 16 Jun 2008 14:21:32 -0400
Max,

I have used an XSLT 2.0 query language binding in Schematron to achieve things very similar to what you are describing, including validation of XSD datatypes. Yes, "castable as" will work.

Also, some Schematron implementations (including the reference skeleton implementation in XSLT) allow you to mix XSLT into your Schematron, which is a killer combination, since you can then write XSLT 2.0 functions to use in your Schematron as well as templates for enhanced reporting.

Cheers,
Wendell

At 01:30 PM 6/16/2008, you wrote:
Hello list,
I would be very grateful if you can share some of your experience to
help me make a decision.

In my next project I want to implement xml validation for documents
built using values entered in html forms. An important requirement is
being able to map errors in elements or atributes back to the
textboxes from which the values came from.

My platform is .net, and my xslt processor is saxon-b. In .net you
have support for xml schema, and I can read a whole document and
capture all the errors and local-names of elements and attributes, but
I cannot use my own error messages (a far as I know), and I would have
to write I lot of xsd code and some c#.

I'm not looking at xforms because I don't know any .net
implementation, I want complete control over html and I want complete
separation between html and validation rules.

Schematron seems like a very friendly and extensible solution built on
top of xslt. Maybe I could even take advantage of the built-in atomic
types in xslt2, and for example test if the 'price' element has a
valid string value for an xs:integer type, using the <castable as>
operator (i don't know if this would work).

Has anyone here used Schematron for my use case? My intention is to
use xslt2 as my primary programming language.


======================================================================
Wendell Piez                            mailto:wapiez@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
  Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================

Current Thread