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

Re: Types and Context

  • From: Jonathan Borden <jborden@m...>
  • To: "Simon St.Laurent" <simonstl@s...>
  • Date: Tue, 22 May 2001 19:11:39 -0400

typeof function
Simon St.Laurent wrote:

> >
> > sure. what we still need is a processable incarnation of the "PSVI". no
such
> > thing exists today. you are basically saying that "if we had an API
which
> > provides access to the information in the PSVI then we could easily do
> > this."
>
> Better still, a usable XML representation of the PSVI.  Then we could
> use existing XML tools on the PSVI without needing to add all kinds of
> PSVI-only tools to the system.
>
> I'd really like to have a viable route that isn't an API...
>

Let's not get too afraid of this so-called 'API', I am suggesting that this
amounts to a _single_ extension function named "typeOf" ... that is testing
whether a node is 'valid' with respect to a schema _and_ ascertaining the
type of a node are the same thing (under the schema algebra formulation).

The problem with using _only_ an XML representation of the PSVI is that it
doesn't alone replace the "typeOf" function ... assume an XSLT processor
that attaches an "xsi:type" attribute to each and every element in an XML
document. For example

 <foo>123</foo>

becomes ('psvi')

<foo xsi:type="simonsVeryOwn:integer">123</foo>

whipee!!!

the reason that the "typeOf" function is more interesting is that it
"understands" the type hierarchy so that the test:

typeOf(node, "simonsVeryOwn:integer") and
typeOf(node, "xsd:integer") both might be true, yet simply testing the value
of a type adorning attribute doesn't tell us this.

Note that "typeOf" is not unique to XPath, and a similar function would be
introduced for DOM 8 or whatever the version is intended to support the
'PSVI'

-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.