Skip to content
Snippets Groups Projects
Commit ba04761b authored by PeiYong Zhang's avatar PeiYong Zhang
Browse files

constants changed

git-svn-id: https://svn.apache.org/repos/asf/xerces/c/trunk@173786 13f79535-47bb-0310-9956-ffa450edef68
parent e9c31f3a
No related branches found
No related tags found
No related merge requests found
...@@ -57,6 +57,9 @@ ...@@ -57,6 +57,9 @@
/* /*
* $Id$ * $Id$
* $Log$ * $Log$
* Revision 1.4 2002/06/03 22:35:54 peiyongz
* constants changed
*
* Revision 1.3 2002/05/31 21:01:06 peiyongz * Revision 1.3 2002/05/31 21:01:06 peiyongz
* move printing of XMLDecl into the processNode(). * move printing of XMLDecl into the processNode().
* *
...@@ -76,6 +79,7 @@ ...@@ -76,6 +79,7 @@
#include <xercesc/framework/MemBufFormatTarget.hpp> #include <xercesc/framework/MemBufFormatTarget.hpp>
#include <xercesc/util/XMLUniDefs.hpp> #include <xercesc/util/XMLUniDefs.hpp>
#include <xercesc/util/XMLUni.hpp>
#include <xercesc/util/TranscodingException.hpp> #include <xercesc/util/TranscodingException.hpp>
#include <xercesc/util/Janitor.hpp> #include <xercesc/util/Janitor.hpp>
...@@ -283,22 +287,22 @@ DOMWriterImpl::DOMWriterImpl() ...@@ -283,22 +287,22 @@ DOMWriterImpl::DOMWriterImpl()
{ {
fFeatures = new RefHashTableOf<KVStringPair>(9, true); fFeatures = new RefHashTableOf<KVStringPair>(9, true);
fFeatures->put((void*)CanonicalForm, fFeatures->put((void*)XMLUni::fgDOMWRTCanonicalForm,
new KVStringPair(CanonicalForm, gFalse)); new KVStringPair(XMLUni::fgDOMWRTCanonicalForm, gFalse));
fFeatures->put((void*)DiscardDefaultContent, fFeatures->put((void*)XMLUni::fgDOMWRTDiscardDefaultContent,
new KVStringPair(DiscardDefaultContent, gTrue)); new KVStringPair(XMLUni::fgDOMWRTDiscardDefaultContent, gTrue));
fFeatures->put((void*)Entities, fFeatures->put((void*)XMLUni::fgDOMWRTEntities,
new KVStringPair(Entities, gTrue)); new KVStringPair(XMLUni::fgDOMWRTEntities, gTrue));
fFeatures->put((void*)FormatPrettyPrint, fFeatures->put((void*)XMLUni::fgDOMWRTFormatPrettyPrint,
new KVStringPair(FormatPrettyPrint, gFalse)); new KVStringPair(XMLUni::fgDOMWRTFormatPrettyPrint, gFalse));
fFeatures->put((void*)NormalizeCharacters, fFeatures->put((void*)XMLUni::fgDOMWRTNormalizeCharacters,
new KVStringPair(NormalizeCharacters, gFalse)); new KVStringPair(XMLUni::fgDOMWRTNormalizeCharacters, gFalse));
fFeatures->put((void*)SplitCdataSections, fFeatures->put((void*)XMLUni::fgDOMWRTSplitCdataSections,
new KVStringPair(SplitCdataSections, gTrue)); new KVStringPair(XMLUni::fgDOMWRTSplitCdataSections, gTrue));
fFeatures->put((void*)Validation, fFeatures->put((void*)XMLUni::fgDOMWRTValidation,
new KVStringPair(Validation, gFalse)); new KVStringPair(XMLUni::fgDOMWRTValidation, gFalse));
fFeatures->put((void*)WhitespaceInElementContent, fFeatures->put((void*)XMLUni::fgDOMWRTWhitespaceInElementContent,
new KVStringPair(WhitespaceInElementContent, gTrue)); new KVStringPair(XMLUni::fgDOMWRTWhitespaceInElementContent, gTrue));
} }
// //
...@@ -311,15 +315,15 @@ bool DOMWriterImpl::canSetFeature(const XMLCh* const featName ...@@ -311,15 +315,15 @@ bool DOMWriterImpl::canSetFeature(const XMLCh* const featName
if ((!featName) || (!fFeatures->get(featName))) if ((!featName) || (!fFeatures->get(featName)))
return false; return false;
if ((XMLString::compareString(featName, CanonicalForm)==0) && state) if ((XMLString::compareString(featName, XMLUni::fgDOMWRTCanonicalForm)==0) && state)
return false; return false;
else if ((XMLString::compareString(featName, FormatPrettyPrint)==0) && state) else if ((XMLString::compareString(featName, XMLUni::fgDOMWRTFormatPrettyPrint)==0) && state)
return false; return false;
else if ((XMLString::compareString(featName, NormalizeCharacters)==0) && state) else if ((XMLString::compareString(featName, XMLUni::fgDOMWRTNormalizeCharacters)==0) && state)
return false; return false;
else if ((XMLString::compareString(featName, Validation)==0) && state) else if ((XMLString::compareString(featName, XMLUni::fgDOMWRTValidation)==0) && state)
return false; return false;
else if ((XMLString::compareString(featName, WhitespaceInElementContent)==0) && !state) else if ((XMLString::compareString(featName, XMLUni::fgDOMWRTWhitespaceInElementContent)==0) && !state)
return false; return false;
else else
return true; return true;
...@@ -665,7 +669,7 @@ void DOMWriterImpl::processNode(const DOMNode* const nodeToWrite) ...@@ -665,7 +669,7 @@ void DOMWriterImpl::processNode(const DOMNode* const nodeToWrite)
DOMNamedNodeMap *attributes = nodeToWrite->getAttributes(); DOMNamedNodeMap *attributes = nodeToWrite->getAttributes();
int attrCount = attributes->getLength(); int attrCount = attributes->getLength();
bool discard = getFeature(DiscardDefaultContent); bool discard = getFeature(XMLUni::fgDOMWRTDiscardDefaultContent);
for (int i = 0; i < attrCount; i++) for (int i = 0; i < attrCount; i++)
{ {
DOMNode *attribute = attributes->item(i); DOMNode *attribute = attributes->item(i);
...@@ -773,7 +777,7 @@ void DOMWriterImpl::processNode(const DOMNode* const nodeToWrite) ...@@ -773,7 +777,7 @@ void DOMWriterImpl::processNode(const DOMNode* const nodeToWrite)
if (checkFilter(nodeToWrite) != DOMNodeFilter::FILTER_ACCEPT) if (checkFilter(nodeToWrite) != DOMNodeFilter::FILTER_ACCEPT)
break; break;
if (getFeature(Entities)) if (getFeature(XMLUni::fgDOMWRTEntities))
{ {
TRY_CATCH_THROW TRY_CATCH_THROW
( (
...@@ -806,7 +810,7 @@ void DOMWriterImpl::processNode(const DOMNode* const nodeToWrite) ...@@ -806,7 +810,7 @@ void DOMWriterImpl::processNode(const DOMNode* const nodeToWrite)
, true , true
) )
if (getFeature(SplitCdataSections)) if (getFeature(XMLUni::fgDOMWRTSplitCdataSections))
{ {
setURCharRef(); setURCharRef();
*fFormatter << nodeValue; *fFormatter << nodeValue;
...@@ -952,11 +956,19 @@ void DOMWriterImpl::processNode(const DOMNode* const nodeToWrite) ...@@ -952,11 +956,19 @@ void DOMWriterImpl::processNode(const DOMNode* const nodeToWrite)
} }
//
//
DOMNodeFilter::FilterAction DOMWriterImpl::checkFilter(const DOMNode* const node) const DOMNodeFilter::FilterAction DOMWriterImpl::checkFilter(const DOMNode* const node) const
{ {
if (!fFilter || (fFilter->showNode(node) == false)) if (!fFilter ||
((fFilter->getWhatToShow() & (1 << (node->getNodeType() - 1))) == 0))
return DOMNodeFilter::FILTER_ACCEPT; return DOMNodeFilter::FILTER_ACCEPT;
//
// if and only if there is a filter, and it is interested
// in the node type, then we pass the node to the filter
// for examination
//
return (DOMNodeFilter::FilterAction) fFilter->acceptNode(node); return (DOMNodeFilter::FilterAction) fFilter->acceptNode(node);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment