You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by db...@apache.org on 2001/09/06 20:41:11 UTC
cvs commit: xml-xalan/c/src/XalanTransformer XalanDefaultParsedSource.cpp XalanDefaultParsedSource.hpp XalanTransformer.cpp XalanTransformer.hpp XercesDOMParsedSource.cpp XercesDOMParsedSource.hpp
dbertoni 01/09/06 11:41:11
Modified: c/src/XalanTransformer XalanDefaultParsedSource.cpp
XalanDefaultParsedSource.hpp XalanTransformer.cpp
XalanTransformer.hpp XercesDOMParsedSource.cpp
XercesDOMParsedSource.hpp
Log:
Implemented validation option.
Revision Changes Path
1.5 +7 -2 xml-xalan/c/src/XalanTransformer/XalanDefaultParsedSource.cpp
Index: XalanDefaultParsedSource.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XalanTransformer/XalanDefaultParsedSource.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XalanDefaultParsedSource.cpp 2001/08/21 23:02:59 1.4
+++ XalanDefaultParsedSource.cpp 2001/09/06 18:41:11 1.5
@@ -165,12 +165,17 @@
-XalanDefaultParsedSource::XalanDefaultParsedSource(const XSLTInputSource& theInputSource):
+XalanDefaultParsedSource::XalanDefaultParsedSource(
+ const XSLTInputSource& theInputSource,
+ bool fValidate) :
XalanParsedSource(),
m_domSupport(),
m_parserLiaison(m_domSupport),
- m_parsedSource(m_parserLiaison.mapDocument(m_parserLiaison.parseXMLStream(theInputSource)))
+ m_parsedSource(0)
{
+ m_parserLiaison.setUseValidation(fValidate);
+
+ m_parsedSource = m_parserLiaison.mapDocument(m_parserLiaison.parseXMLStream(theInputSource));
assert(m_parsedSource != 0);
m_domSupport.setParserLiaison(&m_parserLiaison);
1.5 +4 -2 xml-xalan/c/src/XalanTransformer/XalanDefaultParsedSource.hpp
Index: XalanDefaultParsedSource.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XalanTransformer/XalanDefaultParsedSource.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XalanDefaultParsedSource.hpp 2001/08/21 23:02:59 1.4
+++ XalanDefaultParsedSource.hpp 2001/09/06 18:41:11 1.5
@@ -146,7 +146,9 @@
{
public:
- XalanDefaultParsedSource(const XSLTInputSource& theInputSource);
+ XalanDefaultParsedSource(
+ const XSLTInputSource& theInputSource,
+ bool fValidate = false);
virtual
~XalanDefaultParsedSource();
@@ -166,7 +168,7 @@
XalanSourceTreeParserLiaison m_parserLiaison;
- XalanSourceTreeDocument* const m_parsedSource;
+ XalanSourceTreeDocument* m_parsedSource;
XalanDOMString m_uri;
};
1.33 +7 -2 xml-xalan/c/src/XalanTransformer/XalanTransformer.cpp
Index: XalanTransformer.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XalanTransformer/XalanTransformer.cpp,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- XalanTransformer.cpp 2001/08/30 20:45:13 1.32
+++ XalanTransformer.cpp 2001/09/06 18:41:11 1.33
@@ -131,6 +131,7 @@
m_paramPairs(),
m_functionPairs(),
m_errorMessage(1, '\0'),
+ m_useValidation(false),
m_stylesheetExecutionContext(new StylesheetExecutionContextDefault)
{
#if defined(XALAN_USE_ICU)
@@ -274,6 +275,8 @@
XMLParserLiaison& theParserLiaison = theHelper->getParserLiaison();
+ theParserLiaison.setUseValidation(m_useValidation);
+
// Create some more support objects...
XSLTProcessorEnvSupportDefault theXSLTProcessorEnvSupport;
@@ -453,6 +456,8 @@
XMLParserLiaison& theParserLiaison = theHelper->getParserLiaison();
+ theParserLiaison.setUseValidation(m_useValidation);
+
// Create some more support objects...
XSLTProcessorEnvSupportDefault theXSLTProcessorEnvSupport;
@@ -921,11 +926,11 @@
{
if(useXercesDOM == true)
{
- theParsedSource = new XercesDOMParsedSource(theInputSource);
+ theParsedSource = new XercesDOMParsedSource(theInputSource, m_useValidation);
}
else
{
- theParsedSource = new XalanDefaultParsedSource(theInputSource);
+ theParsedSource = new XalanDefaultParsedSource(theInputSource, m_useValidation);
}
// Store it in a vector.
1.33 +27 -0 xml-xalan/c/src/XalanTransformer/XalanTransformer.hpp
Index: XalanTransformer.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XalanTransformer/XalanTransformer.hpp,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- XalanTransformer.hpp 2001/08/30 20:45:13 1.32
+++ XalanTransformer.hpp 2001/09/06 18:41:11 1.33
@@ -423,6 +423,30 @@
const char* expression);
/**
+ * Set a flag to indicate whether or not the source file(s) for the
+ * transformation will be validated.
+ *
+ * @param fValue the new value for the flag.
+ */
+ bool
+ getUseValidation() const
+ {
+ return m_useValidation;
+ }
+
+ /**
+ * Set a flag to indicate whether or not the source file(s) for the
+ * transformation will be validated.
+ *
+ * @param fValue the new value for the flag.
+ */
+ void
+ setUseValidation(bool fValue)
+ {
+ m_useValidation = fValue;
+ }
+
+ /**
* Returns the last error that occurred as a
* result of calling transform.
*
@@ -551,6 +575,9 @@
CharVectorType m_errorMessage;
+ bool m_useValidation;
+
+ // This should always be the latest data member!!!
StylesheetExecutionContextDefault* m_stylesheetExecutionContext;
static const XSLTInit* s_xsltInit;
1.5 +9 -2 xml-xalan/c/src/XalanTransformer/XercesDOMParsedSource.cpp
Index: XercesDOMParsedSource.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XalanTransformer/XercesDOMParsedSource.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XercesDOMParsedSource.cpp 2001/08/21 23:02:59 1.4
+++ XercesDOMParsedSource.cpp 2001/09/06 18:41:11 1.5
@@ -91,11 +91,18 @@
-XercesDOMParsedSource::XercesDOMParsedSource(const XSLTInputSource& theInputSource):
+XercesDOMParsedSource::XercesDOMParsedSource(
+ const XSLTInputSource& theInputSource,
+ bool fValidate):
XalanParsedSource(),
m_parserLiaison(),
- m_parsedSource(m_parserLiaison.parseXMLStream(theInputSource))
+ m_parsedSource(0)
{
+ m_parserLiaison.setUseValidation(fValidate);
+
+ m_parsedSource = m_parserLiaison.parseXMLStream(theInputSource);
+ assert(m_parsedSource != 0);
+
const XalanDOMChar* const theSystemID = theInputSource.getSystemId();
if (theSystemID != 0)
1.5 +4 -2 xml-xalan/c/src/XalanTransformer/XercesDOMParsedSource.hpp
Index: XercesDOMParsedSource.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XalanTransformer/XercesDOMParsedSource.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XercesDOMParsedSource.hpp 2001/08/21 23:02:59 1.4
+++ XercesDOMParsedSource.hpp 2001/09/06 18:41:11 1.5
@@ -85,7 +85,9 @@
{
public:
- XercesDOMParsedSource(const XSLTInputSource& theInputSource);
+ XercesDOMParsedSource(
+ const XSLTInputSource& theInputSource,
+ bool fValidate = false);
virtual
~XercesDOMParsedSource();
@@ -103,7 +105,7 @@
XercesParserLiaison m_parserLiaison;
- XalanDocument* const m_parsedSource;
+ XalanDocument* m_parsedSource;
XalanDOMString m_uri;
};
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org