RE: Namespace considerations

If you do not import the schema, then xs:decimal will not be available.
You have to import the schema in order to get the constructor functions.

Best regards
Michael

> -----Original Message-----
> From: Caroline Rioux [mailto:crioux@decisionsoft.com]
> Sent: Thursday, March 06, 2003 0:45 AM
> To: Kay, Michael
> Cc: Jonathan Robie; Michael Rys; public-qt-comments@w3.org
> Subject: RE: Namespace considerations
> 
> Thank you Michael.  This question was indeed for an XPath
implementation.
> 
> Now, if in a document I do not import/reference any schemas, and I
bind
> xf to "http://www.w3.org/2001/XMLSchema" and
> xs to "http://www.w3.org/2001/XMLSchema-datatypes"
> 
> I know that it is legal to do
> 
> 'xf:decimal("15.5")'
> 
> (because of the XPath 2.0 spec, section 2.6.2.1.1)  but can I do
> 
> 'xs:decimal("15.5")' ?
> 
> ie, are the XMLSchema-datatypes datatypes 'automatically' available,
just
> as the 44 types from XMLSchema are?
> 
> Thanks,
> Caroline
> 
> 
> 
> On Wed, 5 Mar 2003, Kay, Michael wrote:
> 
> > > The xs: prefix is predefined, bound to
> > > "http://www.w3.org/2001/XMLSchema",
> > > so there is no need to
> > > bind anything to xs.  I'm trying to remember if we
> > > outlawed redefining this prefix - I think not, but I also
> > > asked the WG the
> > > question, and I will reply here if I find out that I was wrong.
> > >
> > > So under the assumption that you actually can redefine this
> > > prefix, if you
> > > do not import the schema, these types will not be predefined,
> > > and you will
> > > get a type error, since the system does not know what types you
are
> > > referring to.
> > >
> > > Jonathan
> > >
> >
> > That answer is correct for XQuery. I don't recall whether the
original
> > question was about XPath or XQuery. In XPath, all namespace prefixes
> except
> > "xml" have to be defined explicitly.
> >
> > Michael Kay
> >
> 
> --
> Caroline Rioux, Software Engineer           +44-1865-203192
> DecisionSoft Limited
http://www.decisionsoft.com
> XML Development and Services

Received on Thursday, 6 March 2003 09:28:42 UTC