Re: Namespace considerations

Thanks for the quick reply,

What I am unsure about though, is whether or not users of our XPath2 
implementation can invoke constructors within either namespace?

for example, if I bind xf to "http://www.w3.org/2001/XMLSchema" and 
xs to "http://www.w3.org/2001/XMLSchema-datatypes", then which of these 
(or all?) are legal?

'cast as xs:string(xs:decimal("15.5"))'
'cast as xf:string(xs:decimal("15.5"))'
'cast as xf:string(xf:decimal("15.5"))'

On a different note, I thought that xs was bound to 
"http://www.w3.org/2001/XMLSchema" in the spec simply for convenience.  
You seem to imply that it is a predefined prefix which is always bound to 
"http://www.w3.org/2001/XMLSchema".  Yet the F&O specs do use the 
xs: prefix for constructors, which is defined to be in the 
"http://www.w3.org/2001/XMLSchema-datatypes" namespace.

Thanks again for your help,
Caroline
 

On Wed, 19 Feb 2003, Jonathan Robie wrote:

> 
> Hi Caroline,
> 
> Good question! The short answer is that you can use 
> ""http://www.w3.org/2001/XMLSchema-datatypes" only if you import that 
> schema. Even though the same set of datatypes are available under either 
> namespace, the datatypes in the two namespaces are not exactly identical. 
> If you go to the above URI, you can download the schema for datatypes, and 
> you will see that it looks like the following excerpt:
> 
> <schema xmlns="http://www.w3.org/2001/XMLSchema"
>                targetNamespace="http://www.w3.org/2001/XMLSchema-datatypes"
>              version="$Id: XMLSchema-datatypes.xsd,v 1.5 2001/03/16 
> 20:53:32 ht Exp $">
> 
>    <simpleType name="string">
>     <restriction base="string"/>
>    </simpleType>
> 
>    <simpleType name="boolean">
>     <restriction base="boolean"/>
>    </simpleType>
>    <!-- SNIP -->
> 
> For each datatype in the "http://www.w3.org/2001/XMLSchema" namespace, it 
> defines a new datatype in the "http://www.w3.org/2001/XMLSchema-datatypes" 
> namespace, deriving it from the original by trivial restriction.
> 
> You can import this schema like any other schema. It's often easier to 
> simply use the predefined xs: prefix, which always points to 
> "http://www.w3.org/2001/XMLSchema".
> 
> Jonathan
> 
> At 06:13 PM 2/18/2003 +0000, Caroline Rioux wrote:
> 
> >Hi,
> >
> >I need some clarification on the namespaces used for constructors and
> >datatypes.
> >
> >In the F&O spec, section 1.5 it says:
> >
> >The URIs of the namespaces are:
> >   * http://www.w3.org/2001/XMLSchema-datatypes for constructors
> >   * http://www.w3.org/2002/11/xquery-operators for operators
> >   * http://www.w3.org/2002/11/xquery-functions for functions.
> >
> >Which implies that constructors are in the
> >http://www.w3.org/2001/XMLSchema-datatypes namespace
> >
> >In XML Schema Part 2: Datatypes section 3.1 (Namespace Considerations)
> >
> >   The ·built-in· datatypes defined by this specification are designed to be
> >   used with the XML Schema definition language as well as other XML
> >   specifications. To facilitate usage within the XML Schema definition
> >   language, the ·built-in· datatypes in this specification have the
> >   namespace name:
> >
> >   http://www.w3.org/2001/XMLSchema
> >
> >   To facilitate usage in specifications other than the XML Schema definition
> >   language, such as those that do not want to know anything about aspects of
> >   the XML Schema definition language other than the datatypes, each
> >   ·built-in· datatype is also defined in the namespace whose URI is:
> >
> >   http://www.w3.org/2001/XMLSchema-datatypes
> >
> >
> >Does this mean that either namespace can be used, even in the case of
> >construction?
> >
> >Thanks for any clarification,
> >
> >--
> >Caroline Rioux, Software Engineer           +44-1865-203192
> >DecisionSoft Limited                        http://www.decisionsoft.com
> >XML Development and Services
> 
> 

-- 
Caroline Rioux, Software Engineer           +44-1865-203192
DecisionSoft Limited                        http://www.decisionsoft.com
XML Development and Services

Received on Wednesday, 19 February 2003 11:23:48 UTC