gareth 2003/08/14 09:31:13
Modified: c/src/xercesc/dom/impl DOMWriterImpl.cpp DOMWriterImpl.hpp
Log:
Method added to allow serilization of custom nodes from derived classes.
Revision Changes Path
1.41 +14 -5 xml-xerces/c/src/xercesc/dom/impl/DOMWriterImpl.cpp
Index: DOMWriterImpl.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMWriterImpl.cpp,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- DOMWriterImpl.cpp 12 Aug 2003 12:46:57 -0000 1.40
+++ DOMWriterImpl.cpp 14 Aug 2003 16:31:13 -0000 1.41
@@ -57,6 +57,9 @@
/*
* $Id$
* $Log$
+ * Revision 1.41 2003/08/14 16:31:13 gareth
+ * Method added to allow serilization of custom nodes from derived classes.
+ *
* Revision 1.40 2003/08/12 12:46:57 gareth
* Added serialization for attribute nodes. Patch by Caroline Rioux.
*
@@ -1367,17 +1370,23 @@
default:
/***
- This is an implementation specific behaviour, we abort serialization
- once unrecognized node type encountered.
+ This is an implementation specific behaviour, we abort if a user
derived class has not dealt with
+ this node type.
***/
{
- reportError(nodeToWrite, DOMError::DOM_SEVERITY_FATAL_ERROR,
XMLDOMMsg::Writer_NotRecognizedType);
- // UnreognizedNodeType;
+ if(!customNodeSerialize(nodeToWrite, level)) {
+ reportError(nodeToWrite, DOMError::DOM_SEVERITY_FATAL_ERROR,
XMLDOMMsg::Writer_NotRecognizedType);
+ // UnreognizedNodeType;
+ }
}
break;
}
+}
+
+bool DOMWriterImpl::customNodeSerialize(const DOMNode* const nodeToWrite, int
level) {
+ return false;
}
//
1.18 +21 -9 xml-xerces/c/src/xercesc/dom/impl/DOMWriterImpl.hpp
Index: DOMWriterImpl.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMWriterImpl.hpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- DOMWriterImpl.hpp 29 May 2003 18:47:52 -0000 1.17
+++ DOMWriterImpl.hpp 14 Aug 2003 16:31:13 -0000 1.18
@@ -57,6 +57,9 @@
/*
* $Id$
* $Log$
+ * Revision 1.18 2003/08/14 16:31:13 gareth
+ * Method added to allow serilization of custom nodes from derived classes.
+ *
* Revision 1.17 2003/05/29 18:47:52 knoaman
* Apply memory manager.
*
@@ -402,6 +405,23 @@
/** helper **/
void initSession(const DOMNode* const);
void processNode(const DOMNode* const);
+
+ void procCdataSection(const XMLCh* const nodeValue
+ , const DOMNode* const nodeToWrite
+ , int level);
+
+ void procUnrepCharInCdataSection(const XMLCh* const
nodeValue
+ , const DOMNode* const
nodeToWrite
+ , int level);
+
+protected:
+ /**
+ * Overidden by derived classes to extend the abilities of the standard writer
+ * always returns false in the default implementation
+ * @return true if the method deals with nodeToWrite
+ */
+ virtual bool customNodeSerialize(const DOMNode* const
nodeToWrite, int level);
+
DOMNodeFilter::FilterAction checkFilter(const DOMNode* const) const;
bool checkFeature(const XMLCh* const featName
@@ -414,14 +434,6 @@
bool reportError(const DOMNode* const errorNode
, DOMError::ErrorSeverity errorType
, XMLDOMMsg::Codes toEmit);
-
- void procCdataSection(const XMLCh* const nodeValue
- , const DOMNode* const nodeToWrite
- , int level);
-
- void procUnrepCharInCdataSection(const XMLCh* const
nodeValue
- , const DOMNode* const
nodeToWrite
- , int level);
bool canSetFeature(const int featureId
, bool val) const;
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]