Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xml-dev] datatype functionality I'd like to see

From: bry@------.---
To: Burak Emir <Burak.Emir@----.-->
Date: 7/8/2004 12:28:00 PM
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.


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent