XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: Fwd: [xml-dev] Not using mixed content? Then don't use XML

On Tue, 2013-04-09 at 09:45 +0100, Andrew Welch wrote:

> One issue I still haven't found a good solution or answer to is when
> you have additional 'business rules' validation performed by the
> application:

One useful approach here can be "pipeline validation," orchestrated
perhaps using xproc or even "make".

For example, suppose you have a business rule that says a share price
must have a valid Toronto stock exchange ticker symbol currently being
traded, and that the current listed price must be within 15% of the
price in the document. Perhaps you have a Web service (or a database
access) that will fetch (buy-price, sell-price, activity level, company
name) given a ticker symbol.

So, you first validate the input using a schema that tells you the data
is in the right ballpark, someone didn't send you their list of local
shoe stores and places to buy explosives. OK. Then you take the result
of that validation episode and populate the <share tx="SUNW"
buy="3020"/> elements with the name of the company and the actual price.

But now you've changed the text of the document, and what if a company
name introduced markup? Or there was no company name (not traded)? So
you validate again with a schema that checks the new information in
context.

There's also a language (SML, [1]) for using multiple schemas to
validate a single document, and for expressing business information.

For my part I'd want to have a higher-level expression of the actual
business rules; this could use SML perhaps, or something more
domain-specific (SML came out of configuration management). Then use
XSLT to turn that into whatever is needed.

Liam

[1] http://www.w3.org/TR/sml/
-- 
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/
Ankh: irc.sorcery.net irc.gnome.org freenode/#xml



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS