XMLObject* XMLObjectBuilder::buildFromElement(DOMElement* element, bool bindDocument) const
{
+ auto_ptr<QName> schemaType(XMLHelper::getXSIType(element));
auto_ptr<XMLObject> ret(
- buildObject(element->getNamespaceURI(),element->getLocalName(),element->getPrefix(),XMLHelper::getXSIType(element))
+ buildObject(element->getNamespaceURI(),element->getLocalName(),element->getPrefix(),schemaType.get())
);
ret->unmarshall(element,bindDocument);
return ret.release();
*/
#define PROC_QNAME_ATTRIB(proper,ucase,namespaceURI) \
if (xmltooling::XMLHelper::isNodeNamed(attribute, namespaceURI, ucase##_ATTRIB_NAME)) { \
- set##proper(XMLHelper::getAttributeValueAsQName(attribute)); \
+ auto_ptr<xmltooling::QName> q(XMLHelper::getAttributeValueAsQName(attribute)); \
+ set##proper(q.get()); \
return; \
}
*/
#include "internal.h"
+#include "unicode.h"
#include "util/DateTime.h"
#ifndef WIN32
XMLString::copyNString(miliSecData, &(fBuffer[start-1]), miliSecLen);
*(miliSecData + miliSecLen) = chNull;
- char *nptr = XMLString::transcode(miliSecData);
- ArrayJanitor<char> jan(nptr);
- size_t strLen = strlen(nptr);
+ auto_ptr_char nptr(miliSecData);
+ size_t strLen = strlen(nptr.get());
char *endptr = 0;
errno = 0;
//printf("milisec=<%s>\n", nptr);
- double retVal = strtod(nptr, &endptr);
+ double retVal = strtod(nptr.get(), &endptr);
// check if all chars are valid char
- if ( (endptr - nptr) != strLen)
+ if ( (endptr - nptr.get()) != strLen)
throw XMLParserException("Invalid non-numeric characters.");
// we don't check underflow occurs since
/**
* Gets the XSI type for a given element if it has one.
+ * <p>The caller is responsible for freeing the result.
*
* @param e the element
* @return the type or null
/**
* @deprecated
* Constructs a QName from an attribute's value.
+ * <p>The caller is responsible for freeing the result.
*
* @param attribute the attribute with a QName value
* @return a QName from an attribute's value, or null if the given attribute is null
/**
* Constructs a QName from a node's value.
+ * <p>The caller is responsible for freeing the result.
*
* @param domNode the DOM node with a QName value
* @return a QName from a node's value, or null if the given node has no value