baranidharan wrote:
Hi all,

char *value;
DOMElement* elem = (DOMElement*) nodexml;
XMLCh *xname = XMLString::transcode("id");
value = XMLString::transcode(elem->getAttribute(xname));
printf("id =%s\n",value);

In the above program , i am getting the attribute value in string fornat, but i need the integer format , how to get that , which xerecs c++ function i have to use.
You can use the XSValue class to do this. Take a look at src/xercesc/framework/psvi/XSValue.hpp:

/**
  * Get the actual value, in the form of XSValue, for a given string of the
  * data type specified
  *
* Client application is responsible for the deleletion of the XSValue returned.
  *
  * @param  content    raw data
  * @param  datatype   schema datatype
  * @param  status     validation status which is set upon validation fails
  * @param  version    xml version
  * @param  toValidate to validate the content before generate actual value
  * @param  manager    memory manager provided
  */
static
XSValue* getActualValue
         (
            const XMLCh*          const content
          ,       DataType              datatype
          ,       Status&               status
          ,       XMLVersion            version    = ver_10
          ,       bool                  toValidate = true
, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
         );

The XSValue instance returned will have the actual value in its fData member. You will need to make sure you access the appropriate field of the union.

Dave

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to