diff --git a/Projects/Win32/BCC.551/Xerces-all/XercesLib/XercesLib.mak b/Projects/Win32/BCC.551/Xerces-all/XercesLib/XercesLib.mak index c1aa9cc5172fc6715db6f5a16791c9d23963349e..6c16c59bc93c10daad803f67348ec3b1076819aa 100644 --- a/Projects/Win32/BCC.551/Xerces-all/XercesLib/XercesLib.mak +++ b/Projects/Win32/BCC.551/Xerces-all/XercesLib/XercesLib.mak @@ -286,6 +286,7 @@ OBJFILES = $(TARGETPATH)\obj\XercesLib.obj \ $(TARGETPATH)\obj\XSDLocator.obj \ $(TARGETPATH)\obj\DOMRangeException.obj \ $(TARGETPATH)\obj\DOMImplementationImpl.obj \ + $(TARGETPATH)\obj\DOMImplementationListImpl.obj \ $(TARGETPATH)\obj\DOMImplementationRegistry.obj \ $(TARGETPATH)\obj\DOMLSParserImpl.obj \ $(TARGETPATH)\obj\DOMLSSerializerImpl.obj \ diff --git a/Projects/Win32/VC6/xerces-all/XercesLib/XercesLib.dsp b/Projects/Win32/VC6/xerces-all/XercesLib/XercesLib.dsp index aa9fe1fef1c223110dc8b9869c1861cd2b6636b7..116e6c47a7d989bc86bef3a06ee193648c23e254 100644 --- a/Projects/Win32/VC6/xerces-all/XercesLib/XercesLib.dsp +++ b/Projects/Win32/VC6/xerces-all/XercesLib/XercesLib.dsp @@ -2832,6 +2832,14 @@ SOURCE=..\..\..\..\..\src\xercesc\dom\impl\DOMImplementationimpl.hpp # End Source File # Begin Source File +SOURCE=..\..\..\..\..\src\xercesc\dom\impl\DOMImplementationListImpl.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\..\src\xercesc\dom\impl\DOMImplementationListImpl.hpp +# End Source File +# Begin Source File + SOURCE=..\..\..\..\..\src\xercesc\dom\impl\DOMImplementationRegistry.cpp # End Source File # Begin Source File @@ -3057,6 +3065,10 @@ SOURCE=..\..\..\..\..\src\xercesc\dom\DOMImplementation.hpp # End Source File # Begin Source File +SOURCE=..\..\..\..\..\src\xercesc\dom\DOMImplementationList.hpp +# End Source File +# Begin Source File + SOURCE=..\..\..\..\..\src\xercesc\dom\DOMImplementationLS.hpp # End Source File # Begin Source File @@ -3085,6 +3097,10 @@ SOURCE=..\..\..\..\..\src\xercesc\dom\DOMLSInput.hpp # End Source File # Begin Source File +SOURCE=..\..\..\..\..\src\xercesc\dom\DOMLSOutput.hpp +# End Source File +# Begin Source File + SOURCE=..\..\..\..\..\src\xercesc\dom\DOMLSParser.hpp # End Source File # Begin Source File diff --git a/Projects/Win32/VC7.1/xerces-all/XercesLib/XercesLib.vcproj b/Projects/Win32/VC7.1/xerces-all/XercesLib/XercesLib.vcproj index 42d6a6bba8aecc1135a5a826583d6f57d57679d8..356b57ba2b0fc6725532e8900eb4387cecc8c7ca 100644 --- a/Projects/Win32/VC7.1/xerces-all/XercesLib/XercesLib.vcproj +++ b/Projects/Win32/VC7.1/xerces-all/XercesLib/XercesLib.vcproj @@ -2373,6 +2373,9 @@ copy $(InputDir)\$(InputName).msvc.hpp $(InputPath) <File RelativePath="..\..\..\..\..\src\xercesc\dom\DOMImplementation.hpp"> </File> + <File + RelativePath="..\..\..\..\..\src\xercesc\dom\DOMImplementationList.hpp"> + </File> <File RelativePath="..\..\..\..\..\src\xercesc\dom\DOMImplementationLS.hpp"> </File> @@ -2587,7 +2590,13 @@ copy $(InputDir)\$(InputName).msvc.hpp $(InputPath) RelativePath="..\..\..\..\..\src\xercesc\dom\impl\DOMImplementationImpl.cpp"> </File> <File - RelativePath="..\..\..\..\..\src\xercesc\dom\impl\DOMImplementationimpl.hpp"> + RelativePath="..\..\..\..\..\src\xercesc\dom\impl\DOMImplementationImpl.hpp"> + </File> + <File + RelativePath="..\..\..\..\..\src\xercesc\dom\impl\DOMImplementationListImpl.cpp"> + </File> + <File + RelativePath="..\..\..\..\..\src\xercesc\dom\impl\DOMImplementationListImpl.hpp"> </File> <File RelativePath="..\..\..\..\..\src\xercesc\dom\impl\DOMImplementationRegistry.cpp"> diff --git a/src/Makefile.am b/src/Makefile.am index fe5116b4b78310ce4d05b1857e72755fbde0dc11..71194d5f6f2f7b36b5f8e33dbbc85dc68903eb5e 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -271,6 +271,7 @@ dom_headers = \ xercesc/dom/DOMErrorHandler.hpp \ xercesc/dom/DOMException.hpp \ xercesc/dom/DOMImplementation.hpp \ + xercesc/dom/DOMImplementationList.hpp \ xercesc/dom/DOMImplementationLS.hpp \ xercesc/dom/DOMImplementationRegistry.hpp \ xercesc/dom/DOMImplementationSource.hpp \ @@ -333,6 +334,7 @@ domimpl_headers = \ xercesc/dom/impl/DOMEntityReferenceImpl.hpp \ xercesc/dom/impl/DOMErrorImpl.hpp \ xercesc/dom/impl/DOMImplementationImpl.hpp \ + xercesc/dom/impl/DOMImplementationListImpl.hpp \ xercesc/dom/impl/DOMLocatorImpl.hpp \ xercesc/dom/impl/DOMNamedNodeMapImpl.hpp \ xercesc/dom/impl/DOMNodeIDMap.hpp \ @@ -371,6 +373,7 @@ domimpl_sources = \ xercesc/dom/impl/DOMEntityReferenceImpl.cpp \ xercesc/dom/impl/DOMErrorImpl.cpp \ xercesc/dom/impl/DOMImplementationImpl.cpp \ + xercesc/dom/impl/DOMImplementationListImpl.cpp \ xercesc/dom/impl/DOMImplementationRegistry.cpp \ xercesc/dom/impl/DOMLocatorImpl.cpp \ xercesc/dom/impl/DOMNamedNodeMapImpl.cpp \ diff --git a/src/Makefile.in b/src/Makefile.in index 2a8a9f8b68cd8ff6b7d8d6afc8d5a1b61cda5a66..5ee4c8cd668e57c722142303be3a652932aa7ecd 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -203,6 +203,7 @@ am__objects_4 = xercesc/dom/impl/DOMAttrImpl.lo \ xercesc/dom/impl/DOMEntityReferenceImpl.lo \ xercesc/dom/impl/DOMErrorImpl.lo \ xercesc/dom/impl/DOMImplementationImpl.lo \ + xercesc/dom/impl/DOMImplementationListImpl.lo \ xercesc/dom/impl/DOMImplementationRegistry.lo \ xercesc/dom/impl/DOMLocatorImpl.lo \ xercesc/dom/impl/DOMNamedNodeMapImpl.lo \ @@ -1123,6 +1124,7 @@ dom_headers = \ xercesc/dom/DOMErrorHandler.hpp \ xercesc/dom/DOMException.hpp \ xercesc/dom/DOMImplementation.hpp \ + xercesc/dom/DOMImplementationList.hpp \ xercesc/dom/DOMImplementationLS.hpp \ xercesc/dom/DOMImplementationRegistry.hpp \ xercesc/dom/DOMImplementationSource.hpp \ @@ -1184,6 +1186,7 @@ domimpl_headers = \ xercesc/dom/impl/DOMEntityReferenceImpl.hpp \ xercesc/dom/impl/DOMErrorImpl.hpp \ xercesc/dom/impl/DOMImplementationImpl.hpp \ + xercesc/dom/impl/DOMImplementationListImpl.hpp \ xercesc/dom/impl/DOMLocatorImpl.hpp \ xercesc/dom/impl/DOMNamedNodeMapImpl.hpp \ xercesc/dom/impl/DOMNodeIDMap.hpp \ @@ -1222,6 +1225,7 @@ domimpl_sources = \ xercesc/dom/impl/DOMEntityReferenceImpl.cpp \ xercesc/dom/impl/DOMErrorImpl.cpp \ xercesc/dom/impl/DOMImplementationImpl.cpp \ + xercesc/dom/impl/DOMImplementationListImpl.cpp \ xercesc/dom/impl/DOMImplementationRegistry.cpp \ xercesc/dom/impl/DOMLocatorImpl.cpp \ xercesc/dom/impl/DOMNamedNodeMapImpl.cpp \ @@ -2166,6 +2170,9 @@ xercesc/dom/impl/DOMErrorImpl.lo: xercesc/dom/impl/$(am__dirstamp) \ xercesc/dom/impl/DOMImplementationImpl.lo: \ xercesc/dom/impl/$(am__dirstamp) \ xercesc/dom/impl/$(DEPDIR)/$(am__dirstamp) +xercesc/dom/impl/DOMImplementationListImpl.lo: \ + xercesc/dom/impl/$(am__dirstamp) \ + xercesc/dom/impl/$(DEPDIR)/$(am__dirstamp) xercesc/dom/impl/DOMImplementationRegistry.lo: \ xercesc/dom/impl/$(am__dirstamp) \ xercesc/dom/impl/$(DEPDIR)/$(am__dirstamp) @@ -3151,6 +3158,8 @@ mostlyclean-compile: -rm -f xercesc/dom/impl/DOMErrorImpl.lo -rm -f xercesc/dom/impl/DOMImplementationImpl.$(OBJEXT) -rm -f xercesc/dom/impl/DOMImplementationImpl.lo + -rm -f xercesc/dom/impl/DOMImplementationListImpl.$(OBJEXT) + -rm -f xercesc/dom/impl/DOMImplementationListImpl.lo -rm -f xercesc/dom/impl/DOMImplementationRegistry.$(OBJEXT) -rm -f xercesc/dom/impl/DOMImplementationRegistry.lo -rm -f xercesc/dom/impl/DOMLSSerializerImpl.$(OBJEXT) @@ -3755,6 +3764,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMEntityReferenceImpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMErrorImpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMImplementationImpl.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMImplementationListImpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMImplementationRegistry.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMLSSerializerImpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMLocatorImpl.Plo@am__quote@ diff --git a/src/xercesc/dom/DOMImplementationList.hpp b/src/xercesc/dom/DOMImplementationList.hpp new file mode 100644 index 0000000000000000000000000000000000000000..cb27c4997a6b90a1981ee04b156a20af50da9e11 --- /dev/null +++ b/src/xercesc/dom/DOMImplementationList.hpp @@ -0,0 +1,125 @@ +#ifndef DOMImplementationList_HEADER_GUARD_ +#define DOMImplementationList_HEADER_GUARD_ + +/* + * Copyright 2001-2002,2004 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * $Id$ + */ + +#include <xercesc/util/XercesDefs.hpp> + +XERCES_CPP_NAMESPACE_BEGIN + + +class DOMImplementation; + + +/** + * The <code>DOMImplementationList</code> interface provides the abstraction of an ordered + * collection of DOM implementations, without defining or constraining how this collection + * is implemented. The items in the <code>DOMImplementationList</code> are accessible via + * an integral index, starting from 0. + */ + +class CDOM_EXPORT DOMImplementationList { +protected: + // ----------------------------------------------------------------------- + // Hidden constructors + // ----------------------------------------------------------------------- + /** @name Hidden constructors */ + //@{ + DOMImplementationList() {}; + //@} + +private: + // ----------------------------------------------------------------------- + // Unimplemented constructors and operators + // ----------------------------------------------------------------------- + /** @name Unimplemented constructors and operators */ + //@{ + DOMImplementationList(const DOMImplementationList &); + DOMImplementationList & operator = (const DOMImplementationList &); + //@} + +public: + // ----------------------------------------------------------------------- + // All constructors are hidden, just the destructor is available + // ----------------------------------------------------------------------- + /** @name Destructor */ + //@{ + /** + * Destructor + * + */ + virtual ~DOMImplementationList() {}; + //@} + + // ----------------------------------------------------------------------- + // Virtual DOMImplementationList interface + // ----------------------------------------------------------------------- + /** @name Functions introduced in DOM Level 3 */ + //@{ + // ----------------------------------------------------------------------- + // Getter methods + // ----------------------------------------------------------------------- + /** + * Returns the <code>index</code> item in the collection. + * + * If <code>index</code> is greater than or equal to the number of DOMImplementation in + * the list, this returns <code>null</code>. + * + * @param index Index into the collection. + * @return The DOMImplementation at the <code>index</code>th position in the + * <code>DOMImplementationList</code>, or <code>null</code> if that is not a valid + * index. + * @since DOM Level 3 + */ + virtual DOMImplementation *item(XMLSize_t index) const = 0; + + /** + * Returns the number of DOMImplementation in the list. + * + * The range of valid child node indices is 0 to <code>length-1</code> inclusive. + * @since DOM Level 3 + */ + virtual XMLSize_t getLength() const = 0; + //@} + + // ----------------------------------------------------------------------- + // Non-standard Extension + // ----------------------------------------------------------------------- + /** @name Non-standard Extension */ + //@{ + /** + * Called to indicate that this list is no longer in use + * and that the implementation may relinquish any resources associated with it and + * its associated children. + * + * Access to a released object will lead to unexpected result. + * + */ + virtual void release() = 0; + //@} + +}; + +XERCES_CPP_NAMESPACE_END + +#endif + + diff --git a/src/xercesc/dom/DOMImplementationRegistry.hpp b/src/xercesc/dom/DOMImplementationRegistry.hpp index aaa6590dbfd3cc504a0d86f77bf183221f9e225f..eb1e24fdd1b697b34f4483da928fa17d8771ac99 100644 --- a/src/xercesc/dom/DOMImplementationRegistry.hpp +++ b/src/xercesc/dom/DOMImplementationRegistry.hpp @@ -30,6 +30,7 @@ * point. * * @see DOMImplementation + * @see DOMImplementationList * @see DOMImplementationSource * @since DOM Level 3 */ @@ -41,6 +42,7 @@ XERCES_CPP_NAMESPACE_BEGIN class DOMImplementation; class DOMImplementationSource; +class DOMImplementationList; class CDOM_EXPORT DOMImplementationRegistry { @@ -54,8 +56,6 @@ public: * Return the first registered implementation that has the desired features, * or null if none is found. * - * <p><b>"Experimental - subject to change"</b></p> - * * @param features A string that specifies which features are required. * This is a space separated list in which each feature is * specified by its name optionally followed by a space @@ -68,9 +68,21 @@ public: static DOMImplementation* getDOMImplementation(const XMLCh* features); /** - * Register an implementation. + * Return the list of registered implementation that have the desired features. * - * <p><b>"Experimental - subject to change"</b></p> + * @param features A string that specifies which features are required. + * This is a space separated list in which each feature is + * specified by its name optionally followed by a space + * and a version number. + * This is something like: "XML 1.0 Traversal 2.0" + * @return A DOMImplementationList object that contains the DOMImplementation + * that have the desired features + * @since DOM Level 3 + */ + static DOMImplementationList* getDOMImplementationList(const XMLCh* features); + + /** + * Register an implementation. * * @param source A DOMImplementation Source object to be added to the registry. * The registry does NOT adopt the source object. Users still own it. diff --git a/src/xercesc/dom/DOMImplementationSource.hpp b/src/xercesc/dom/DOMImplementationSource.hpp index 1ab97dd1b0c4a0c4b701424117d228a50a168df5..2eaf6ad3c5b0ce2e960400f442ab886ae10e15c7 100644 --- a/src/xercesc/dom/DOMImplementationSource.hpp +++ b/src/xercesc/dom/DOMImplementationSource.hpp @@ -23,11 +23,10 @@ /** * This interface permits a DOM implementer to supply one or more - * implementations, based upon requested features. Each implemented + * implementations, based upon requested features and versions. Each implemented * <code>DOMImplementationSource</code> object is listed in the * binding-specific list of available sources so that its * <code>DOMImplementation</code> objects are made available. - * <p>See also the <a href='http://www.w3.org/TR/2002/WD-DOM-Level-3-Core-20020409'>Document Object Model (DOM) Level 3 Core Specification</a>. * * @since DOM Level 3 */ @@ -37,6 +36,7 @@ XERCES_CPP_NAMESPACE_BEGIN class DOMImplementation; +class DOMImplementationList; class CDOM_EXPORT DOMImplementationSource { @@ -79,9 +79,7 @@ public: /** @name Functions introduced in DOM Level 3 */ //@{ /** - * A method to request a DOM implementation. - * - * <p><b>"Experimental - subject to change"</b></p> + * A method to request the first DOM implementation that supports the specified features. * * @param features A string that specifies which features are required. * This is a space separated list in which each feature is specified @@ -92,6 +90,18 @@ public: * @since DOM Level 3 */ virtual DOMImplementation* getDOMImplementation(const XMLCh* features) const = 0; + + /** + * A method to request a list of DOM implementations that support the specified features and versions, + * + * @param features A string that specifies which features are required. + * This is a space separated list in which each feature is specified + * by its name optionally followed by a space and a version number. + * This is something like: "XML 1.0 Traversal 2.0" + * @return A list of DOM implementations that support the desired features + * @since DOM Level 3 + */ + virtual DOMImplementationList* getDOMImplementationList(const XMLCh* features) const = 0; //@} }; diff --git a/src/xercesc/dom/impl/DOMImplementationImpl.cpp b/src/xercesc/dom/impl/DOMImplementationImpl.cpp index eb1e75c4e490929400c36111be172ca69cfd25a2..2223eaa3f783d3f0dee7b06e48281da1e0edec0f 100644 --- a/src/xercesc/dom/impl/DOMImplementationImpl.cpp +++ b/src/xercesc/dom/impl/DOMImplementationImpl.cpp @@ -22,6 +22,7 @@ #include "DOMDocumentImpl.hpp" #include "DOMDocumentTypeImpl.hpp" #include "DOMLSSerializerImpl.hpp" +#include "DOMImplementationListImpl.hpp" #include <xercesc/dom/DOMDocument.hpp> #include <xercesc/dom/DOMDocumentType.hpp> @@ -351,6 +352,14 @@ DOMImplementation* DOMImplementationImpl::getDOMImplementation(const XMLCh* feat return impl; } +DOMImplementationList* DOMImplementationImpl::getDOMImplementationList(const XMLCh* features) const +{ + DOMImplementationListImpl* list = new DOMImplementationListImpl; + DOMImplementation* myImpl=getDOMImplementation(features); + if(myImpl) + list->add(myImpl); + return list; +} XERCES_CPP_NAMESPACE_END diff --git a/src/xercesc/dom/impl/DOMImplementationImpl.hpp b/src/xercesc/dom/impl/DOMImplementationImpl.hpp index 73e94d64d2c99da7078a8ddcf09457d074cde576..bda3136793f58dde0e5eeac2da5778271523eefc 100644 --- a/src/xercesc/dom/impl/DOMImplementationImpl.hpp +++ b/src/xercesc/dom/impl/DOMImplementationImpl.hpp @@ -88,6 +88,7 @@ public: // DOMImplementationSource Virtual interface // ------------------------------------------------------------ virtual DOMImplementation* getDOMImplementation(const XMLCh* features) const; + virtual DOMImplementationList* getDOMImplementationList(const XMLCh* features) const; }; diff --git a/src/xercesc/dom/impl/DOMImplementationListImpl.cpp b/src/xercesc/dom/impl/DOMImplementationListImpl.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a8e4258b31ba80daa5043cf3cb6237d678231507 --- /dev/null +++ b/src/xercesc/dom/impl/DOMImplementationListImpl.cpp @@ -0,0 +1,58 @@ +/* + * Copyright 2001-2002,2004 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * $Id$ + */ + +#include "DOMImplementationListImpl.hpp" + +XERCES_CPP_NAMESPACE_BEGIN + +DOMImplementationListImpl::DOMImplementationListImpl() +{ + fList=new RefVectorOf<DOMImplementation>(3, false); +} + + +DOMImplementationListImpl:: ~DOMImplementationListImpl() +{ + delete fList; +} + + +void DOMImplementationListImpl::add(DOMImplementation* impl) { + fList->addElement(impl); +} + +XMLSize_t DOMImplementationListImpl::getLength() const{ + return fList->size(); +} + + +DOMImplementation *DOMImplementationListImpl::item(XMLSize_t index) const{ + if(index<fList->size()) + return fList->elementAt(index); + return 0; +} + +void DOMImplementationListImpl::release() { + delete this; +} + +XERCES_CPP_NAMESPACE_END + + diff --git a/src/xercesc/dom/impl/DOMImplementationListImpl.hpp b/src/xercesc/dom/impl/DOMImplementationListImpl.hpp new file mode 100644 index 0000000000000000000000000000000000000000..bcf488b73d7d2f3c2b6010d8f44d7f03b5cb5d35 --- /dev/null +++ b/src/xercesc/dom/impl/DOMImplementationListImpl.hpp @@ -0,0 +1,55 @@ +#ifndef DOMImplementationListImpl_HEADER_GUARD_ +#define DOMImplementationListImpl_HEADER_GUARD_ +/* + * Copyright 2001-2002,2004 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * $Id$ + */ + +#include <xercesc/util/XercesDefs.hpp> +#include <xercesc/util/RefVectorOf.hpp> +#include <xercesc/dom/DOMImplementationList.hpp> + +XERCES_CPP_NAMESPACE_BEGIN + + +class DOMImplementation; + +class CDOM_EXPORT DOMImplementationListImpl: public DOMImplementationList +{ +private: + RefVectorOf<DOMImplementation> *fList; + + // Unused, and unimplemented constructors, operators, etc. + DOMImplementationListImpl(const DOMImplementationListImpl & other); + DOMImplementationListImpl & operator = (const DOMImplementationListImpl & other); + +public: + DOMImplementationListImpl(); + void add(DOMImplementation* impl); + + virtual ~DOMImplementationListImpl(); + virtual DOMImplementation * item(XMLSize_t index) const; + virtual XMLSize_t getLength() const; + virtual void release(); +}; + +XERCES_CPP_NAMESPACE_END + +#endif + + diff --git a/src/xercesc/dom/impl/DOMImplementationRegistry.cpp b/src/xercesc/dom/impl/DOMImplementationRegistry.cpp index 40af32a1e81fca63dd9385462f705dbca6a78c72..2d2fe5380fd5bc10fafccb27430dd7999c8e9b61 100644 --- a/src/xercesc/dom/impl/DOMImplementationRegistry.cpp +++ b/src/xercesc/dom/impl/DOMImplementationRegistry.cpp @@ -26,6 +26,7 @@ #include <xercesc/dom/DOMImplementationSource.hpp> #include <xercesc/dom/DOMImplementation.hpp> #include "DOMImplementationImpl.hpp" +#include "DOMImplementationListImpl.hpp" XERCES_CPP_NAMESPACE_BEGIN @@ -139,6 +140,32 @@ DOMImplementation *DOMImplementationRegistry::getDOMImplementation(const XMLCh* return 0; } +DOMImplementationList* DOMImplementationRegistry::getDOMImplementationList(const XMLCh* features) { + + DOMImplementationListImpl* list = new DOMImplementationListImpl; + + XMLMutexLock lock(&getDOMImplSrcVectorMutex()); + + unsigned int len = getDOMImplSrcVector()->size(); + + // Put our defined source there + if (len == 0) + getDOMImplSrcVector()->addElement((DOMImplementationSource*)DOMImplementationImpl::getDOMImplementationImpl()); + + len = getDOMImplSrcVector()->size(); + + for (unsigned int i = len; i > 0; i--) { + DOMImplementationSource* source = getDOMImplSrcVector()->elementAt(i-1); + DOMImplementationList* oneList = source->getDOMImplementationList(features); + XMLSize_t oneListLen=oneList->getLength(); + for(XMLSize_t j=0; j<oneListLen; j++) + list->add(oneList->item(j)); + oneList->release(); + } + + return list; +} + void DOMImplementationRegistry::addSource (DOMImplementationSource* source) { XMLMutexLock lock(&getDOMImplSrcVectorMutex()); getDOMImplSrcVector()->addElement(source);