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

Re: typing and markup (was Re: XQuery types)


types of inferences
Jonathan Robie wrote:

>
> Frankly, I think much of this is because of the level of the discussion.
>
> Suppose you try to multiply an integer times a URI. Do you want that error
> to be caught? Suppose you want a sorted list of numbers - do you want to
> sort them numerically rather than lexically? If so, types are good. Yes,
> whoever implemented the system had to think to make that happen. We have
> descriptions of the thinking implementors will have to do.
>
> Has the strong static typing of Java gotten in your way as a programmer?
>

We are talking about two different types of typing: the first roughly
corresponds to XML Schema simple types and involves the mapping of a lexical
to value representation i.e. the string "10" to the number 10.

The second type of type roughtly corresponds to XML Schema complex types and
is perhaps more apropos to XML in its lexical form.

The types of inferences that one can draw knowing that two entities are
numbers vs. knowing that two entities are XML elements conforming to a
particular schema particle are different. All the examples seem to focus on
the former, binary, datatype usage and Simon is right to complain, XML is
after all a lexical form.

The latter is more apropos to, for example, XPath/XSLT processing where an
XPath expression is exactly a class specifier -- it selects a _set of nodes_
that match the XPath pattern. So an XSLT template is, then, a mechanism to
apply a function to a set of nodes having a given class -- the class
specifier is the match pattern.

A regular expression does exactly the same thing, it specifies a class of
lexical tokens that are constrained to match the regex. An EBNF generated
parser e.g. via JavaCC or ANTLR is roughly analogous to an XSLT process,
just for text rather than XML -- in boths cases, however, there must exist a
pattern matcher, which is a string classifier, that selects strings on the
basis of whether they match the given pattern i.e. belong to the described
set of tokens.

The advantage of having an XQuery like type _heirarchy_ as opposed to simple
type specifiers i.e. XPath 1.0 patterns, is that, as Jonathan Robie points
out, one can make additional inferences about the particular classes and
ways that the classes are combined. For example suppose we have:

intersectionOf( intersectionOf(A,B), intersectionOf(C,D) )

we know that this is the same as:

insersectionOf( A,B,C,D )

and manipulating classes in such ways can be very useful.

Jonathan

Jonathan

Jonathan




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.