> -----Original Message----- > From: Laura Lozano [mailto:[EMAIL PROTECTED] > Sent: Monday, September 24, 2007 5:32 AM > To: [email protected] > Subject: Re: conversion types problem > > ok, with PSVIImplementation and XSValue I can obtain de type > of the element, but if I have, > > <version>2.5</version> > > and the corresponding xsd definition is: > > <xsd:element name="version" type="xsd:double" /> > > with XSValue, how could I obtain the value 2.5 (that is the > value of a text > node) directly like a double value and not like XMLCh* with > getNodeValue?? > > Thank you. > I have had a similar problem and my solution was
1) Get the XMLCh string from the text node 2) Call the getActualValue function from XSValue as : XMLCh *text; XSValue::Status status; // Extract the XMLCh from the node XSValue *val = XSValue::getActualValue(text, XSValue::dt_double, status); double version = val -> fData.fValue.f_doubleType.f_double; delete val; Note you will need to check status and val -> fData.fValue.f_doubleType.f_doubleEnum for errors or INFs/NANs Hope this helps Dale Pennington
