tng 2003/01/03 12:09:36
Modified: c/src/xercesc/parsers AbstractDOMParser.cpp
AbstractDOMParser.hpp DOMBuilderImpl.cpp
SAX2XMLReaderImpl.cpp SAXParser.cpp SAXParser.hpp
Log:
New feature StandardUriConformant to force strict standard uri conformance.
Revision Changes Path
1.32 +11 -1 xml-xerces/c/src/xercesc/parsers/AbstractDOMParser.cpp
Index: AbstractDOMParser.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/parsers/AbstractDOMParser.cpp,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- AbstractDOMParser.cpp 30 Dec 2002 14:43:47 -0000 1.31
+++ AbstractDOMParser.cpp 3 Jan 2003 20:09:36 -0000 1.32
@@ -309,6 +309,11 @@
return fScanner->getCalculateSrcOfs();
}
+bool AbstractDOMParser::getStandardUriConformant() const
+{
+ return fScanner->getStandardUriConformant();
+}
+
// ---------------------------------------------------------------------------
// AbstractDOMParser: Setter methods
@@ -374,6 +379,11 @@
void AbstractDOMParser::setCalculateSrcOfs(const bool newState)
{
fScanner->setCalculateSrcOfs(newState);
+}
+
+void AbstractDOMParser::setStandardUriConformant(const bool newState)
+{
+ fScanner->setStandardUriConformant(newState);
}
void AbstractDOMParser::useScanner(const XMLCh* const scannerName)
1.16 +25 -1 xml-xerces/c/src/xercesc/parsers/AbstractDOMParser.hpp
Index: AbstractDOMParser.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/parsers/AbstractDOMParser.hpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- AbstractDOMParser.hpp 30 Dec 2002 20:15:51 -0000 1.15
+++ AbstractDOMParser.hpp 3 Jan 2003 20:09:36 -0000 1.16
@@ -375,6 +375,18 @@
*/
bool getCalculateSrcOfs() const;
+ /**
+ * Get the 'force standard uri flag'
+ *
+ * This method returns the state if the parser forces standard uri
+ *
+ * @return true, if the parser is currently configured to
+ * force standard uri, i.e. malformed uri will be rejected.
+ *
+ * @see #setStandardUriConformant
+ */
+ bool getStandardUriConformant() const;
+
//@}
@@ -637,6 +649,18 @@
* @see #getCalculateSrcOfs
*/
void setCalculateSrcOfs(const bool newState);
+
+ /** Force standard uri
+ *
+ * This method allows users to tell the parser to force standard uri
conformance.
+ *
+ * The parser's default state is: false.
+ *
+ * @param newState The value specifying whether the parser should reject
malformed URI.
+ *
+ * @see #getStandardUriConformant
+ */
+ void setStandardUriConformant(const bool newState);
/** Set the scanner to use when scanning the XML document
*
1.19 +11 -2 xml-xerces/c/src/xercesc/parsers/DOMBuilderImpl.cpp
Index: DOMBuilderImpl.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/parsers/DOMBuilderImpl.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- DOMBuilderImpl.cpp 30 Dec 2002 18:32:48 -0000 1.18
+++ DOMBuilderImpl.cpp 3 Jan 2003 20:09:36 -0000 1.19
@@ -242,6 +242,10 @@
{
getScanner()->setCalculateSrcOfs(state);
}
+ else if (XMLString::compareIString(name, XMLUni::fgXercesStandardUriConformant)
== 0)
+ {
+ getScanner()->setStandardUriConformant(state);
+ }
else {
throw DOMException(DOMException::NOT_FOUND_ERR, 0);
}
@@ -317,6 +321,10 @@
{
return getScanner()->getCalculateSrcOfs();
}
+ else if (XMLString::compareIString(name, XMLUni::fgXercesStandardUriConformant)
== 0)
+ {
+ return getScanner()->getStandardUriConformant();
+ }
else if(XMLString::compareIString(name, XMLUni::fgXercesUserAdoptsDOMDocument)
== 0) {
return fUserAdoptsDocument;
}
@@ -338,7 +346,8 @@
(XMLString::compareIString(name, XMLUni::fgDOMCharsetOverridesXMLEncoding)
== 0) ||
(XMLString::compareIString(name, XMLUni::fgDOMWhitespaceInElementContent)
== 0) ||
(XMLString::compareIString(name, XMLUni::fgXercesUserAdoptsDOMDocument) ==
0) ||
- (XMLString::compareIString(name, XMLUni::fgXercesCalculateSrcOfs) == 0)) {
+ (XMLString::compareIString(name, XMLUni::fgXercesCalculateSrcOfs) == 0) ||
+ (XMLString::compareIString(name, XMLUni::fgXercesStandardUriConformant) ==
0)) {
return true;
}
1.16 +9 -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.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- SAX2XMLReaderImpl.cpp 27 Dec 2002 16:16:51 -0000 1.15
+++ SAX2XMLReaderImpl.cpp 3 Jan 2003 20:09:36 -0000 1.16
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.16 2003/01/03 20:09:36 tng
+ * New feature StandardUriConformant to force strict standard uri conformance.
+ *
* Revision 1.15 2002/12/27 16:16:51 knoaman
* Set scanner options and handlers.
*
@@ -1436,6 +1439,10 @@
{
fScanner->setCalculateSrcOfs(value);
}
+ else if (XMLString::compareIString(name, XMLUni::fgXercesStandardUriConformant)
== 0)
+ {
+ fScanner->setStandardUriConformant(value);
+ }
else
throw SAXNotRecognizedException("Unknown Feature");
}
@@ -1466,6 +1473,8 @@
return fScanner->isUsingCachedGrammarInParse();
else if (XMLString::compareIString(name, XMLUni::fgXercesCalculateSrcOfs) == 0)
return fScanner->getCalculateSrcOfs();
+ else if (XMLString::compareIString(name, XMLUni::fgXercesStandardUriConformant)
== 0)
+ return fScanner->getStandardUriConformant();
else
throw SAXNotRecognizedException("Unknown Feature");
1.13 +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.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- SAXParser.cpp 27 Dec 2002 16:16:51 -0000 1.12
+++ SAXParser.cpp 3 Jan 2003 20:09:36 -0000 1.13
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.13 2003/01/03 20:09:36 tng
+ * New feature StandardUriConformant to force strict standard uri conformance.
+ *
* Revision 1.12 2002/12/27 16:16:51 knoaman
* Set scanner options and handlers.
*
@@ -447,6 +450,11 @@
return fScanner->getCalculateSrcOfs();
}
+bool SAXParser::getStandardUriConformant() const
+{
+ return fScanner->getStandardUriConformant();
+}
+
Grammar* SAXParser::getGrammar(const XMLCh* const nameSpaceKey)
{
return fGrammarResolver->getGrammar(nameSpaceKey);
@@ -548,6 +556,11 @@
void SAXParser::setCalculateSrcOfs(const bool newState)
{
fScanner->setCalculateSrcOfs(newState);
+}
+
+void SAXParser::setStandardUriConformant(const bool newState)
+{
+ fScanner->setStandardUriConformant(newState);
}
void SAXParser::useScanner(const XMLCh* const scannerName)
1.18 +27 -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.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- SAXParser.hpp 30 Dec 2002 20:15:51 -0000 1.17
+++ SAXParser.hpp 3 Jan 2003 20:09:36 -0000 1.18
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.18 2003/01/03 20:09:36 tng
+ * New feature StandardUriConformant to force strict standard uri conformance.
+ *
* Revision 1.17 2002/12/30 20:15:51 knoaman
* Make calculate src offset option false by default.
*
@@ -502,6 +505,18 @@
bool getCalculateSrcOfs() const;
/**
+ * Get the 'force standard uri flag'
+ *
+ * This method returns the state if the parser forces standard uri
+ *
+ * @return true, if the parser is currently configured to
+ * force standard uri, i.e. malformed uri will be rejected.
+ *
+ * @see #setStandardUriConformant
+ */
+ bool getStandardUriConformant() const;
+
+ /**
* Retrieve the grammar that is associated with the specified namespace key
*
* @param nameSpaceKey Namespace key
@@ -774,6 +789,18 @@
* @see #getCalculateSrcOfs
*/
void setCalculateSrcOfs(const bool newState);
+
+ /** Force standard uri
+ *
+ * This method allows users to tell the parser to force standard uri
conformance.
+ *
+ * The parser's default state is: false.
+ *
+ * @param newState The value specifying whether the parser should reject
malformed URI.
+ *
+ * @see #getStandardUriConformant
+ */
+ void setStandardUriConformant(const bool newState);
/** Set the scanner to use when scanning the XML document
*
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]