AW: [F&O] Casting to xs:NOTATION, xs:QName not clarified

Ashok, thank you for your answer.

Did I understand you right?
(1) We can both cast and construct xs:QName and xs:NOTATION
    from string literals, i.e. the following expressions are valid:
     "a" cast as xs:QName
     xs:QName("a")
(2) We cannot cast or construct xs:QName and xs:NOTATION
    from strings in general, i.e. the following expressions are invalid:
       fn:string(<a>b</a>) cast as xs:QName
       xs:QName(xs:string("a"))

Could you please explain why it makes sense to prohibit the 
examples from (2)? 

Regards,
Frank 

> -----Ursprüngliche Nachricht-----
> Von: Ashok Malhotra [mailto:ashok.malhotra@oracle.com] 
> Gesendet: Thursday, January 27, 2005 2:39 AM
> An: legler@informatik.hu-berlin.de; public-qt-comments@w3.org
> Betreff: RE: [F&O] Casting to xs:NOTATION, xs:QName not clarified
> 
> Frank:
> My apologies!  I thought the issue had been clarified in the 
> ensuing discussion but, clearly, I was mistaken.
> 
> When you cast, you, in general, cast an expression.  The 
> prohibition for casting from string to QName in the casting 
> section refers to this general case.  If you do have a string 
> literal you can construct a QName from it.
> 
> If you feel strongly abt this, we can consider a change that 
> says "casting from string to QName is not allowed in general 
> but allowed in the special case that you are casting a string 
> literal" but this seems like a minor
> corner case to me.
> 
> 
> All the best, Ashok
> > -----Original Message-----
> > From: public-qt-comments-request@w3.org [mailto:public-qt-comments-
> > request@w3.org] On Behalf Of Frank Legler
> > Sent: Wednesday, January 26, 2005 2:57 PM
> > To: public-qt-comments@w3.org
> > Subject: RE: [F&O] Casting to xs:NOTATION, xs:QName not clarified
> > 
> > 
> > Hello,
> > 
> > I am sorry to repeat myself, but I did not
> > receive a satisfying answer the last time.
> > 
> > According to Ashok's mail from 5 Nov 2004 [1]
> > and from 17 Jan 2005 [2] is it "possible to
> > construct xs:QName and xs:NOTATION from string
> > literals"
> > 
> > Nevertheless the casting table in the F&O spec [3]
> > prohibits the cast from xs:string to xs:QName
> > and xs:NOTATION. Michael Rys pointed out that
> > the table applies to both constructors and
> > casts [4].
> > 
> > My question is if this is
> > (1) an error in the spec, i.e. the casting table
> >     needs to be corrected?
> > or
> > (2) we indeed can construct xs:QName and
> >     xs:NOTATION from xs:string but cannot cast it?
> > 
> > 
> > Regards,
> > Frank
> > 
> > URLS:
> > [1] 
> http://lists.w3.org/Archives/Public/public-qt-comments/2004Nov/0019.
> > html
> > [2] 
> http://lists.w3.org/Archives/Public/public-qt-comments/2005Jan/0023.
> > html
> > [3] 
> http://w3.org/TR/xpath-functions/#casting-from-primitive-to-primitive
> > [4] 
> http://lists.w3.org/Archives/Public/public-qt-comments/2005Jan/0020.
> > html
> > 

Received on Friday, 28 January 2005 02:55:58 UTC