From: cantor Date: Mon, 23 Oct 2006 01:33:44 +0000 (+0000) Subject: Removed unnecessary class from string literals. X-Git-Tag: 1.4.1~638 X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fxmltooling.git;a=commitdiff_plain;h=f4a896a316898e7bcdddb95e7f896b4d7b6a50a6 Removed unnecessary class from string literals. git-svn-id: https://svn.middleware.georgetown.edu/cpp-xmltooling/trunk@185 de75baf8-a10c-0410-a50a-987c0e22f00f --- diff --git a/xmltooling/XMLToolingConfig.cpp b/xmltooling/XMLToolingConfig.cpp index fac88e1..e05ff8f 100644 --- a/xmltooling/XMLToolingConfig.cpp +++ b/xmltooling/XMLToolingConfig.cpp @@ -213,7 +213,7 @@ bool XMLToolingInternalConfig::init() REGISTER_EXCEPTION_FACTORY(IOException,xmltooling); #ifndef XMLTOOLING_NO_XMLSEC - XMLObjectBuilder::registerBuilder(QName(XMLConstants::XMLSIG_NS,Signature::LOCAL_NAME),new SignatureBuilder()); + XMLObjectBuilder::registerBuilder(QName(xmlconstants::XMLSIG_NS,Signature::LOCAL_NAME),new SignatureBuilder()); REGISTER_EXCEPTION_FACTORY(SignatureException,xmlsignature); registerKeyResolvers(); registerCredentialResolvers(); @@ -223,7 +223,7 @@ bool XMLToolingInternalConfig::init() // Register xml:id as an ID attribute. static const XMLCh xmlid[] = UNICODE_LITERAL_2(i,d); - AttributeExtensibleXMLObject::registerIDAttribute(QName(XMLConstants::XML_NS, xmlid)); + AttributeExtensibleXMLObject::registerIDAttribute(QName(xmlconstants::XML_NS, xmlid)); } catch (const xercesc::XMLException&) { log.fatal("caught exception while initializing Xerces"); diff --git a/xmltooling/base.h b/xmltooling/base.h index 106816f..864954b 100644 --- a/xmltooling/base.h +++ b/xmltooling/base.h @@ -387,46 +387,46 @@ XMLTOOLING_DOXYGEN(Returns the proper attribute or def if not set.) \ bool proper() const { \ switch (get##proper()) { \ - case xmltooling::XMLConstants::XML_BOOL_TRUE: \ - case xmltooling::XMLConstants::XML_BOOL_ONE: \ + case xmlconstants::XML_BOOL_TRUE: \ + case xmlconstants::XML_BOOL_ONE: \ return true; \ - case xmltooling::XMLConstants::XML_BOOL_FALSE: \ - case xmltooling::XMLConstants::XML_BOOL_ZERO: \ + case xmlconstants::XML_BOOL_FALSE: \ + case xmlconstants::XML_BOOL_ZERO: \ return false; \ default: \ return def; \ } \ } \ XMLTOOLING_DOXYGEN(Returns the proper attribute as an explicit enumerated value.) \ - virtual xmltooling::XMLConstants::xmltooling_bool_t get##proper() const=0; \ + virtual xmlconstants::xmltooling_bool_t get##proper() const=0; \ XMLTOOLING_DOXYGEN(Sets the proper attribute using an enumerated value.) \ - virtual void proper(xmltooling::XMLConstants::xmltooling_bool_t value)=0; \ + virtual void proper(xmlconstants::xmltooling_bool_t value)=0; \ XMLTOOLING_DOXYGEN(Sets the proper attribute.) \ void proper(bool value) { \ - proper(value ? xmltooling::XMLConstants::XML_BOOL_ONE : xmltooling::XMLConstants::XML_BOOL_ZERO); \ + proper(value ? xmlconstants::XML_BOOL_ONE : xmlconstants::XML_BOOL_ZERO); \ } \ XMLTOOLING_DOXYGEN(Sets the proper attribute using a string constant.) \ void set##proper(const XMLCh* value) { \ if (value) { \ switch (*value) { \ case chLatin_t: \ - proper(xmltooling::XMLConstants::XML_BOOL_TRUE); \ + proper(xmlconstants::XML_BOOL_TRUE); \ break; \ case chLatin_f: \ - proper(xmltooling::XMLConstants::XML_BOOL_FALSE); \ + proper(xmlconstants::XML_BOOL_FALSE); \ break; \ case chDigit_1: \ - proper(xmltooling::XMLConstants::XML_BOOL_ONE); \ + proper(xmlconstants::XML_BOOL_ONE); \ break; \ case chDigit_0: \ - proper(xmltooling::XMLConstants::XML_BOOL_ZERO); \ + proper(xmlconstants::XML_BOOL_ZERO); \ break; \ default: \ - proper(xmltooling::XMLConstants::XML_BOOL_NULL); \ + proper(xmlconstants::XML_BOOL_NULL); \ } \ } \ else \ - proper(xmltooling::XMLConstants::XML_BOOL_NULL); \ + proper(xmlconstants::XML_BOOL_NULL); \ } /** @@ -527,12 +527,12 @@ */ #define IMPL_BOOLEAN_ATTRIB(proper) \ protected: \ - XMLConstants::xmltooling_bool_t m_##proper; \ + xmlconstants::xmltooling_bool_t m_##proper; \ public: \ - XMLConstants::xmltooling_bool_t get##proper() const { \ + xmlconstants::xmltooling_bool_t get##proper() const { \ return m_##proper; \ } \ - void proper(XMLConstants::xmltooling_bool_t value) { \ + void proper(xmlconstants::xmltooling_bool_t value) { \ if (m_##proper != value) { \ releaseThisandParentDOM(); \ m_##proper = value; \ @@ -768,19 +768,19 @@ */ #define MARSHALL_BOOLEAN_ATTRIB(proper,ucase,namespaceURI) \ switch (m_##proper) { \ - case XMLConstants::XML_BOOL_TRUE: \ - domElement->setAttributeNS(namespaceURI, ucase##_ATTRIB_NAME, XMLConstants::XML_TRUE); \ + case xmlconstants::XML_BOOL_TRUE: \ + domElement->setAttributeNS(namespaceURI, ucase##_ATTRIB_NAME, xmlconstants::XML_TRUE); \ break; \ - case XMLConstants::XML_BOOL_ONE: \ - domElement->setAttributeNS(namespaceURI, ucase##_ATTRIB_NAME, XMLConstants::XML_ONE); \ + case xmlconstants::XML_BOOL_ONE: \ + domElement->setAttributeNS(namespaceURI, ucase##_ATTRIB_NAME, xmlconstants::XML_ONE); \ break; \ - case XMLConstants::XML_BOOL_FALSE: \ - domElement->setAttributeNS(namespaceURI, ucase##_ATTRIB_NAME, XMLConstants::XML_FALSE); \ + case xmlconstants::XML_BOOL_FALSE: \ + domElement->setAttributeNS(namespaceURI, ucase##_ATTRIB_NAME, xmlconstants::XML_FALSE); \ break; \ - case XMLConstants::XML_BOOL_ZERO: \ - domElement->setAttributeNS(namespaceURI, ucase##_ATTRIB_NAME, XMLConstants::XML_ZERO); \ + case xmlconstants::XML_BOOL_ZERO: \ + domElement->setAttributeNS(namespaceURI, ucase##_ATTRIB_NAME, xmlconstants::XML_ZERO); \ break; \ - case XMLConstants::XML_BOOL_NULL: \ + case xmlconstants::XML_BOOL_NULL: \ break; \ } diff --git a/xmltooling/encryption/Encryption.h b/xmltooling/encryption/Encryption.h index 2bb3d58..dd698d6 100644 --- a/xmltooling/encryption/Encryption.h +++ b/xmltooling/encryption/Encryption.h @@ -27,7 +27,7 @@ #include #define DECL_XMLENCOBJECTBUILDER(cname) \ - DECL_XMLOBJECTBUILDER(XMLTOOL_API,cname,xmltooling::XMLConstants::XMLENC_NS,xmltooling::XMLConstants::XMLENC_PREFIX) + DECL_XMLOBJECTBUILDER(XMLTOOL_API,cname,xmlconstants::XMLENC_NS,xmlconstants::XMLENC_PREFIX) /** * @namespace xmlencryption diff --git a/xmltooling/encryption/impl/EncryptionImpl.cpp b/xmltooling/encryption/impl/EncryptionImpl.cpp index 1b29a62..ae25710 100644 --- a/xmltooling/encryption/impl/EncryptionImpl.cpp +++ b/xmltooling/encryption/impl/EncryptionImpl.cpp @@ -35,6 +35,8 @@ using namespace xmlencryption; using namespace xmltooling; using namespace std; +using xmlconstants::XMLENC_NS; +using xmlconstants::XMLSIG_NS; #if defined (_MSC_VER) #pragma warning( push ) @@ -102,12 +104,12 @@ namespace xmlencryption { } void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { - PROC_TYPED_CHILD(KeySize,XMLConstants::XMLENC_NS,false); - PROC_TYPED_CHILD(OAEPparams,XMLConstants::XMLENC_NS,false); + PROC_TYPED_CHILD(KeySize,XMLENC_NS,false); + PROC_TYPED_CHILD(OAEPparams,XMLENC_NS,false); // Unknown child. const XMLCh* nsURI=root->getNamespaceURI(); - if (!XMLString::equals(nsURI,XMLConstants::XMLENC_NS) && nsURI && *nsURI) { + if (!XMLString::equals(nsURI,XMLENC_NS) && nsURI && *nsURI) { getOtherParameters().push_back(childXMLObject); return; } @@ -149,7 +151,7 @@ namespace xmlencryption { protected: void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { - PROC_TYPED_FOREIGN_CHILDREN(Transform,xmlsignature,XMLConstants::XMLSIG_NS,false); + PROC_TYPED_FOREIGN_CHILDREN(Transform,xmlsignature,XMLSIG_NS,false); AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root); } }; @@ -194,7 +196,7 @@ namespace xmlencryption { } void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { - PROC_TYPED_CHILD(Transforms,XMLConstants::XMLENC_NS,false); + PROC_TYPED_CHILD(Transforms,XMLENC_NS,false); AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root); } @@ -242,8 +244,8 @@ namespace xmlencryption { protected: void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { - PROC_TYPED_CHILD(CipherValue,XMLConstants::XMLENC_NS,false); - PROC_TYPED_CHILD(CipherReference,XMLConstants::XMLENC_NS,false); + PROC_TYPED_CHILD(CipherValue,XMLENC_NS,false); + PROC_TYPED_CHILD(CipherReference,XMLENC_NS,false); AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root); } }; @@ -360,7 +362,7 @@ namespace xmlencryption { } void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { - PROC_TYPED_CHILDREN(EncryptionProperty,XMLConstants::XMLENC_NS,false); + PROC_TYPED_CHILDREN(EncryptionProperty,XMLENC_NS,false); AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root); } @@ -494,8 +496,8 @@ namespace xmlencryption { protected: void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { - PROC_TYPED_CHILDREN(DataReference,XMLConstants::XMLENC_NS,false); - PROC_TYPED_CHILDREN(KeyReference,XMLConstants::XMLENC_NS,false); + PROC_TYPED_CHILDREN(DataReference,XMLENC_NS,false); + PROC_TYPED_CHILDREN(KeyReference,XMLENC_NS,false); AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root); } }; @@ -578,10 +580,10 @@ namespace xmlencryption { } void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { - PROC_TYPED_CHILD(EncryptionMethod,XMLConstants::XMLENC_NS,false); - PROC_TYPED_FOREIGN_CHILD(KeyInfo,xmlsignature,XMLConstants::XMLSIG_NS,false); - PROC_TYPED_CHILD(CipherData,XMLConstants::XMLENC_NS,false); - PROC_TYPED_CHILD(EncryptionProperties,XMLConstants::XMLENC_NS,false); + PROC_TYPED_CHILD(EncryptionMethod,XMLENC_NS,false); + PROC_TYPED_FOREIGN_CHILD(KeyInfo,xmlsignature,XMLSIG_NS,false); + PROC_TYPED_CHILD(CipherData,XMLENC_NS,false); + PROC_TYPED_CHILD(EncryptionProperties,XMLENC_NS,false); AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root); } @@ -653,8 +655,8 @@ namespace xmlencryption { } void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { - PROC_TYPED_CHILD(ReferenceList,XMLConstants::XMLENC_NS,false); - PROC_TYPED_CHILD(CarriedKeyName,XMLConstants::XMLENC_NS,false); + PROC_TYPED_CHILD(ReferenceList,XMLENC_NS,false); + PROC_TYPED_CHILD(CarriedKeyName,XMLENC_NS,false); EncryptedTypeImpl::processChildElement(childXMLObject,root); } diff --git a/xmltooling/encryption/impl/EncryptionSchemaValidators.cpp b/xmltooling/encryption/impl/EncryptionSchemaValidators.cpp index 1efc93b..5bf1218 100644 --- a/xmltooling/encryption/impl/EncryptionSchemaValidators.cpp +++ b/xmltooling/encryption/impl/EncryptionSchemaValidators.cpp @@ -28,6 +28,7 @@ using namespace xmlencryption; using namespace xmltooling; using namespace std; +using xmlconstants::XMLENC_NS; namespace xmlencryption { @@ -56,7 +57,7 @@ namespace xmlencryption { public: void operator()(const XMLObject* xmlObject) const { const XMLCh* ns=xmlObject->getElementQName().getNamespaceURI(); - if (XMLString::equals(ns,XMLConstants::XMLENC_NS) || !ns || !*ns) { + if (XMLString::equals(ns,XMLENC_NS) || !ns || !*ns) { throw ValidationException( "Object contains an illegal extension child element ($1).", params(1,xmlObject->getElementQName().toString().c_str()) @@ -122,25 +123,25 @@ namespace xmlencryption { void xmlencryption::registerEncryptionClasses() { QName q; - REGISTER_ELEMENT(XMLConstants::XMLENC_NS,CarriedKeyName); - REGISTER_ELEMENT(XMLConstants::XMLENC_NS,CipherData); - REGISTER_ELEMENT(XMLConstants::XMLENC_NS,CipherReference); - REGISTER_ELEMENT(XMLConstants::XMLENC_NS,CipherValue); - REGISTER_ELEMENT(XMLConstants::XMLENC_NS,DataReference); - REGISTER_ELEMENT(XMLConstants::XMLENC_NS,EncryptedData); - REGISTER_ELEMENT(XMLConstants::XMLENC_NS,EncryptedKey); - REGISTER_ELEMENT(XMLConstants::XMLENC_NS,EncryptionMethod); - REGISTER_ELEMENT(XMLConstants::XMLENC_NS,EncryptionProperties); - REGISTER_ELEMENT(XMLConstants::XMLENC_NS,EncryptionProperty); - REGISTER_ELEMENT(XMLConstants::XMLENC_NS,KeyReference); - REGISTER_ELEMENT(XMLConstants::XMLENC_NS,KeySize); - REGISTER_ELEMENT(XMLConstants::XMLENC_NS,OAEPparams); - REGISTER_ELEMENT(XMLConstants::XMLENC_NS,ReferenceList); - REGISTER_ELEMENT(XMLConstants::XMLENC_NS,Transforms); - REGISTER_TYPE(XMLConstants::XMLENC_NS,CipherData); - REGISTER_TYPE(XMLConstants::XMLENC_NS,CipherReference); - REGISTER_TYPE(XMLConstants::XMLENC_NS,EncryptionMethod); - REGISTER_TYPE(XMLConstants::XMLENC_NS,EncryptionProperties); - REGISTER_TYPE(XMLConstants::XMLENC_NS,EncryptionProperty); - REGISTER_TYPE(XMLConstants::XMLENC_NS,Transforms); + REGISTER_ELEMENT(XMLENC_NS,CarriedKeyName); + REGISTER_ELEMENT(XMLENC_NS,CipherData); + REGISTER_ELEMENT(XMLENC_NS,CipherReference); + REGISTER_ELEMENT(XMLENC_NS,CipherValue); + REGISTER_ELEMENT(XMLENC_NS,DataReference); + REGISTER_ELEMENT(XMLENC_NS,EncryptedData); + REGISTER_ELEMENT(XMLENC_NS,EncryptedKey); + REGISTER_ELEMENT(XMLENC_NS,EncryptionMethod); + REGISTER_ELEMENT(XMLENC_NS,EncryptionProperties); + REGISTER_ELEMENT(XMLENC_NS,EncryptionProperty); + REGISTER_ELEMENT(XMLENC_NS,KeyReference); + REGISTER_ELEMENT(XMLENC_NS,KeySize); + REGISTER_ELEMENT(XMLENC_NS,OAEPparams); + REGISTER_ELEMENT(XMLENC_NS,ReferenceList); + REGISTER_ELEMENT(XMLENC_NS,Transforms); + REGISTER_TYPE(XMLENC_NS,CipherData); + REGISTER_TYPE(XMLENC_NS,CipherReference); + REGISTER_TYPE(XMLENC_NS,EncryptionMethod); + REGISTER_TYPE(XMLENC_NS,EncryptionProperties); + REGISTER_TYPE(XMLENC_NS,EncryptionProperty); + REGISTER_TYPE(XMLENC_NS,Transforms); } diff --git a/xmltooling/exceptions.cpp b/xmltooling/exceptions.cpp index 00e9bec..cdf9df0 100644 --- a/xmltooling/exceptions.cpp +++ b/xmltooling/exceptions.cpp @@ -32,6 +32,7 @@ using namespace xmltooling; using namespace std; +using xmlconstants::XMLTOOLING_NS; params::params(int count,...) { @@ -240,7 +241,7 @@ XMLToolingException* XMLToolingException::fromStream(std::istream& in) // Check root element. const DOMElement* root=doc->getDocumentElement(); - if (!XMLHelper::isNodeNamed(root,XMLConstants::XMLTOOLING_NS,exception)) { + if (!XMLHelper::isNodeNamed(root,XMLTOOLING_NS,exception)) { doc->release(); throw XMLToolingException("Invalid root element on serialized exception."); } @@ -248,20 +249,20 @@ XMLToolingException* XMLToolingException::fromStream(std::istream& in) auto_ptr_char classname(root->getAttributeNS(NULL,type)); auto_ptr excep(XMLToolingException::getInstance(classname.get())); - DOMElement* child=XMLHelper::getFirstChildElement(root,XMLConstants::XMLTOOLING_NS,message); + DOMElement* child=XMLHelper::getFirstChildElement(root,XMLTOOLING_NS,message); if (child && child->hasChildNodes()) { auto_ptr_char m(child->getFirstChild()->getNodeValue()); excep->setMessage(m.get()); } - child=XMLHelper::getFirstChildElement(root,XMLConstants::XMLTOOLING_NS,param); + child=XMLHelper::getFirstChildElement(root,XMLTOOLING_NS,param); while (child && child->hasChildNodes()) { auto_ptr_char n(child->getAttributeNS(NULL,name)); char* v=toUTF8(child->getFirstChild()->getNodeValue()); if (n.get() && v) excep->addProperty(n.get(), v); XMLString::release(&v); - child=XMLHelper::getNextSiblingElement(root,XMLConstants::XMLTOOLING_NS,param); + child=XMLHelper::getNextSiblingElement(root,XMLTOOLING_NS,param); } doc->release(); diff --git a/xmltooling/io/AbstractXMLObjectMarshaller.cpp b/xmltooling/io/AbstractXMLObjectMarshaller.cpp index d2cd392..4822fbe 100644 --- a/xmltooling/io/AbstractXMLObjectMarshaller.cpp +++ b/xmltooling/io/AbstractXMLObjectMarshaller.cpp @@ -38,6 +38,7 @@ #ifndef XMLTOOLING_NO_XMLSEC using namespace xmlsignature; #endif +using namespace xmlconstants; using namespace xmltooling; using namespace log4cpp; using namespace std; @@ -175,7 +176,7 @@ void AbstractXMLObjectMarshaller::marshallInto( if (m_schemaLocation) { static const XMLCh schemaLocation[]= UNICODE_LITERAL_14(s,c,h,e,m,a,L,o,c,a,t,i,o,n); if (targetElement->getParentNode()==NULL || targetElement->getParentNode()->getNodeType()==DOMNode::DOCUMENT_NODE) - targetElement->setAttributeNS(XMLConstants::XSI_NS,schemaLocation,m_schemaLocation); + targetElement->setAttributeNS(XSI_NS,schemaLocation,m_schemaLocation); } marshallElementType(targetElement); @@ -215,12 +216,12 @@ void AbstractXMLObjectMarshaller::marshallElementType(DOMElement* domElement) co XMLString::catString(xsivalue,colon); XMLString::catString(xsivalue,typeLocalName); } - domElement->setAttributeNS(XMLConstants::XSI_NS, xsitype, xsivalue); + domElement->setAttributeNS(XSI_NS, xsitype, xsivalue); if (xsivalue != typeLocalName) XMLString::release(&xsivalue); XT_log.debug("Adding XSI namespace to list of namespaces used by XMLObject"); - addNamespace(Namespace(XMLConstants::XSI_NS, XMLConstants::XSI_PREFIX)); + addNamespace(Namespace(XSI_NS, XSI_PREFIX)); } } @@ -238,16 +239,16 @@ public: } if (prefix && *prefix) { - XMLCh* xmlns=new XMLCh[XMLString::stringLen(XMLConstants::XMLNS_PREFIX) + XMLString::stringLen(prefix) + 2*sizeof(XMLCh)]; + XMLCh* xmlns=new XMLCh[XMLString::stringLen(XMLNS_PREFIX) + XMLString::stringLen(prefix) + 2*sizeof(XMLCh)]; *xmlns=chNull; - XMLString::catString(xmlns,XMLConstants::XMLNS_PREFIX); + XMLString::catString(xmlns,XMLNS_PREFIX); static const XMLCh colon[] = {chColon, chNull}; XMLString::catString(xmlns,colon); XMLString::catString(xmlns,prefix); - domElement->setAttributeNS(XMLConstants::XMLNS_NS, xmlns, uri); + domElement->setAttributeNS(XMLNS_NS, xmlns, uri); } else { - domElement->setAttributeNS(XMLConstants::XMLNS_NS, XMLConstants::XMLNS_PREFIX, uri); + domElement->setAttributeNS(XMLNS_NS, XMLNS_PREFIX, uri); } } @@ -269,10 +270,10 @@ public: if (childNode->getNodeType() != DOMNode::ATTRIBUTE_NODE) // not an attribute? continue; attribute = static_cast(childNode); - if (!XMLString::equals(attribute->getNamespaceURI(),XMLConstants::XMLNS_NS)) + if (!XMLString::equals(attribute->getNamespaceURI(),XMLNS_NS)) continue; // not a namespace declaration // Local name should be the prefix and the value would be the URI, except for the default namespace. - if ((!prefix || !*prefix) && XMLString::equals(attribute->getLocalName(),XMLConstants::XMLNS_PREFIX)) + if ((!prefix || !*prefix) && XMLString::equals(attribute->getLocalName(),XMLNS_PREFIX)) return attribute->getNodeValue(); else if (XMLString::equals(prefix,attribute->getLocalName())) return attribute->getNodeValue(); diff --git a/xmltooling/io/AbstractXMLObjectUnmarshaller.cpp b/xmltooling/io/AbstractXMLObjectUnmarshaller.cpp index 0ba988a..5470c3a 100644 --- a/xmltooling/io/AbstractXMLObjectUnmarshaller.cpp +++ b/xmltooling/io/AbstractXMLObjectUnmarshaller.cpp @@ -31,6 +31,7 @@ #include #include +using namespace xmlconstants; using namespace xmltooling; using namespace log4cpp; using namespace std; @@ -97,8 +98,8 @@ void AbstractXMLObjectUnmarshaller::unmarshallAttributes(const DOMElement* domEl attribute = static_cast(childNode); const XMLCh* nsuri=attribute->getNamespaceURI(); - if (XMLString::equals(nsuri,XMLConstants::XMLNS_NS)) { - if (XMLString::equals(attribute->getLocalName(),XMLConstants::XMLNS_PREFIX)) { + if (XMLString::equals(nsuri,XMLNS_NS)) { + if (XMLString::equals(attribute->getLocalName(),XMLNS_PREFIX)) { XT_log.debug("found default namespace declaration, adding it to the list of namespaces on the XMLObject"); addNamespace(Namespace(attribute->getValue(), NULL, true)); continue; @@ -109,7 +110,7 @@ void AbstractXMLObjectUnmarshaller::unmarshallAttributes(const DOMElement* domEl continue; } } - else if (XMLString::equals(nsuri,XMLConstants::XSI_NS)) { + else if (XMLString::equals(nsuri,XSI_NS)) { static const XMLCh type[]= UNICODE_LITERAL_4(t,y,p,e); static const XMLCh schemaLocation[]= UNICODE_LITERAL_14(s,c,h,e,m,a,L,o,c,a,t,i,o,n); if (XMLString::equals(attribute->getLocalName(),type)) { @@ -124,7 +125,7 @@ void AbstractXMLObjectUnmarshaller::unmarshallAttributes(const DOMElement* domEl continue; } } - else if (nsuri && !XMLString::equals(nsuri,XMLConstants::XML_NS)) { + else if (nsuri && !XMLString::equals(nsuri,XML_NS)) { XT_log.debug("found namespace-qualified attribute, adding prefix to the list of namespaces on the XMLObject"); addNamespace(Namespace(nsuri, attribute->getPrefix())); } diff --git a/xmltooling/signature/KeyInfo.h b/xmltooling/signature/KeyInfo.h index eee9920..8dacd00 100644 --- a/xmltooling/signature/KeyInfo.h +++ b/xmltooling/signature/KeyInfo.h @@ -29,7 +29,7 @@ #include #define DECL_XMLSIGOBJECTBUILDER(cname) \ - DECL_XMLOBJECTBUILDER(XMLTOOL_API,cname,xmltooling::XMLConstants::XMLSIG_NS,xmltooling::XMLConstants::XMLSIG_PREFIX) + DECL_XMLOBJECTBUILDER(XMLTOOL_API,cname,xmlconstants::XMLSIG_NS,xmlconstants::XMLSIG_PREFIX) namespace xmlsignature { diff --git a/xmltooling/signature/Signature.h b/xmltooling/signature/Signature.h index 71314ac..33fc083 100644 --- a/xmltooling/signature/Signature.h +++ b/xmltooling/signature/Signature.h @@ -156,7 +156,7 @@ namespace xmlsignature { static Signature* buildSignature() { const SignatureBuilder* b = dynamic_cast( xmltooling::XMLObjectBuilder::getBuilder( - xmltooling::QName(xmltooling::XMLConstants::XMLSIG_NS,Signature::LOCAL_NAME) + xmltooling::QName(xmlconstants::XMLSIG_NS,Signature::LOCAL_NAME) ) ); if (b) diff --git a/xmltooling/signature/impl/InlineKeyResolver.cpp b/xmltooling/signature/impl/InlineKeyResolver.cpp index 9f06f64..686b170 100644 --- a/xmltooling/signature/impl/InlineKeyResolver.cpp +++ b/xmltooling/signature/impl/InlineKeyResolver.cpp @@ -98,7 +98,7 @@ static const XMLCh cache[] = UNICODE_LITERAL_5(c,a,c,h,e); InlineKeyResolver::InlineKeyResolver(const DOMElement* e) : m_lock(NULL) { const XMLCh* flag = e ? e->getAttributeNS(NULL,cache) : NULL; - if (flag && XMLString::equals(flag,XMLConstants::XML_TRUE) || XMLString::equals(flag,XMLConstants::XML_ONE)) + if (flag && XMLString::equals(flag,xmlconstants::XML_TRUE) || XMLString::equals(flag,xmlconstants::XML_ONE)) m_lock=RWLock::create(); } diff --git a/xmltooling/signature/impl/KeyInfoImpl.cpp b/xmltooling/signature/impl/KeyInfoImpl.cpp index 885af02..62d033f 100644 --- a/xmltooling/signature/impl/KeyInfoImpl.cpp +++ b/xmltooling/signature/impl/KeyInfoImpl.cpp @@ -36,6 +36,7 @@ using namespace xmlsignature; using namespace xmltooling; using namespace std; +using xmlconstants::XMLSIG_NS; #if defined (_MSC_VER) #pragma warning( push ) @@ -118,13 +119,13 @@ namespace xmlsignature { protected: void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { - PROC_TYPED_CHILD(P,XMLConstants::XMLSIG_NS,false); - PROC_TYPED_CHILD(Q,XMLConstants::XMLSIG_NS,false); - PROC_TYPED_CHILD(G,XMLConstants::XMLSIG_NS,false); - PROC_TYPED_CHILD(Y,XMLConstants::XMLSIG_NS,false); - PROC_TYPED_CHILD(J,XMLConstants::XMLSIG_NS,false); - PROC_TYPED_CHILD(Seed,XMLConstants::XMLSIG_NS,false); - PROC_TYPED_CHILD(PgenCounter,XMLConstants::XMLSIG_NS,false); + PROC_TYPED_CHILD(P,XMLSIG_NS,false); + PROC_TYPED_CHILD(Q,XMLSIG_NS,false); + PROC_TYPED_CHILD(G,XMLSIG_NS,false); + PROC_TYPED_CHILD(Y,XMLSIG_NS,false); + PROC_TYPED_CHILD(J,XMLSIG_NS,false); + PROC_TYPED_CHILD(Seed,XMLSIG_NS,false); + PROC_TYPED_CHILD(PgenCounter,XMLSIG_NS,false); AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root); } }; @@ -168,8 +169,8 @@ namespace xmlsignature { protected: void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { - PROC_TYPED_CHILD(Modulus,XMLConstants::XMLSIG_NS,false); - PROC_TYPED_CHILD(Exponent,XMLConstants::XMLSIG_NS,false); + PROC_TYPED_CHILD(Modulus,XMLSIG_NS,false); + PROC_TYPED_CHILD(Exponent,XMLSIG_NS,false); AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root); } }; @@ -220,12 +221,12 @@ namespace xmlsignature { protected: void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { - PROC_TYPED_CHILD(DSAKeyValue,XMLConstants::XMLSIG_NS,false); - PROC_TYPED_CHILD(RSAKeyValue,XMLConstants::XMLSIG_NS,false); + PROC_TYPED_CHILD(DSAKeyValue,XMLSIG_NS,false); + PROC_TYPED_CHILD(RSAKeyValue,XMLSIG_NS,false); // Unknown child. const XMLCh* nsURI=root->getNamespaceURI(); - if (!XMLString::equals(nsURI,XMLConstants::XMLSIG_NS) && nsURI && *nsURI) { + if (!XMLString::equals(nsURI,XMLSIG_NS) && nsURI && *nsURI) { setOtherKeyValue(childXMLObject); return; } @@ -274,11 +275,11 @@ namespace xmlsignature { } void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { - PROC_TYPED_CHILDREN(XPath,XMLConstants::XMLSIG_NS,false); + PROC_TYPED_CHILDREN(XPath,XMLSIG_NS,false); // Unknown child. const XMLCh* nsURI=root->getNamespaceURI(); - if (!XMLString::equals(nsURI,XMLConstants::XMLSIG_NS) && nsURI && *nsURI) { + if (!XMLString::equals(nsURI,XMLSIG_NS) && nsURI && *nsURI) { getXMLObjects().push_back(childXMLObject); return; } @@ -320,7 +321,7 @@ namespace xmlsignature { protected: void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { - PROC_TYPED_CHILDREN(Transform,XMLConstants::XMLSIG_NS,false); + PROC_TYPED_CHILDREN(Transform,XMLSIG_NS,false); AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root); } }; @@ -370,7 +371,7 @@ namespace xmlsignature { } void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { - PROC_TYPED_CHILD(Transforms,XMLConstants::XMLSIG_NS,false); + PROC_TYPED_CHILD(Transforms,XMLSIG_NS,false); AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root); } @@ -420,8 +421,8 @@ namespace xmlsignature { protected: void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { - PROC_TYPED_CHILD(X509IssuerName,XMLConstants::XMLSIG_NS,false); - PROC_TYPED_CHILD(X509SerialNumber,XMLConstants::XMLSIG_NS,false); + PROC_TYPED_CHILD(X509IssuerName,XMLSIG_NS,false); + PROC_TYPED_CHILD(X509SerialNumber,XMLSIG_NS,false); AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root); } }; @@ -488,15 +489,15 @@ namespace xmlsignature { protected: void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { - PROC_TYPED_CHILDREN(X509IssuerSerial,XMLConstants::XMLSIG_NS,false); - PROC_TYPED_CHILDREN(X509SKI,XMLConstants::XMLSIG_NS,false); - PROC_TYPED_CHILDREN(X509SubjectName,XMLConstants::XMLSIG_NS,false); - PROC_TYPED_CHILDREN(X509Certificate,XMLConstants::XMLSIG_NS,false); - PROC_TYPED_CHILDREN(X509CRL,XMLConstants::XMLSIG_NS,false); + PROC_TYPED_CHILDREN(X509IssuerSerial,XMLSIG_NS,false); + PROC_TYPED_CHILDREN(X509SKI,XMLSIG_NS,false); + PROC_TYPED_CHILDREN(X509SubjectName,XMLSIG_NS,false); + PROC_TYPED_CHILDREN(X509Certificate,XMLSIG_NS,false); + PROC_TYPED_CHILDREN(X509CRL,XMLSIG_NS,false); // Unknown child. const XMLCh* nsURI=root->getNamespaceURI(); - if (!XMLString::equals(nsURI,XMLConstants::XMLSIG_NS) && nsURI && *nsURI) { + if (!XMLString::equals(nsURI,XMLSIG_NS) && nsURI && *nsURI) { getOtherX509Datas().push_back(childXMLObject); return; } @@ -544,7 +545,7 @@ namespace xmlsignature { protected: void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { - if (XMLHelper::isNodeNamed(root,XMLConstants::XMLSIG_NS,SPKISexp::LOCAL_NAME)) { + if (XMLHelper::isNodeNamed(root,XMLSIG_NS,SPKISexp::LOCAL_NAME)) { SPKISexp* typesafe=dynamic_cast(childXMLObject); if (typesafe) { getSPKISexps().push_back(make_pair(typesafe,(XMLObject*)NULL)); @@ -554,7 +555,7 @@ namespace xmlsignature { // Unknown child (has to be paired with the last SPKISexp processed. const XMLCh* nsURI=root->getNamespaceURI(); - if (!XMLString::equals(nsURI,XMLConstants::XMLSIG_NS) && nsURI && *nsURI) { + if (!XMLString::equals(nsURI,XMLSIG_NS) && nsURI && *nsURI) { // Update second half of pair in vector, and in master list. if (!m_SPKISexps.empty() && m_SPKISexps.back().second==NULL) { m_SPKISexps.back().second=childXMLObject; @@ -615,12 +616,12 @@ namespace xmlsignature { protected: void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { - PROC_TYPED_CHILD(PGPKeyID,XMLConstants::XMLSIG_NS,false); - PROC_TYPED_CHILD(PGPKeyPacket,XMLConstants::XMLSIG_NS,false); + PROC_TYPED_CHILD(PGPKeyID,XMLSIG_NS,false); + PROC_TYPED_CHILD(PGPKeyPacket,XMLSIG_NS,false); // Unknown child. const XMLCh* nsURI=root->getNamespaceURI(); - if (!XMLString::equals(nsURI,XMLConstants::XMLSIG_NS) && nsURI && *nsURI) { + if (!XMLString::equals(nsURI,XMLSIG_NS) && nsURI && *nsURI) { getPGPDataExtensions().push_back(childXMLObject); return; } @@ -714,17 +715,17 @@ namespace xmlsignature { } void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { - PROC_TYPED_CHILDREN(X509Data,XMLConstants::XMLSIG_NS,false); - PROC_TYPED_CHILDREN(KeyName,XMLConstants::XMLSIG_NS,false); - PROC_TYPED_CHILDREN(KeyValue,XMLConstants::XMLSIG_NS,false); - PROC_TYPED_CHILDREN(RetrievalMethod,XMLConstants::XMLSIG_NS,false); - PROC_TYPED_CHILDREN(MgmtData,XMLConstants::XMLSIG_NS,false); - PROC_TYPED_CHILDREN(SPKIData,XMLConstants::XMLSIG_NS,false); - PROC_TYPED_CHILDREN(PGPData,XMLConstants::XMLSIG_NS,false); + PROC_TYPED_CHILDREN(X509Data,XMLSIG_NS,false); + PROC_TYPED_CHILDREN(KeyName,XMLSIG_NS,false); + PROC_TYPED_CHILDREN(KeyValue,XMLSIG_NS,false); + PROC_TYPED_CHILDREN(RetrievalMethod,XMLSIG_NS,false); + PROC_TYPED_CHILDREN(MgmtData,XMLSIG_NS,false); + PROC_TYPED_CHILDREN(SPKIData,XMLSIG_NS,false); + PROC_TYPED_CHILDREN(PGPData,XMLSIG_NS,false); // Unknown child. const XMLCh* nsURI=root->getNamespaceURI(); - if (!XMLString::equals(nsURI,XMLConstants::XMLSIG_NS) && nsURI && *nsURI) { + if (!XMLString::equals(nsURI,XMLSIG_NS) && nsURI && *nsURI) { getOthers().push_back(childXMLObject); return; } diff --git a/xmltooling/signature/impl/KeyInfoSchemaValidators.cpp b/xmltooling/signature/impl/KeyInfoSchemaValidators.cpp index 44acffd..e227082 100644 --- a/xmltooling/signature/impl/KeyInfoSchemaValidators.cpp +++ b/xmltooling/signature/impl/KeyInfoSchemaValidators.cpp @@ -28,6 +28,7 @@ using namespace xmlsignature; using namespace xmltooling; using namespace std; +using xmlconstants::XMLSIG_NS; namespace xmlsignature { @@ -89,7 +90,7 @@ namespace xmlsignature { public: void operator()(const XMLObject* xmlObject) const { const XMLCh* ns=xmlObject->getElementQName().getNamespaceURI(); - if (XMLString::equals(ns,XMLConstants::XMLSIG_NS) || !ns || !*ns) { + if (XMLString::equals(ns,XMLSIG_NS) || !ns || !*ns) { throw ValidationException( "Object contains an illegal extension child element ($1).", params(1,xmlObject->getElementQName().toString().c_str()) @@ -135,47 +136,47 @@ namespace xmlsignature { void xmlsignature::registerKeyInfoClasses() { QName q; - REGISTER_ELEMENT(XMLConstants::XMLSIG_NS,KeyInfo); - REGISTER_ELEMENT(XMLConstants::XMLSIG_NS,KeyName); - REGISTER_ELEMENT(XMLConstants::XMLSIG_NS,KeyValue); - REGISTER_ELEMENT(XMLConstants::XMLSIG_NS,MgmtData); - REGISTER_ELEMENT(XMLConstants::XMLSIG_NS,DSAKeyValue); - REGISTER_ELEMENT(XMLConstants::XMLSIG_NS,RSAKeyValue); - REGISTER_ELEMENT(XMLConstants::XMLSIG_NS,Exponent); - REGISTER_ELEMENT(XMLConstants::XMLSIG_NS,Modulus); - REGISTER_ELEMENT(XMLConstants::XMLSIG_NS,P); - REGISTER_ELEMENT(XMLConstants::XMLSIG_NS,Q); - REGISTER_ELEMENT(XMLConstants::XMLSIG_NS,G); - REGISTER_ELEMENT(XMLConstants::XMLSIG_NS,Y); - REGISTER_ELEMENT(XMLConstants::XMLSIG_NS,J); - REGISTER_ELEMENT(XMLConstants::XMLSIG_NS,Seed); - REGISTER_ELEMENT(XMLConstants::XMLSIG_NS,PgenCounter); - REGISTER_ELEMENT(XMLConstants::XMLSIG_NS,XPath); - REGISTER_ELEMENT(XMLConstants::XMLSIG_NS,Transform); - REGISTER_ELEMENT(XMLConstants::XMLSIG_NS,Transforms); - REGISTER_ELEMENT(XMLConstants::XMLSIG_NS,RetrievalMethod); - REGISTER_ELEMENT(XMLConstants::XMLSIG_NS,X509IssuerSerial); - REGISTER_ELEMENT(XMLConstants::XMLSIG_NS,X509IssuerName); - REGISTER_ELEMENT(XMLConstants::XMLSIG_NS,X509SerialNumber); - REGISTER_ELEMENT(XMLConstants::XMLSIG_NS,X509SKI); - REGISTER_ELEMENT(XMLConstants::XMLSIG_NS,X509SubjectName); - REGISTER_ELEMENT(XMLConstants::XMLSIG_NS,X509Certificate); - REGISTER_ELEMENT(XMLConstants::XMLSIG_NS,X509CRL); - REGISTER_ELEMENT(XMLConstants::XMLSIG_NS,X509Data); - REGISTER_ELEMENT(XMLConstants::XMLSIG_NS,SPKISexp); - REGISTER_ELEMENT(XMLConstants::XMLSIG_NS,SPKIData); - REGISTER_ELEMENT(XMLConstants::XMLSIG_NS,PGPKeyID); - REGISTER_ELEMENT(XMLConstants::XMLSIG_NS,PGPKeyPacket); - REGISTER_ELEMENT(XMLConstants::XMLSIG_NS,PGPData); - REGISTER_TYPE(XMLConstants::XMLSIG_NS,KeyInfo); - REGISTER_TYPE(XMLConstants::XMLSIG_NS,KeyValue); - REGISTER_TYPE(XMLConstants::XMLSIG_NS,DSAKeyValue); - REGISTER_TYPE(XMLConstants::XMLSIG_NS,RSAKeyValue); - REGISTER_TYPE(XMLConstants::XMLSIG_NS,Transform); - REGISTER_TYPE(XMLConstants::XMLSIG_NS,Transforms); - REGISTER_TYPE(XMLConstants::XMLSIG_NS,RetrievalMethod); - REGISTER_TYPE(XMLConstants::XMLSIG_NS,X509IssuerSerial); - REGISTER_TYPE(XMLConstants::XMLSIG_NS,X509Data); - REGISTER_TYPE(XMLConstants::XMLSIG_NS,SPKIData); - REGISTER_TYPE(XMLConstants::XMLSIG_NS,PGPData); + REGISTER_ELEMENT(XMLSIG_NS,KeyInfo); + REGISTER_ELEMENT(XMLSIG_NS,KeyName); + REGISTER_ELEMENT(XMLSIG_NS,KeyValue); + REGISTER_ELEMENT(XMLSIG_NS,MgmtData); + REGISTER_ELEMENT(XMLSIG_NS,DSAKeyValue); + REGISTER_ELEMENT(XMLSIG_NS,RSAKeyValue); + REGISTER_ELEMENT(XMLSIG_NS,Exponent); + REGISTER_ELEMENT(XMLSIG_NS,Modulus); + REGISTER_ELEMENT(XMLSIG_NS,P); + REGISTER_ELEMENT(XMLSIG_NS,Q); + REGISTER_ELEMENT(XMLSIG_NS,G); + REGISTER_ELEMENT(XMLSIG_NS,Y); + REGISTER_ELEMENT(XMLSIG_NS,J); + REGISTER_ELEMENT(XMLSIG_NS,Seed); + REGISTER_ELEMENT(XMLSIG_NS,PgenCounter); + REGISTER_ELEMENT(XMLSIG_NS,XPath); + REGISTER_ELEMENT(XMLSIG_NS,Transform); + REGISTER_ELEMENT(XMLSIG_NS,Transforms); + REGISTER_ELEMENT(XMLSIG_NS,RetrievalMethod); + REGISTER_ELEMENT(XMLSIG_NS,X509IssuerSerial); + REGISTER_ELEMENT(XMLSIG_NS,X509IssuerName); + REGISTER_ELEMENT(XMLSIG_NS,X509SerialNumber); + REGISTER_ELEMENT(XMLSIG_NS,X509SKI); + REGISTER_ELEMENT(XMLSIG_NS,X509SubjectName); + REGISTER_ELEMENT(XMLSIG_NS,X509Certificate); + REGISTER_ELEMENT(XMLSIG_NS,X509CRL); + REGISTER_ELEMENT(XMLSIG_NS,X509Data); + REGISTER_ELEMENT(XMLSIG_NS,SPKISexp); + REGISTER_ELEMENT(XMLSIG_NS,SPKIData); + REGISTER_ELEMENT(XMLSIG_NS,PGPKeyID); + REGISTER_ELEMENT(XMLSIG_NS,PGPKeyPacket); + REGISTER_ELEMENT(XMLSIG_NS,PGPData); + REGISTER_TYPE(XMLSIG_NS,KeyInfo); + REGISTER_TYPE(XMLSIG_NS,KeyValue); + REGISTER_TYPE(XMLSIG_NS,DSAKeyValue); + REGISTER_TYPE(XMLSIG_NS,RSAKeyValue); + REGISTER_TYPE(XMLSIG_NS,Transform); + REGISTER_TYPE(XMLSIG_NS,Transforms); + REGISTER_TYPE(XMLSIG_NS,RetrievalMethod); + REGISTER_TYPE(XMLSIG_NS,X509IssuerSerial); + REGISTER_TYPE(XMLSIG_NS,X509Data); + REGISTER_TYPE(XMLSIG_NS,SPKIData); + REGISTER_TYPE(XMLSIG_NS,PGPData); } diff --git a/xmltooling/signature/impl/XMLSecSignatureImpl.cpp b/xmltooling/signature/impl/XMLSecSignatureImpl.cpp index 4168149..30bc1dc 100644 --- a/xmltooling/signature/impl/XMLSecSignatureImpl.cpp +++ b/xmltooling/signature/impl/XMLSecSignatureImpl.cpp @@ -42,6 +42,8 @@ using namespace xmlsignature; using namespace xmltooling; using namespace log4cpp; using namespace std; +using xmlconstants::XMLSIG_NS; +using xmlconstants::XMLSIG_PREFIX; #if defined (_MSC_VER) #pragma warning( push ) @@ -53,7 +55,7 @@ namespace xmlsignature { class XMLTOOL_DLLLOCAL XMLSecSignatureImpl : public UnknownElementImpl, public virtual Signature { public: - XMLSecSignatureImpl() : UnknownElementImpl(XMLConstants::XMLSIG_NS, Signature::LOCAL_NAME, XMLConstants::XMLSIG_PREFIX), + XMLSecSignatureImpl() : UnknownElementImpl(XMLSIG_NS, Signature::LOCAL_NAME, XMLSIG_PREFIX), m_signature(NULL), m_c14n(NULL), m_sm(NULL), m_key(NULL), m_keyInfo(NULL), m_reference(NULL) {} virtual ~XMLSecSignatureImpl(); @@ -234,7 +236,7 @@ DOMElement* XMLSecSignatureImpl::marshall(DOMDocument* document, const vectornewSignature(); - m_signature->setDSIGNSPrefix(XMLConstants::XMLSIG_PREFIX); + m_signature->setDSIGNSPrefix(XMLSIG_PREFIX); cachedDOM=m_signature->createBlankSignature(document, getCanonicalizationMethod(), getSignatureAlgorithm()); } else { @@ -325,7 +327,7 @@ DOMElement* XMLSecSignatureImpl::marshall(DOMElement* parentElement, const vecto // Fresh signature, so we just create an empty one. log.debug("creating empty Signature element"); m_signature=XMLToolingInternalConfig::getInternalConfig().m_xsecProvider->newSignature(); - m_signature->setDSIGNSPrefix(XMLConstants::XMLSIG_PREFIX); + m_signature->setDSIGNSPrefix(XMLSIG_PREFIX); cachedDOM=m_signature->createBlankSignature( parentElement->getOwnerDocument(), getCanonicalizationMethod(), getSignatureAlgorithm() ); @@ -396,7 +398,7 @@ Signature* SignatureBuilder::buildObject( const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType ) const { - if (!XMLString::equals(nsURI,XMLConstants::XMLSIG_NS) || !XMLString::equals(localName,Signature::LOCAL_NAME)) + if (!XMLString::equals(nsURI,XMLSIG_NS) || !XMLString::equals(localName,Signature::LOCAL_NAME)) throw XMLObjectException("XMLSecSignatureBuilder requires standard Signature element name."); return buildObject(); } diff --git a/xmltooling/soap/SOAP.h b/xmltooling/soap/SOAP.h index 9f74f4e..5f90c43 100644 --- a/xmltooling/soap/SOAP.h +++ b/xmltooling/soap/SOAP.h @@ -30,7 +30,7 @@ #include #define DECL_SOAP11OBJECTBUILDER(cname) \ - DECL_XMLOBJECTBUILDER(XMLTOOL_API,cname,xmltooling::XMLConstants::SOAP11ENV_NS,xmltooling::XMLConstants::SOAP11ENV_PREFIX) + DECL_XMLOBJECTBUILDER(XMLTOOL_API,cname,xmlconstants::SOAP11ENV_NS,xmlconstants::SOAP11ENV_PREFIX) /** * @namespace soap11 diff --git a/xmltooling/soap/impl/SOAPImpl.cpp b/xmltooling/soap/impl/SOAPImpl.cpp index 53d743f..8f02f8a 100644 --- a/xmltooling/soap/impl/SOAPImpl.cpp +++ b/xmltooling/soap/impl/SOAPImpl.cpp @@ -35,6 +35,7 @@ using namespace soap11; using namespace xmltooling; using namespace std; +using xmlconstants::SOAP11ENV_NS; #if defined (_MSC_VER) #pragma warning( push ) @@ -183,10 +184,10 @@ namespace { protected: void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { - PROC_TYPED_CHILD(Faultcode,XMLConstants::SOAP11ENV_NS,false); - PROC_TYPED_CHILD(Faultstring,XMLConstants::SOAP11ENV_NS,false); - PROC_TYPED_CHILD(Faultactor,XMLConstants::SOAP11ENV_NS,false); - PROC_TYPED_CHILD(Detail,XMLConstants::SOAP11ENV_NS,false); + PROC_TYPED_CHILD(Faultcode,SOAP11ENV_NS,false); + PROC_TYPED_CHILD(Faultstring,SOAP11ENV_NS,false); + PROC_TYPED_CHILD(Faultactor,SOAP11ENV_NS,false); + PROC_TYPED_CHILD(Detail,SOAP11ENV_NS,false); AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root); } }; @@ -229,7 +230,7 @@ namespace { IMPL_STRING_ATTRIB(EncodingStyle); void setAttribute(QName& qualifiedName, const XMLCh* value) { - if (qualifiedName.hasNamespaceURI() && XMLString::equals(qualifiedName.getNamespaceURI(),XMLConstants::SOAP11ENV_NS)) { + if (qualifiedName.hasNamespaceURI() && XMLString::equals(qualifiedName.getNamespaceURI(),SOAP11ENV_NS)) { if (XMLString::equals(qualifiedName.getLocalPart(),ENCODINGSTYLE_ATTRIB_NAME)) { setEncodingStyle(value); return; @@ -240,7 +241,7 @@ namespace { protected: void marshallAttributes(DOMElement* domElement) const { - MARSHALL_STRING_ATTRIB(EncodingStyle,ENCODINGSTYLE,XMLConstants::SOAP11ENV_NS); + MARSHALL_STRING_ATTRIB(EncodingStyle,ENCODINGSTYLE,SOAP11ENV_NS); marshallExtensionAttributes(domElement); } @@ -262,7 +263,7 @@ namespace { { void init() { m_Actor=NULL; - m_MustUnderstand=XMLConstants::XML_BOOL_NULL; + m_MustUnderstand=xmlconstants::XML_BOOL_NULL; } public: virtual ~HeaderImpl() { @@ -294,7 +295,7 @@ namespace { IMPL_BOOLEAN_ATTRIB(MustUnderstand); void setAttribute(QName& qualifiedName, const XMLCh* value) { - if (qualifiedName.hasNamespaceURI() && XMLString::equals(qualifiedName.getNamespaceURI(),XMLConstants::SOAP11ENV_NS)) { + if (qualifiedName.hasNamespaceURI() && XMLString::equals(qualifiedName.getNamespaceURI(),SOAP11ENV_NS)) { if (XMLString::equals(qualifiedName.getLocalPart(),MUSTUNDERSTAND_ATTRIB_NAME)) { setMustUnderstand(value); return; @@ -309,8 +310,8 @@ namespace { protected: void marshallAttributes(DOMElement* domElement) const { - MARSHALL_STRING_ATTRIB(Actor,ACTOR,XMLConstants::SOAP11ENV_NS); - MARSHALL_BOOLEAN_ATTRIB(MustUnderstand,MUSTUNDERSTAND,XMLConstants::SOAP11ENV_NS); + MARSHALL_STRING_ATTRIB(Actor,ACTOR,SOAP11ENV_NS); + MARSHALL_BOOLEAN_ATTRIB(MustUnderstand,MUSTUNDERSTAND,SOAP11ENV_NS); marshallExtensionAttributes(domElement); } @@ -367,8 +368,8 @@ namespace { } void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { - PROC_TYPED_CHILD(Header,XMLConstants::SOAP11ENV_NS,false); - PROC_TYPED_CHILD(Body,XMLConstants::SOAP11ENV_NS,false); + PROC_TYPED_CHILD(Header,SOAP11ENV_NS,false); + PROC_TYPED_CHILD(Body,SOAP11ENV_NS,false); AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root); } diff --git a/xmltooling/soap/impl/SOAPSchemaValidators.cpp b/xmltooling/soap/impl/SOAPSchemaValidators.cpp index 0708fc5..cb6492e 100644 --- a/xmltooling/soap/impl/SOAPSchemaValidators.cpp +++ b/xmltooling/soap/impl/SOAPSchemaValidators.cpp @@ -28,6 +28,7 @@ using namespace soap11; using namespace xmltooling; using namespace std; +using xmlconstants::SOAP11ENV_NS; namespace { @@ -70,17 +71,17 @@ namespace { void soap11::registerSOAPClasses() { QName q; - REGISTER_ELEMENT_NOVAL(XMLConstants::SOAP11ENV_NS,Body); - REGISTER_ELEMENT_NOVAL(XMLConstants::SOAP11ENV_NS,Detail); - REGISTER_ELEMENT(XMLConstants::SOAP11ENV_NS,Envelope); - REGISTER_ELEMENT(XMLConstants::SOAP11ENV_NS,Fault); - REGISTER_ELEMENT(XMLConstants::SOAP11ENV_NS,Faultactor); - REGISTER_ELEMENT(XMLConstants::SOAP11ENV_NS,Faultcode); - REGISTER_ELEMENT(XMLConstants::SOAP11ENV_NS,Faultstring); - REGISTER_ELEMENT_NOVAL(XMLConstants::SOAP11ENV_NS,Header); - REGISTER_TYPE_NOVAL(XMLConstants::SOAP11ENV_NS,Body); - REGISTER_TYPE_NOVAL(XMLConstants::SOAP11ENV_NS,Detail); - REGISTER_TYPE(XMLConstants::SOAP11ENV_NS,Envelope); - REGISTER_TYPE(XMLConstants::SOAP11ENV_NS,Fault); - REGISTER_TYPE_NOVAL(XMLConstants::SOAP11ENV_NS,Header); + REGISTER_ELEMENT_NOVAL(SOAP11ENV_NS,Body); + REGISTER_ELEMENT_NOVAL(SOAP11ENV_NS,Detail); + REGISTER_ELEMENT(SOAP11ENV_NS,Envelope); + REGISTER_ELEMENT(SOAP11ENV_NS,Fault); + REGISTER_ELEMENT(SOAP11ENV_NS,Faultactor); + REGISTER_ELEMENT(SOAP11ENV_NS,Faultcode); + REGISTER_ELEMENT(SOAP11ENV_NS,Faultstring); + REGISTER_ELEMENT_NOVAL(SOAP11ENV_NS,Header); + REGISTER_TYPE_NOVAL(SOAP11ENV_NS,Body); + REGISTER_TYPE_NOVAL(SOAP11ENV_NS,Detail); + REGISTER_TYPE(SOAP11ENV_NS,Envelope); + REGISTER_TYPE(SOAP11ENV_NS,Fault); + REGISTER_TYPE_NOVAL(SOAP11ENV_NS,Header); } diff --git a/xmltooling/util/XMLConstants.cpp b/xmltooling/util/XMLConstants.cpp index a45f7c5..fdcb634 100644 --- a/xmltooling/util/XMLConstants.cpp +++ b/xmltooling/util/XMLConstants.cpp @@ -25,36 +25,34 @@ #include "util/XMLConstants.h" #include -using namespace xmltooling; - -const XMLCh XMLConstants::XML_NS[] = // http://www.w3.org/XML/1998/namespace +const XMLCh xmlconstants::XML_NS[] = // http://www.w3.org/XML/1998/namespace { chLatin_h, chLatin_t, chLatin_t, chLatin_p, chColon, chForwardSlash, chForwardSlash, chLatin_w, chLatin_w, chLatin_w, chPeriod, chLatin_w, chDigit_3, chPeriod, chLatin_o, chLatin_r, chLatin_g, chForwardSlash, chLatin_X, chLatin_M, chLatin_L, chForwardSlash, chDigit_1, chDigit_9, chDigit_9, chDigit_8, chForwardSlash, chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chLatin_p, chLatin_a, chLatin_c, chLatin_e, chNull }; -const XMLCh XMLConstants::XMLNS_NS[] = // http://www.w3.org/2000/xmlns/ +const XMLCh xmlconstants::XMLNS_NS[] = // http://www.w3.org/2000/xmlns/ { chLatin_h, chLatin_t, chLatin_t, chLatin_p, chColon, chForwardSlash, chForwardSlash, chLatin_w, chLatin_w, chLatin_w, chPeriod, chLatin_w, chDigit_3, chPeriod, chLatin_o, chLatin_r, chLatin_g, chForwardSlash, chDigit_2, chDigit_0, chDigit_0, chDigit_0, chForwardSlash, chLatin_x, chLatin_m, chLatin_l, chLatin_n, chLatin_s, chForwardSlash, chNull }; -const XMLCh XMLConstants::XMLNS_PREFIX[] = { chLatin_x, chLatin_m, chLatin_l, chLatin_n, chLatin_s, chNull }; +const XMLCh xmlconstants::XMLNS_PREFIX[] = { chLatin_x, chLatin_m, chLatin_l, chLatin_n, chLatin_s, chNull }; -const XMLCh XMLConstants::XML_PREFIX[] = { chLatin_x, chLatin_m, chLatin_l, chNull }; +const XMLCh xmlconstants::XML_PREFIX[] = { chLatin_x, chLatin_m, chLatin_l, chNull }; -const XMLCh XMLConstants::XSD_NS[] = // http://www.w3.org/2001/XMLSchema +const XMLCh xmlconstants::XSD_NS[] = // http://www.w3.org/2001/XMLSchema { chLatin_h, chLatin_t, chLatin_t, chLatin_p, chColon, chForwardSlash, chForwardSlash, chLatin_w, chLatin_w, chLatin_w, chPeriod, chLatin_w, chDigit_3, chPeriod, chLatin_o, chLatin_r, chLatin_g, chForwardSlash, chDigit_2, chDigit_0, chDigit_0, chDigit_1, chForwardSlash, chLatin_X, chLatin_M, chLatin_L, chLatin_S, chLatin_c, chLatin_h, chLatin_e, chLatin_m, chLatin_a, chNull }; -const XMLCh XMLConstants::XSD_PREFIX[] = { chLatin_x, chLatin_s, chNull }; +const XMLCh xmlconstants::XSD_PREFIX[] = { chLatin_x, chLatin_s, chNull }; -const XMLCh XMLConstants::XSI_NS[] = // http://www.w3.org/2001/XMLSchema-instance +const XMLCh xmlconstants::XSI_NS[] = // http://www.w3.org/2001/XMLSchema-instance { chLatin_h, chLatin_t, chLatin_t, chLatin_p, chColon, chForwardSlash, chForwardSlash, chLatin_w, chLatin_w, chLatin_w, chPeriod, chLatin_w, chDigit_3, chPeriod, chLatin_o, chLatin_r, chLatin_g, chForwardSlash, chDigit_2, chDigit_0, chDigit_0, chDigit_1, chForwardSlash, @@ -62,27 +60,27 @@ const XMLCh XMLConstants::XSI_NS[] = // http://www.w3.org/2001/XMLSchema-instanc chLatin_i, chLatin_n, chLatin_s, chLatin_t, chLatin_a, chLatin_n, chLatin_c, chLatin_e, chNull }; -const XMLCh XMLConstants::XSI_PREFIX[] = { chLatin_x, chLatin_s, chLatin_i, chNull }; +const XMLCh xmlconstants::XSI_PREFIX[] = { chLatin_x, chLatin_s, chLatin_i, chNull }; -const XMLCh XMLConstants::XMLSIG_NS[] = // http://www.w3.org/2000/09/xmldsig# +const XMLCh xmlconstants::XMLSIG_NS[] = // http://www.w3.org/2000/09/xmldsig# { chLatin_h, chLatin_t, chLatin_t, chLatin_p, chColon, chForwardSlash, chForwardSlash, chLatin_w, chLatin_w, chLatin_w, chPeriod, chLatin_w, chDigit_3, chPeriod, chLatin_o, chLatin_r, chLatin_g, chForwardSlash, chDigit_2, chDigit_0, chDigit_0, chDigit_0, chForwardSlash, chDigit_0, chDigit_9, chForwardSlash, chLatin_x, chLatin_m, chLatin_l, chLatin_d, chLatin_s, chLatin_i, chLatin_g, chPound, chNull }; -const XMLCh XMLConstants::XMLSIG_PREFIX[] = { chLatin_d, chLatin_s, chNull }; +const XMLCh xmlconstants::XMLSIG_PREFIX[] = { chLatin_d, chLatin_s, chNull }; -const XMLCh XMLConstants::XMLENC_NS[] = // http://www.w3.org/2001/04/xmlenc# +const XMLCh xmlconstants::XMLENC_NS[] = // http://www.w3.org/2001/04/xmlenc# { chLatin_h, chLatin_t, chLatin_t, chLatin_p, chColon, chForwardSlash, chForwardSlash, chLatin_w, chLatin_w, chLatin_w, chPeriod, chLatin_w, chDigit_3, chPeriod, chLatin_o, chLatin_r, chLatin_g, chForwardSlash, chDigit_2, chDigit_0, chDigit_0, chDigit_1, chForwardSlash, chDigit_0, chDigit_4, chForwardSlash, chLatin_x, chLatin_m, chLatin_l, chLatin_e, chLatin_n, chLatin_c, chPound, chNull }; -const XMLCh XMLConstants::XMLENC_PREFIX[] = { chLatin_x, chLatin_e, chLatin_n, chLatin_c, chNull }; +const XMLCh xmlconstants::XMLENC_PREFIX[] = { chLatin_x, chLatin_e, chLatin_n, chLatin_c, chNull }; -const XMLCh XMLConstants::SOAP11ENV_NS[] = // http://schemas.xmlsoap.org/soap/envelope/ +const XMLCh xmlconstants::SOAP11ENV_NS[] = // http://schemas.xmlsoap.org/soap/envelope/ { chLatin_h, chLatin_t, chLatin_t, chLatin_p, chColon, chForwardSlash, chForwardSlash, chLatin_s, chLatin_c, chLatin_h, chLatin_e, chLatin_m, chLatin_a, chLatin_s, chPeriod, chLatin_x, chLatin_m, chLatin_l, chLatin_s, chLatin_o, chLatin_a, chLatin_p, chPeriod, @@ -91,9 +89,9 @@ const XMLCh XMLConstants::SOAP11ENV_NS[] = // http://schemas.xmlsoap.org/soap/en chLatin_e, chLatin_n, chLatin_v, chLatin_e, chLatin_l, chLatin_o, chLatin_p, chLatin_e, chForwardSlash, chNull }; -const XMLCh XMLConstants::SOAP11ENV_PREFIX[] = UNICODE_LITERAL_1(S); +const XMLCh xmlconstants::SOAP11ENV_PREFIX[] = UNICODE_LITERAL_1(S); -const XMLCh XMLConstants::XMLTOOLING_NS[] = // http://www.opensaml.org/xmltooling +const XMLCh xmlconstants::XMLTOOLING_NS[] = // http://www.opensaml.org/xmltooling { chLatin_h, chLatin_t, chLatin_t, chLatin_p, chColon, chForwardSlash, chForwardSlash, chLatin_w, chLatin_w, chLatin_w, chPeriod, chLatin_o, chLatin_p, chLatin_e, chLatin_n, chLatin_s, chLatin_a, chLatin_m, chLatin_l, chPeriod, @@ -101,10 +99,10 @@ const XMLCh XMLConstants::XMLTOOLING_NS[] = // http://www.opensaml.org/xmltoolin chLatin_x, chLatin_m, chLatin_l, chLatin_t, chLatin_o, chLatin_o, chLatin_l, chLatin_i, chLatin_n, chLatin_g, chNull }; -const XMLCh XMLConstants::XML_TRUE[] = { chLatin_t, chLatin_r, chLatin_u, chLatin_e, chNull }; +const XMLCh xmlconstants::XML_TRUE[] = { chLatin_t, chLatin_r, chLatin_u, chLatin_e, chNull }; -const XMLCh XMLConstants::XML_FALSE[] = { chLatin_f, chLatin_a, chLatin_l, chLatin_s, chLatin_e, chNull }; +const XMLCh xmlconstants::XML_FALSE[] = { chLatin_f, chLatin_a, chLatin_l, chLatin_s, chLatin_e, chNull }; -const XMLCh XMLConstants::XML_ONE[] = { chDigit_1, chNull }; +const XMLCh xmlconstants::XML_ONE[] = { chDigit_1, chNull }; -const XMLCh XMLConstants::XML_ZERO[] = { chDigit_0, chNull }; +const XMLCh xmlconstants::XML_ZERO[] = { chDigit_0, chNull }; diff --git a/xmltooling/util/XMLConstants.h b/xmltooling/util/XMLConstants.h index 093688d..89684fd 100644 --- a/xmltooling/util/XMLConstants.h +++ b/xmltooling/util/XMLConstants.h @@ -25,78 +25,75 @@ #include -namespace xmltooling { +/** + * XML related constants. + */ +namespace xmlconstants { + + /** XML core namespace ("http://www.w3.org/XML/1998/namespace") */ + extern XMLTOOL_API const XMLCh XML_NS[]; + + /** XML namespace prefix for special xml attributes ("xml") */ + extern XMLTOOL_API const XMLCh XML_PREFIX[]; + + /** XML namespace for xmlns attributes ("http://www.w3.org/2000/xmlns/") */ + extern XMLTOOL_API const XMLCh XMLNS_NS[]; + + /** XML namespace prefix for xmlns attributes ("xmlns") */ + extern XMLTOOL_API const XMLCh XMLNS_PREFIX[]; + + /** XML Schema namespace ("http://www.w3.org/2001/XMLSchema") */ + extern XMLTOOL_API const XMLCh XSD_NS[]; + + /** XML Schema QName prefix ("xs") */ + extern XMLTOOL_API const XMLCh XSD_PREFIX[]; + + /** XML Schema Instance namespace ("http://www.w3.org/2001/XMLSchema-instance") */ + extern XMLTOOL_API const XMLCh XSI_NS[]; - /** - * XML related constants. - */ - struct XMLTOOL_API XMLConstants - { - /** XML core namespace ("http://www.w3.org/XML/1998/namespace") */ - static const XMLCh XML_NS[]; - - /** XML namespace prefix for special xml attributes ("xml") */ - static const XMLCh XML_PREFIX[]; + /** XML Schema Instance QName prefix ("xsi") */ + extern XMLTOOL_API const XMLCh XSI_PREFIX[]; - /** XML namespace for xmlns attributes ("http://www.w3.org/2000/xmlns/") */ - static const XMLCh XMLNS_NS[]; - - /** XML namespace prefix for xmlns attributes ("xmlns") */ - static const XMLCh XMLNS_PREFIX[]; + /** XML Signature namespace ("http://www.w3.org/2000/09/xmldsig#") */ + extern XMLTOOL_API const XMLCh XMLSIG_NS[]; - /** XML Schema namespace ("http://www.w3.org/2001/XMLSchema") */ - static const XMLCh XSD_NS[]; - - /** XML Schema QName prefix ("xs") */ - static const XMLCh XSD_PREFIX[]; + /** XML Signature QName prefix ("ds") */ + extern XMLTOOL_API const XMLCh XMLSIG_PREFIX[]; - /** XML Schema Instance namespace ("http://www.w3.org/2001/XMLSchema-instance") */ - static const XMLCh XSI_NS[]; - - /** XML Schema Instance QName prefix ("xsi") */ - static const XMLCh XSI_PREFIX[]; - - /** XML Signature namespace ("http://www.w3.org/2000/09/xmldsig#") */ - static const XMLCh XMLSIG_NS[]; - - /** XML Signature QName prefix ("ds") */ - static const XMLCh XMLSIG_PREFIX[]; - - /** XML Encryption namespace ("http://www.w3.org/2001/04/xmlenc#") */ - static const XMLCh XMLENC_NS[]; - - /** XML Encryption QName prefix ("xenc") */ - static const XMLCh XMLENC_PREFIX[]; - - /** SOAP 1.1 Envelope XML namespace ("http://schemas.xmlsoap.org/soap/envelope/") */ - static const XMLCh SOAP11ENV_NS[]; - - /** SOAP 1.1 Envelope QName prefix ("S") */ - static const XMLCh SOAP11ENV_PREFIX[]; + /** XML Encryption namespace ("http://www.w3.org/2001/04/xmlenc#") */ + extern XMLTOOL_API const XMLCh XMLENC_NS[]; + + /** XML Encryption QName prefix ("xenc") */ + extern XMLTOOL_API const XMLCh XMLENC_PREFIX[]; + + /** SOAP 1.1 Envelope XML namespace ("http://schemas.xmlsoap.org/soap/envelope/") */ + extern XMLTOOL_API const XMLCh SOAP11ENV_NS[]; + + /** SOAP 1.1 Envelope QName prefix ("S") */ + extern XMLTOOL_API const XMLCh SOAP11ENV_PREFIX[]; + + /** XML Tooling namespace ("http://www.opensaml.org/xmltooling") */ + extern XMLTOOL_API const XMLCh XMLTOOLING_NS[]; + + /** XML "true" boolean constant */ + extern XMLTOOL_API const XMLCh XML_TRUE[]; + + /** XML "false" boolean constant */ + extern XMLTOOL_API const XMLCh XML_FALSE[]; + + /** XML "1" boolean constant */ + extern XMLTOOL_API const XMLCh XML_ONE[]; + + /** XML "0" boolean constant */ + extern XMLTOOL_API const XMLCh XML_ZERO[]; - /** XML Tooling namespace ("http://www.opensaml.org/xmltooling") */ - static const XMLCh XMLTOOLING_NS[]; - - /** XML "true" boolean constant */ - static const XMLCh XML_TRUE[]; - - /** XML "false" boolean constant */ - static const XMLCh XML_FALSE[]; - - /** XML "1" boolean constant */ - static const XMLCh XML_ONE[]; - - /** XML "0" boolean constant */ - static const XMLCh XML_ZERO[]; - - /** Enumerations of the different values of a boolean attribute or element */ - enum xmltooling_bool_t { - XML_BOOL_NULL, - XML_BOOL_TRUE, - XML_BOOL_FALSE, - XML_BOOL_ONE, - XML_BOOL_ZERO - }; + /** Enumerations of the different values of a boolean attribute or element */ + enum xmltooling_bool_t { + XML_BOOL_NULL, + XML_BOOL_TRUE, + XML_BOOL_FALSE, + XML_BOOL_ONE, + XML_BOOL_ZERO }; }; diff --git a/xmltooling/util/XMLHelper.cpp b/xmltooling/util/XMLHelper.cpp index 9411daa..c876e97 100644 --- a/xmltooling/util/XMLHelper.cpp +++ b/xmltooling/util/XMLHelper.cpp @@ -35,7 +35,7 @@ static const XMLCh type[]={chLatin_t, chLatin_y, chLatin_p, chLatin_e, chNull }; bool XMLHelper::hasXSIType(const DOMElement* e) { if (e) { - if (e->hasAttributeNS(XMLConstants::XSI_NS, type)) { + if (e->hasAttributeNS(xmlconstants::XSI_NS, type)) { return true; } } @@ -45,7 +45,7 @@ bool XMLHelper::hasXSIType(const DOMElement* e) QName* XMLHelper::getXSIType(const DOMElement* e) { - DOMAttr* attribute = e->getAttributeNodeNS(XMLConstants::XSI_NS, type); + DOMAttr* attribute = e->getAttributeNodeNS(xmlconstants::XSI_NS, type); if (attribute) { const XMLCh* attributeValue = attribute->getTextContent(); if (attributeValue && *attributeValue) {