DOMElement* EppCommandInfoLaunchRegistration::toXML( DOMDocument& doc, const DOMString& tag ) { DOMElement* elm; DOMElement* body = EppUtil::createElementNS(doc, "launch", (tag.isNull()) ? "info" : tag, false, "-1.0"); DOMAttr* attr = doc.createAttribute(XS("includeMark")); attr->setValue( ( this->_includeMark ) ? XS("true") : XS("false") ); body->setAttributeNode(attr); if( this->_phase.phase().length() > 0 ) { DOMElement* elm = this->_phase.toXML(doc, "phase"); body->appendChild(elm); } if( this->_appId.isNotNull() ) { if( this->_appId.length() > 0 ) { elm = doc.createElement(XS("applicationID")); elm->appendChild(doc.createTextNode(this->_appId)); body->appendChild(elm); } } return body; }
void SYSTEM::CConfigItem::SetProperties(const char * propName, const char * value) { if(!propName||!value) { return; } if(((DOMElement*)itemElement)->hasAttributes()) { DOMNamedNodeMap *pAttributes = ((DOMElement*)itemElement)->getAttributes(); XMLCh *t = XMLString::transcode(propName); DOMAttr *pAttributeNode = (DOMAttr*)pAttributes->getNamedItem(t); XMLString::release(&t); if(!pAttributeNode) { return; //属性名错误,抛出异常 } t = XMLString::transcode(value); pAttributeNode->setValue(t); XMLString::release(&t); } else { return; } }
DOMElement* EppCommandTransferDomain::toXML( DOMDocument& doc, const DOMString& tag ) { DOMElement* body = toXMLPoll(doc, tag); DOMAttr* attr = doc.createAttribute(XS("op")); attr->setValue(this->getOperation()); ValueVectorOf<DOMAttr*> attrList(1); attrList.addElement(attr); return toXMLCommon(doc, tag, body, &attrList); }
DOMElement* EppCommandCreateLaunchRegistration::toXML( DOMDocument& doc, const DOMString& tag ) { DOMElement* elm; DOMElement* body = EppUtil::createElementNS(doc, "launch", (tag.isNull()) ? "create" : tag, false, "-1.0"); if( this->_type.length() > 0 ) { DOMAttr* attr = doc.createAttribute(XS("type")); attr->setValue( this->_type); body->setAttributeNode(attr); } if ( this->_phase.phase().length() > 0 ) { DOMElement* elm = this->_phase.toXML(doc, "phase"); body->appendChild(elm); } if( (_signedMark.hasSMD()) ) { /*RAII*/ DOMElement* elm = this->_signedMark.toXML(doc, "signedMark"); body->appendChild(elm); } if( (_encSignedMark.hasSMD()) ) { /*RAII*/ DOMElement* elm = this->_encSignedMark.toXML(doc, "encodedSignedMark"); body->appendChild(elm); } if( this->_noticeID.length() > 0 ) { elm = doc.createElement(XS("noticeID")); elm->appendChild(doc.createTextNode(this->_noticeID)); body->appendChild(elm); } if( this->_notAfter.length() > 0 ) { elm = doc.createElement(XS("notAfter")); elm->appendChild(doc.createTextNode(this->_notAfter)); body->appendChild(elm); } if( this->_acceptedDate.length() > 0 ) { elm = doc.createElement(XS("acceptedDate")); elm->appendChild(doc.createTextNode(this->_acceptedDate)); body->appendChild(elm); } return body; }
DOMElement* EppLaunchPhase::toXML(DOMDocument &doc, const DOMString &tag) { //DOMElement* elm; DOMElement* body = doc.createElement(tag); if( this->_sub_phase.length() > 0 ) { DOMAttr* attr = doc.createAttribute(XS("name")); attr->setValue( this->_sub_phase ); body->setAttributeNode(attr); } if( this->_phase.length() > 0 ) { body->appendChild(doc.createTextNode(this->_phase)); } return body; }
/* NOTE: need to keep _type field in consideration as attribute type/entitlement depends on it.*/ DOMElement* EppMarkHolder::toXML(DOMDocument &doc, const DOMString &tag) { DOMString attr_name = "type"; DOMElement* elm; DOMElement* body = doc.createElement(tag); if( this->_type == EPPMARK_HOLDER ) { attr_name = "entitlement"; } DOMAttr* attr = doc.createAttribute(attr_name); attr->setValue( this->_addParam ); body->setAttributeNode(attr); if( this->_name.length() > 0 ) { elm = doc.createElement(XS("name")); elm->appendChild(doc.createTextNode(this->_name)); body->appendChild(elm); } if( this->_org.length() > 0 ) { elm = doc.createElement(XS("org")); elm->appendChild(doc.createTextNode(this->_org)); body->appendChild(elm); } body->appendChild(this->_addr.toXML(doc, "addr")); if( this->_voice.getNumber().length() > 0 ) { elm = this->_voice.toXML(doc, "voice"); body->appendChild(elm); } if( this->_fax.getNumber().length() > 0 ) { elm = this->_fax.toXML(doc, "fax"); body->appendChild(elm); } if( this->_email.length() > 0 ) { elm = doc.createElement(XS("email")); elm->appendChild(doc.createTextNode(this->_email)); body->appendChild(elm); } return body; }
void XercesSequenceBuilder::namespaceEvent(const XMLCh *prefix, const XMLCh *uri) { if(currentParent_ != 0) { DOMAttr *attr = document_->createAttributeNS(XMLUni::fgXMLNSURIName, prefix == 0 ? XMLUni::fgXMLNSString : prefix); if(prefix != 0) attr->setPrefix(XMLUni::fgXMLNSString); attr->setValue(uri); currentParent_->getAttributes()->setNamedItemNS(attr); currentNode_ = attr; } else { document_ = new (context_->getMemoryManager()) XPathDocumentImpl(XQillaImplementation::getDOMImplementationImpl(), context_->getMemoryManager()); DOMXPathNamespace *ns = new (document_, (DOMDocumentImpl::NodeObjectType)XPathNamespaceImpl::XPATH_NAMESPACE_OBJECT) XPathNamespaceImpl(prefix, uri, 0, document_); seq_.addItem(new XercesNodeImpl(ns, (XercesURIResolver*)context_->getDefaultURIResolver())); document_ = 0; currentNode_ = 0; } }
void XercesSequenceBuilder::attributeEvent(const XMLCh *prefix, const XMLCh *uri, const XMLCh *localname, const XMLCh *value, const XMLCh *typeURI, const XMLCh *typeName) { if(document_ == 0) { document_ = new (context_->getMemoryManager()) XPathDocumentImpl(XQillaImplementation::getDOMImplementationImpl(), context_->getMemoryManager()); } DOMAttr *attr = document_->createAttributeNS(uri, localname); if(prefix != 0) attr->setPrefix(prefix); attr->setValue(value); setAttributeTypeInfo(attr, typeURI, typeName); if(currentParent_ != 0) currentParent_->getAttributes()->setNamedItemNS(attr); currentNode_ = attr; if(currentParent_ == 0) { seq_.addItem(new XercesNodeImpl(currentNode_, (XercesURIResolver*)context_->getDefaultURIResolver())); document_ = 0; currentNode_ = 0; } }