[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XSD Validation with XSLT

Subject: Re: XSD Validation with XSLT
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Fri, 10 Dec 2004 12:46:25 +0000
form input xsd validation
Hi Robert,

> My idea was to validate the input against a xsd *by means of XSLT*.
> This would *not need to validate the whole structure but only test
> whether elements with unique names have a value or not. I a required
> field is found to be empty a predefined value should be inserted.
> (e.g. a -1 for xs:integer or n/a for xs:string)

This is certainly *possible*. How easy this is depends very much on
how complicated your schema is -- using named model groups, included
schemas and (worse!) redefined schemas makes life really difficult.

What you have to do is navigate through the schema and the instance
document side-by-side. I wrote up how to do this in detail in my
chapter for Professional XML Schemas from Wrox:

 http://www.amazon.com/exec/obidos/tg/detail/-/1861005474

There it was for the purposes of filling in an HTML form, generated
from the schema, within information from an instance document, but the
same principles apply. Unfortunately, it's rather involved, so all I
can suggest is that you buy, borrow or steal the book, or contact me
offline and I'll send you the source code if you'd like.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.