/*
- * Copyright 2001-2005 Internet2
+ * Copyright 2001-2007 Internet2
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#endif
using namespace xmltooling;
+using namespace xercesc;
using namespace std;
extern string data_path;
#endif
VectorOf(SimpleXMLObject) mine=getSimpleXMLObjects();
for (vector<SimpleXMLObject*>::const_iterator i=src.m_simples.begin(); i!=src.m_simples.end(); i++) {
- mine.push_back((*i) ? (*i)->clone() : NULL);
+ mine.push_back(dynamic_cast<SimpleXMLObject*>((*i)->clone()));
}
}
XMLString::release(&m_id);
}
- SimpleXMLObject* clone() const {
+ XMLObject* clone() const {
auto_ptr<XMLObject> domClone(AbstractDOMCachingXMLObject::clone());
SimpleXMLObject* ret=dynamic_cast<SimpleXMLObject*>(domClone.get());
if (ret) {
}
protected:
- void marshallAttributes(DOMElement* domElement) const {
+ void marshallAttributes(xercesc::DOMElement* domElement) const {
if(getId()) {
domElement->setAttributeNS(NULL, SimpleXMLObject::ID_ATTRIB_NAME, getId());
domElement->setIdAttributeNS(NULL, SimpleXMLObject::ID_ATTRIB_NAME);
}
}
- void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
+ void processChildElement(XMLObject* childXMLObject, const xercesc::DOMElement* root) {
SimpleXMLObject* simple=dynamic_cast<SimpleXMLObject*>(childXMLObject);
if (simple) {
getSimpleXMLObjects().push_back(simple);
throw UnmarshallingException("Unknown child element cannot be added to parent object.");
}
- void processAttribute(const DOMAttr* attribute) {
+ void processAttribute(const xercesc::DOMAttr* attribute) {
if (XMLHelper::isNodeNamed(attribute, NULL, SimpleXMLObject::ID_ATTRIB_NAME))
setId(attribute->getValue());
else
class SimpleXMLObjectBuilder : public XMLObjectBuilder
{
public:
- SimpleXMLObject* buildObject() const {
+ XMLObject* buildObject() const {
return buildObject(SimpleXMLObject::NAMESPACE, SimpleXMLObject::LOCAL_NAME, SimpleXMLObject::NAMESPACE_PREFIX);
}
- SimpleXMLObject* buildObject(
+ XMLObject* buildObject(
const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL, const QName* schemaType=NULL
) const {
return new SimpleXMLObject(nsURI, localName, prefix, schemaType);
}
- static SimpleXMLObject* newSimpleXMLObject() {
+ static SimpleXMLObject* buildSimpleXMLObject() {
const SimpleXMLObjectBuilder* b = dynamic_cast<const SimpleXMLObjectBuilder*>(
XMLObjectBuilder::getBuilder(QName(SimpleXMLObject::NAMESPACE,SimpleXMLObject::LOCAL_NAME))
);
if (b)
- return b->buildObject();
+ return dynamic_cast<SimpleXMLObject*>(b->buildObject());
throw XMLObjectException("Unable to obtain typed builder for SimpleXMLObject.");
}
};