You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by ga...@apache.org on 2003/01/29 20:43:08 UTC
cvs commit: xml-xerces/c/src/xercesc/dom/impl DOMAttrImpl.cpp DOMAttrImpl.hpp DOMElementImpl.cpp DOMElementImpl.hpp
gareth 2003/01/29 11:43:08
Modified: c/src/xercesc/dom DOMAttr.hpp DOMElement.hpp
c/src/xercesc/dom/impl DOMAttrImpl.cpp DOMAttrImpl.hpp
DOMElementImpl.cpp DOMElementImpl.hpp
Log:
added getTypeInfo API
Revision Changes Path
1.7 +14 -2 xml-xerces/c/src/xercesc/dom/DOMAttr.hpp
Index: DOMAttr.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/DOMAttr.hpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- DOMAttr.hpp 21 Nov 2002 14:19:36 -0000 1.6
+++ DOMAttr.hpp 29 Jan 2003 19:43:07 -0000 1.7
@@ -68,7 +68,7 @@
XERCES_CPP_NAMESPACE_BEGIN
class DOMElement;
-
+class DOMTypeInfo;
/**
* The <code>DOMAttr</code> class refers to an attribute of an XML element.
@@ -189,6 +189,18 @@
* @since DOM level 3
*/
virtual bool isId() const = 0;
+
+
+ /**
+ * Returns the type information associated with this attribute.
+ *
+ * <p><b>"Experimental - subject to change"</b></p>
+ *
+ * @return the <code>DOMTypeInfo</code> associated with this attribute
+ * @since DOM level 3
+ */
+ virtual const DOMTypeInfo * getTypeInfo() const = 0;
+
//@}
};
1.7 +16 -3 xml-xerces/c/src/xercesc/dom/DOMElement.hpp
Index: DOMElement.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/DOMElement.hpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- DOMElement.hpp 21 Nov 2002 14:13:01 -0000 1.6
+++ DOMElement.hpp 29 Jan 2003 19:43:07 -0000 1.7
@@ -69,6 +69,7 @@
class DOMAttr;
class DOMNodeList;
+class DOMTypeInfo;
/**
@@ -413,8 +414,6 @@
*/
virtual bool hasAttributeNS(const XMLCh *namespaceURI,
const XMLCh *localName) const = 0;
- //@}
-
/** @name Functions introduced in DOM Level 3 */
//@{
@@ -477,6 +476,19 @@
* @since DOM Level 3
*/
virtual void setIdAttributeNode(const DOMAttr *idAttr) = 0;
+
+
+
+ /**
+ * Returns the type information associated with this element.
+ *
+ * <p><b>"Experimental - subject to change"</b></p>
+ *
+ * @return the <code>DOMTypeInfo</code> associated with this element
+ * @since DOM level 3
+ */
+ virtual const DOMTypeInfo* getTypeInfo() const = 0;
+
//@}
};
@@ -486,3 +498,4 @@
#endif
+
1.15 +18 -3 xml-xerces/c/src/xercesc/dom/impl/DOMAttrImpl.cpp
Index: DOMAttrImpl.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMAttrImpl.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- DOMAttrImpl.cpp 21 Nov 2002 14:19:36 -0000 1.14
+++ DOMAttrImpl.cpp 29 Jan 2003 19:43:08 -0000 1.15
@@ -65,11 +65,12 @@
#include "DOMStringPool.hpp"
#include "DOMDocumentImpl.hpp"
#include "DOMCasts.hpp"
+#include "DOMTypeInfoImpl.hpp"
XERCES_CPP_NAMESPACE_BEGIN
DOMAttrImpl::DOMAttrImpl(DOMDocument *ownerDoc, const XMLCh *aName)
- : fNode(ownerDoc), fParent (ownerDoc)
+ : fNode(ownerDoc), fParent (ownerDoc), fSchemaType(0)
{
DOMDocumentImpl *docImpl = (DOMDocumentImpl *)ownerDoc;
fName = docImpl->getPooledString(aName);
@@ -77,7 +78,7 @@
};
DOMAttrImpl::DOMAttrImpl(const DOMAttrImpl &other, bool deep)
- : fNode(other.fNode), fParent (other.fParent)
+ : fNode(other.fNode), fParent (other.fParent), fSchemaType(other.fSchemaType)
{
fName = other.fName;
@@ -319,6 +320,20 @@
return newAttr;
}
+}
+
+const DOMTypeInfo *DOMAttrImpl::getTypeInfo() const
+{
+ if(!fSchemaType)
+ ((DOMAttrImpl *)(this))->fSchemaType = new (getOwnerDocument()) DOMTypeInfoImpl(0, 0, (DOMDocumentImpl *)getOwnerDocument());
+
+ return fSchemaType;
+}
+
+
+void DOMAttrImpl::setTypeInfo(const XMLCh* typeName, const XMLCh* typeURI)
+{
+ fSchemaType = new (getOwnerDocument()) DOMTypeInfoImpl(typeName, typeURI, (DOMDocumentImpl *)getOwnerDocument());
}
1.8 +12 -3 xml-xerces/c/src/xercesc/dom/impl/DOMAttrImpl.hpp
Index: DOMAttrImpl.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMAttrImpl.hpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- DOMAttrImpl.hpp 21 Nov 2002 14:19:36 -0000 1.7
+++ DOMAttrImpl.hpp 29 Jan 2003 19:43:08 -0000 1.8
@@ -76,6 +76,7 @@
#include "DOMNodeImpl.hpp"
#include "DOMDocumentImpl.hpp"
#include <xercesc/dom/DOMAttr.hpp>
+#include <xercesc/dom/DOMTypeInfo.hpp>
#include <xercesc/framework/XMLBuffer.hpp>
#include "DOMNodeIDMap.hpp"
@@ -90,6 +91,9 @@
DOMParentNode fParent;
const XMLCh *fName;
+private:
+ const DOMTypeInfo *fSchemaType;
+
public:
DOMAttrImpl(DOMDocument *ownerDocument, const XMLCh *aName);
DOMAttrImpl(const DOMAttrImpl &other, bool deep=false);
@@ -109,8 +113,13 @@
DOMElement *getOwnerElement() const;
void setOwnerElement(DOMElement *ownerElem); //internal use only
- // helper function for DOM Level 3 renameNode
- virtual DOMNode* rename(const XMLCh* namespaceURI, const XMLCh* name);
+ // helper function for DOM Level 3 renameNode
+ virtual DOMNode* rename(const XMLCh* namespaceURI, const XMLCh* name);
+
+ virtual const DOMTypeInfo* getTypeInfo() const;
+
+ //helper function for DOM Level 3 TypeInfo
+ virtual void setTypeInfo(const XMLCh* typeName, const XMLCh* typeURI);
// helper method that sets this attr to an idnode and places it into the document map
virtual void addAttrToIDNodeMap();
1.19 +17 -2 xml-xerces/c/src/xercesc/dom/impl/DOMElementImpl.cpp
Index: DOMElementImpl.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMElementImpl.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- DOMElementImpl.cpp 21 Nov 2002 14:13:01 -0000 1.18
+++ DOMElementImpl.cpp 29 Jan 2003 19:43:08 -0000 1.19
@@ -73,6 +73,7 @@
#include "DOMStringPool.hpp"
#include "DOMCasts.hpp"
#include "DOMElementNSImpl.hpp"
+#include "DOMTypeInfoImpl.hpp"
#include "DOMDeepNodeListImpl.hpp"
#include "DOMDocumentTypeImpl.hpp"
@@ -84,7 +85,7 @@
class DOMAttr;
DOMElementImpl::DOMElementImpl(DOMDocument *ownerDoc, const XMLCh *eName)
- : fNode(ownerDoc), fParent(ownerDoc), fAttributes(0), fDefaultAttributes(0)
+ : fNode(ownerDoc), fParent(ownerDoc), fAttributes(0), fDefaultAttributes(0), fSchemaType(0)
{
DOMDocumentImpl *docImpl = (DOMDocumentImpl *)ownerDoc;
fName = docImpl->getPooledString(eName);
@@ -102,6 +103,7 @@
DOMElementImpl::DOMElementImpl(const DOMElementImpl &other, bool deep)
: fNode(other.getOwnerDocument()),
fParent(other.getOwnerDocument()),
+ fSchemaType(other.fSchemaType),
fAttributes(0),
fDefaultAttributes(0)
{
@@ -681,6 +683,19 @@
return newElem;
}
+}
+
+const DOMTypeInfo *DOMElementImpl::getTypeInfo() const
+{
+ if(!fSchemaType)
+ ((DOMElementImpl *)(this))->fSchemaType = new (getOwnerDocument()) DOMTypeInfoImpl(0, 0, (DOMDocumentImpl *)getOwnerDocument());
+ return fSchemaType;
+}
+
+
+void DOMElementImpl::setTypeInfo(const XMLCh* typeName, const XMLCh* typeURI)
+{
+ fSchemaType = new (getOwnerDocument()) DOMTypeInfoImpl(typeName, typeURI, (DOMDocumentImpl *)getOwnerDocument());
}
XERCES_CPP_NAMESPACE_END
1.6 +10 -2 xml-xerces/c/src/xercesc/dom/impl/DOMElementImpl.hpp
Index: DOMElementImpl.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMElementImpl.hpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- DOMElementImpl.hpp 21 Nov 2002 14:13:01 -0000 1.5
+++ DOMElementImpl.hpp 29 Jan 2003 19:43:08 -0000 1.6
@@ -84,7 +84,7 @@
XERCES_CPP_NAMESPACE_BEGIN
-
+class DOMTypeInfo;
class DOMNodeList;
class DOMAttrMapImpl;
class DOMDocument;
@@ -101,6 +101,9 @@
DOMAttrMapImpl *fDefaultAttributes;
const XMLCh *fName;
+private:
+ const DOMTypeInfo *fSchemaType;
+
public:
DOMElementImpl(DOMDocument *ownerDoc, const XMLCh *name);
@@ -150,6 +153,11 @@
// helper function for DOM Level 3 renameNode
virtual DOMNode* rename(const XMLCh* namespaceURI, const XMLCh* name);
+
+ virtual const DOMTypeInfo * getTypeInfo() const;
+
+ //helper function for DOM Level 3 TypeInfo
+ virtual void setTypeInfo(const XMLCh* typeName, const XMLCh* typeURI);
protected:
// default attribute helper functions
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org