xsl-list
[Top] [All Lists]

SV: empty string parsed as float?

2005-06-02 01:50:56
Ah, I totally forgot, sorry!
Anyway, thanks for the answer.

/Gabriel

-----Ursprungligt meddelande-----
Från: Michael Kay [mailto:mike(_at_)saxonica(_dot_)com] 
Skickat: den 2 juni 2005 03:54
Till: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Ämne: RE: [xsl] empty string parsed as float?

This is an XML Schema question not an XSLT question!

You can define the type of the element as a list data type that allows a
list of floats with minOccurs=0 and maxOccurs=1. Alternatively you could
define it as a union data type that's the union of a float and a zero-length
string.

You could also define the type as "nillable", but then you would have to
flag an empty element with xsi:nil="true" 

-----Original Message-----
From: Gabriel K [mailto:gabriel(_dot_)klappenbach(_at_)bredband(_dot_)net] 
Sent: 01 June 2005 21:09
To: XSL-list
Subject: [xsl] empty string parsed as float?

I have a schema which defines an element with type float (or 
anything other
than string for that matter).
The xml file validated has the element, but it's empty.
So the parser tells me it can't parse the value '' as a float.

When I wrote the schema I thought that if you leave the 
element empty, it
would pass validation, and if you don't leave it empty, it 
MUST be a float
to pass validation.
I don't want the element to have the type string or token, I 
want float. But
I want it to not give an error if the element is empty.
Is this possible? In that case how?


/Gabriel


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--





--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>