Author: borisk
Date: Wed Nov 4 08:55:59 2009
New Revision: 832686
URL: http://svn.apache.org/viewvc?rev=832686&view=rev
Log:
Disable throwing of an exception from the DOMLSParser::parse*() functions
(XERCESC-1894).
Modified:
xerces/c/trunk/src/xercesc/dom/DOMLSParser.hpp
xerces/c/trunk/src/xercesc/parsers/DOMLSParserImpl.cpp
Modified: xerces/c/trunk/src/xercesc/dom/DOMLSParser.hpp
URL:
http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/dom/DOMLSParser.hpp?rev=832686&r1=832685&r2=832686&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/dom/DOMLSParser.hpp (original)
+++ xerces/c/trunk/src/xercesc/dom/DOMLSParser.hpp Wed Nov 4 08:55:59 2009
@@ -448,7 +448,8 @@
* this method returns.
* @exception DOMException INVALID_STATE_ERR: Raised if the
<code>DOMLSParser::busy</code>
* attribute is true.
- * @exception DOMLSException PARSE_ERR: Raised if the
<code>DOMLSParser</code> was unable
+ * @exception DOMLSException PARSE_ERR: Starting from Xerces-C++ 4.0.0
this exception is
+ * raised if the
<code>DOMLSParser</code> was unable
* to load the XML document. DOM
applications should
* attach a
<code>DOMErrorHandler</code> using the
* parameter "error-handler" if they
wish to get details
@@ -477,7 +478,8 @@
* is returned since the document object is not yet parsed when
this method returns.
* @exception DOMException INVALID_STATE_ERR: Raised if the
<code>DOMLSParser::busy</code>
* attribute is true.
- * @exception DOMLSException PARSE_ERR: Raised if the
<code>DOMLSParser</code> was unable
+ * @exception DOMLSException PARSE_ERR: Starting from Xerces-C++ 4.0.0
this exception is
+ * raised if the
<code>DOMLSParser</code> was unable
* to load the XML document. DOM
applications should
* attach a
<code>DOMErrorHandler</code> using the
* parameter "error-handler" if they
wish to get details
@@ -505,7 +507,8 @@
* is returned since the document object is not yet parsed when
this method returns.
* @exception DOMException INVALID_STATE_ERR: Raised if the
<code>DOMLSParser::busy</code>
* attribute is true.
- * @exception DOMLSException PARSE_ERR: Raised if the
<code>DOMLSParser</code> was unable
+ * @exception DOMLSException PARSE_ERR: Starting from Xerces-C++ 4.0.0
this exception is
+ * raised if the
<code>DOMLSParser</code> was unable
* to load the XML document. DOM
applications should
* attach a
<code>DOMErrorHandler</code> using the
* parameter "error-handler" if they
wish to get details
Modified: xerces/c/trunk/src/xercesc/parsers/DOMLSParserImpl.cpp
URL:
http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/parsers/DOMLSParserImpl.cpp?rev=832686&r1=832685&r2=832686&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/parsers/DOMLSParserImpl.cpp (original)
+++ xerces/c/trunk/src/xercesc/parsers/DOMLSParserImpl.cpp Wed Nov 4 08:55:59
2009
@@ -743,8 +743,10 @@
Wrapper4DOMLSInput isWrapper((DOMLSInput*)source, fEntityResolver, false,
getMemoryManager());
AbstractDOMParser::parse(isWrapper);
- if(getErrorCount()!=0)
- throw DOMLSException(DOMLSException::PARSE_ERR,
XMLDOMMsg::LSParser_ParsingFailed, fMemoryManager);
+
+ // Disabled until 4.0.0. See XERCESC-1894 for details.
+ //if(getErrorCount()!=0)
+ // throw DOMLSException(DOMLSException::PARSE_ERR,
XMLDOMMsg::LSParser_ParsingFailed, fMemoryManager);
if (fUserAdoptsDocument)
return adoptDocument();
@@ -766,8 +768,10 @@
fFilterDelayedTextNodes->removeAll();
AbstractDOMParser::parse(systemId);
- if(getErrorCount()!=0)
- throw DOMLSException(DOMLSException::PARSE_ERR,
XMLDOMMsg::LSParser_ParsingFailed, fMemoryManager);
+
+ // Disabled until 4.0.0. See XERCESC-1894 for details.
+ //if(getErrorCount()!=0)
+ // throw DOMLSException(DOMLSException::PARSE_ERR,
XMLDOMMsg::LSParser_ParsingFailed, fMemoryManager);
if (fUserAdoptsDocument)
return adoptDocument();
@@ -789,8 +793,10 @@
fFilterDelayedTextNodes->removeAll();
AbstractDOMParser::parse(systemId);
- if(getErrorCount()!=0)
- throw DOMLSException(DOMLSException::PARSE_ERR,
XMLDOMMsg::LSParser_ParsingFailed, fMemoryManager);
+
+ // Disabled until 4.0.0. See XERCESC-1894 for details.
+ //if(getErrorCount()!=0)
+ // throw DOMLSException(DOMLSException::PARSE_ERR,
XMLDOMMsg::LSParser_ParsingFailed, fMemoryManager);
if (fUserAdoptsDocument)
return adoptDocument();
@@ -852,7 +858,7 @@
{
if(fWrapNodesInDocumentFragment &&
!(fWrapNodesAction==ACTION_REPLACE_CHILDREN &&
fWrapNodesContext->getNodeType()==DOMNode::DOCUMENT_NODE))
{
- // don't change the properties for the context document, unless the
context node is a
+ // don't change the properties for the context document, unless the
context node is a
// DOMDocument node and the action is ACTION_REPLACE_CHILDREN
}
else
@@ -875,7 +881,7 @@
fFilterDelayedTextNodes->removeAll();
DOMDocumentFragment* holder =
contextNode->getOwnerDocument()->createDocumentFragment();
- // When parsing the input stream, the context node (or its parent,
depending on where
+ // When parsing the input stream, the context node (or its parent,
depending on where
// the result will be inserted) is used for resolving unbound namespace
prefixes
if(action==ACTION_INSERT_BEFORE || action==ACTION_INSERT_AFTER ||
action==ACTION_REPLACE)
fWrapNodesContext = contextNode->getParentNode();
@@ -883,8 +889,8 @@
fWrapNodesContext = contextNode;
fWrapNodesInDocumentFragment = holder;
fWrapNodesAction = action;
- // When calling parseWithContext, the values of the following
configuration parameters
- // will be ignored and their default values will always be used instead:
"validate",
+ // When calling parseWithContext, the values of the following
configuration parameters
+ // will be ignored and their default values will always be used instead:
"validate",
// "validate-if-schema", and "element-content-whitespace".
ValSchemes oldValidate = getValidationScheme();
setValidationScheme(Val_Never);
@@ -935,8 +941,8 @@
}
holder->release();
- // TODO whenever we add support for DOM Mutation Events:
- // As the new data is inserted into the document, at least one mutation
event is fired
+ // TODO whenever we add support for DOM Mutation Events:
+ // As the new data is inserted into the document, at least one mutation
event is fired
// per new immediate child or sibling of the context node.
return result;
}
@@ -1347,7 +1353,7 @@
switch(action)
{
case DOMLSParserFilter::FILTER_ACCEPT: break;
- case DOMLSParserFilter::FILTER_REJECT:
+ case DOMLSParserFilter::FILTER_REJECT:
case DOMLSParserFilter::FILTER_SKIP: if(fFilterAction==0)
fFilterAction=new
(fMemoryManager) ValueHashTableOf<DOMLSParserFilter::FilterAction,
PtrHasher>(7, fMemoryManager);
fFilterAction->put(fCurrentNode, action);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]