You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by tn...@apache.org on 2002/05/30 18:20:09 UTC
cvs commit: xml-xerces/c/src/xercesc/parsers SAX2XMLReaderImpl.cpp SAX2XMLReaderImpl.hpp SAXParser.cpp SAXParser.hpp
tng 02/05/30 09:20:09
Modified: c/src/xercesc/parsers SAX2XMLReaderImpl.cpp
SAX2XMLReaderImpl.hpp SAXParser.cpp SAXParser.hpp
Log:
Add feature to optionally ignore external DTD.
Revision Changes Path
1.7 +10 -0 xml-xerces/c/src/xercesc/parsers/SAX2XMLReaderImpl.cpp
Index: SAX2XMLReaderImpl.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/parsers/SAX2XMLReaderImpl.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- SAX2XMLReaderImpl.cpp 29 May 2002 21:37:47 -0000 1.6
+++ SAX2XMLReaderImpl.cpp 30 May 2002 16:20:09 -0000 1.7
@@ -56,6 +56,9 @@
/*
* $Log: SAX2XMLReaderImpl.cpp,v $
+ * Revision 1.7 2002/05/30 16:20:09 tng
+ * Add feature to optionally ignore external DTD.
+ *
* Revision 1.6 2002/05/29 21:37:47 knoaman
* Add baseURI to resolveEntity to support DOMInputSource.
*
@@ -1368,6 +1371,11 @@
fScanner->setValidationSchemaFullChecking(value);
}
+ else if (XMLString::compareIString(name, XMLUni::fgSAX2XercesLoadExternalDTD) == 0)
+ {
+ fScanner->setLoadExternalDTD(value);
+ }
+
else
throw SAXNotRecognizedException("Unknown Feature");
}
@@ -1390,6 +1398,8 @@
return getDoSchema();
else if (XMLString::compareIString(name, XMLUni::fgSAX2XercesSchemaFullChecking) == 0)
return fScanner->getValidationSchemaFullChecking();
+ else if (XMLString::compareIString(name, XMLUni::fgSAX2XercesLoadExternalDTD) == 0)
+ return fScanner->getLoadExternalDTD();
else
throw SAXNotRecognizedException("Unknown Feature");
return false;
1.6 +4 -0 xml-xerces/c/src/xercesc/parsers/SAX2XMLReaderImpl.hpp
Index: SAX2XMLReaderImpl.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/parsers/SAX2XMLReaderImpl.hpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- SAX2XMLReaderImpl.hpp 29 May 2002 21:37:47 -0000 1.5
+++ SAX2XMLReaderImpl.hpp 30 May 2002 16:20:09 -0000 1.6
@@ -56,6 +56,9 @@
/*
* $Log: SAX2XMLReaderImpl.hpp,v $
+ * Revision 1.6 2002/05/30 16:20:09 tng
+ * Add feature to optionally ignore external DTD.
+ *
* Revision 1.5 2002/05/29 21:37:47 knoaman
* Add baseURI to resolveEntity to support DOMInputSource.
*
@@ -697,6 +700,7 @@
* <br>http://apache.org/xml/features/validation/reuse-grammar (default: false)
* <br>http://apache.org/xml/features/validation/schema (default: true)
* <br>http://apache.org/xml/features/validation/schema-full-checking (default: false)
+ * <br>http://apache.org/xml/features/nonvalidating/load-external-dtd (default: true)
* <br>http://apache.org/xml/features/validation/reuse-validator (Deprecated) (default: false)
*
* @param name The unique identifier (URI) of the feature.
1.6 +13 -0 xml-xerces/c/src/xercesc/parsers/SAXParser.cpp
Index: SAXParser.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/parsers/SAXParser.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- SAXParser.cpp 29 May 2002 21:37:47 -0000 1.5
+++ SAXParser.cpp 30 May 2002 16:20:09 -0000 1.6
@@ -56,6 +56,9 @@
/*
* $Log: SAXParser.cpp,v $
+ * Revision 1.6 2002/05/30 16:20:09 tng
+ * Add feature to optionally ignore external DTD.
+ *
* Revision 1.5 2002/05/29 21:37:47 knoaman
* Add baseURI to resolveEntity to support DOMInputSource.
*
@@ -367,6 +370,11 @@
return fScanner->getExternalNoNamespaceSchemaLocation();
}
+bool SAXParser::getLoadExternalDTD() const
+{
+ return fScanner->getLoadExternalDTD();
+}
+
// ---------------------------------------------------------------------------
// SAXParser: Setter methods
@@ -425,6 +433,11 @@
void SAXParser::setExternalNoNamespaceSchemaLocation(const char* const noNamespaceSchemaLocation)
{
fScanner->setExternalNoNamespaceSchemaLocation(noNamespaceSchemaLocation);
+}
+
+void SAXParser::setLoadExternalDTD(const bool newState)
+{
+ fScanner->setLoadExternalDTD(newState);
}
1.6 +36 -0 xml-xerces/c/src/xercesc/parsers/SAXParser.hpp
Index: SAXParser.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/parsers/SAXParser.hpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- SAXParser.hpp 29 May 2002 21:37:47 -0000 1.5
+++ SAXParser.hpp 30 May 2002 16:20:09 -0000 1.6
@@ -56,6 +56,9 @@
/*
* $Log: SAXParser.hpp,v $
+ * Revision 1.6 2002/05/30 16:20:09 tng
+ * Add feature to optionally ignore external DTD.
+ *
* Revision 1.5 2002/05/29 21:37:47 knoaman
* Add baseURI to resolveEntity to support DOMInputSource.
*
@@ -407,6 +410,20 @@
*/
XMLCh* getExternalNoNamespaceSchemaLocation() const;
+ /** Get the 'Loading External DTD' flag
+ *
+ * This method returns the state of the parser's loading external DTD
+ * flag.
+ *
+ * @return false, if the parser is currently configured to
+ * ignore external DTD completely, true otherwise.
+ *
+ * @see #setLoadExternalDTD
+ * @see #getValidationScheme
+ */
+ bool getLoadExternalDTD() const;
+
+
//@}
@@ -577,6 +594,25 @@
* @see #setExternalNoNamespaceSchemaLocation(const XMLCh* const)
*/
void setExternalNoNamespaceSchemaLocation(const char* const noNamespaceSchemaLocation);
+
+ /** Set the 'Loading External DTD' flag
+ *
+ * This method allows users to enable or disable the loading of external DTD.
+ * When set to false, the parser will ignore any external DTD completely
+ * if the validationScheme is set to Val_Never.
+ *
+ * The parser's default state is: true.
+ *
+ * This flag is ignored if the validationScheme is set to Val_Always or Val_Auto.
+ *
+ * @param newState The value specifying whether external DTD should
+ * be loaded or not.
+ *
+ * @see #getLoadExternalDTD
+ * @see #setValidationScheme
+ */
+ void setLoadExternalDTD(const bool newState);
+
//@}
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org