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

Re: datatype functionality I'd like to see


date in jscript
Quoting Burak Emir <Burak.Emir@e...>:


> >  
> >
> I certainly do not know any schema language that deals with "segmented" 
> regular expressions.
> 
> However, in research languages, regular pattern matching is getting 
> quite popular. In Scala for instance, your SSN could be decomposed like
> this
> 
> def decomp(ssn:Seq[Char]):Pair[Seq[Char],Seq[Char]] = ssn match {
>   case (part1 @ DD-AA)(part2 @ BDD-DDDD) => Pair(part1, part2)
>   case _ => error("invalid ssn")
> }
>
Thanks for your reply, that scala looks pretty interesting. Maybe I should look
at that language again (checked it out once when it was on lambda)



> I once had the idea of adding this feature of pattern matching to a (yet 
> another) type system for objects and XML(turning sequences of nodes in 
> something like a record). Glad there seems to be use for it.

Yeah, after posting I got the idea to implement it as an extension to
schematron, processor specific, using the skeleton1-5.xsl 

basically one would have some data types declared at the top of the schematron
schema:
<sch:dtypes>
<sch:type name="Date" using="jscript:Date"/>
<sch:type name="USDate" using="dtype:Date">
<test>....</test>
</sch:type>
</sch:dtypes>

and then under specific rules:
<sch:isDtype type="USDate"/>

obviously I haven't got to the dtype: functionality yet (not exactly sure how I
want the syntax to work anyway), but checking against anything that inherits
from jscript: just means calling a function that returns a boolean dependent on
how some typechecking and or loading into a new instance of the object works
out.

Gets me wondering also if Dmitri Novatchev's fxsl might not be put to good work
to extend schematron with data typing. 






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
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

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.