4,10 → 4,10 |
* Coded by: Group 5, software practice summer 2003 |
* University of Bielefeld, Germany |
* |
* @version $Revision: 1.41 $ |
* @version $Revision: 1.42 $ |
* |
* Last modification: $Date: 2003/07/17 16:02:03 $ |
* $Id: Validator.java,v 1.41 2003/07/17 16:02:03 smcsporr Exp $ |
* Last modification: $Date: 2003/07/17 16:50:58 $ |
* $Id: Validator.java,v 1.42 2003/07/17 16:50:58 smcsporr Exp $ |
*/ |
|
package src.parser; |
27,9 → 27,9 |
import javax.xml.transform.stream.StreamResult; |
import javax.xml.transform.OutputKeys; |
|
import org.apache.xml.serializer.OutputPropertiesFactory; |
import org.apache.xml.serializer.Serializer; |
import org.apache.xml.serializer.SerializerFactory; |
//import org.apache.xml.serializer.OutputPropertiesFactory; |
//import org.apache.xml.serializer.Serializer; |
//import org.apache.xml.serializer.SerializerFactory; |
|
import org.w3c.dom.Document; |
|
50,7 → 50,7 |
* |
* @author S. McSporran |
* |
* @version $Revision: 1.41 $ Last modification: $Date: 2003/07/17 16:02:03 $ |
* @version $Revision: 1.42 $ Last modification: $Date: 2003/07/17 16:50:58 $ |
*/ |
public class Validator { |
|
104,6 → 104,7 |
/* Activate the needed parser features. */ |
activateNamespaceProcessing(); |
activateValidation(); |
activateDynamicValidation(); |
activateSchemaSupport(); |
} |
|
124,6 → 125,7 |
/* Activate the needed parser features. */ |
activateNamespaceProcessing(); |
activateValidation(); |
activateDynamicValidation(); |
activateSchemaSupport(); |
} |
|
225,9 → 227,9 |
try |
{ |
/* Turn dynamic validation on, if the feature is deactivated. */ |
if (! activeParser.getFeature("http://xml.org/sax/features/validation/dynamic")) |
if (! activeParser.getFeature("http://apache.org/xml/features/validation/dynamic")) |
{ |
activeParser.setFeature("http://xml.org/sax/features/validation/dynamic", true); |
activeParser.setFeature("http://apache.org/xml/features/validation/dynamic", true); |
} |
} |
|
259,9 → 261,9 |
try |
{ |
/* Turn dynamic validation on, if the feature is deactivated. */ |
if (! activeParser.getFeature("http://xml.org/sax/features/validation/schema")) |
if (! activeParser.getFeature("http://apache.org/xml/features/validation/schema")) |
{ |
activeParser.setFeature("http://xml.org/sax/features/validation/schema", true); |
activeParser.setFeature("http://apache.org/xml/features/validation/schema", true); |
} |
} |
|
327,9 → 329,9 |
try |
{ |
/* Turn break on fatal errors off. */ |
if (! activeParser.getFeature("http://xml.org/sax/features/continue-after-fatal-error")) |
if (! activeParser.getFeature("http://apache.org/xml/features/continue-after-fatal-error")) |
{ |
activeParser.setFeature("http://xml.org/sax/features/continue-after-fatal-error", true); |
activeParser.setFeature("http://apache.org/xml/features/continue-after-fatal-error", true); |
} |
} |
|
364,6 → 366,34 |
|
try { |
|
try { |
|
if (activeParser.getFeature("http://xml.org/sax/features/validation")) { |
|
log(LogInterface.TYPE_INFO, "Validation available !"); |
} |
|
if (activeParser.getFeature("http://apache.org/xml/features/validation/schema")) { |
|
log(LogInterface.TYPE_INFO, "Schema validation available !"); |
} |
|
if (activeParser.getFeature("http://apache.org/xml/features/validation/dynamic")) { |
|
log(LogInterface.TYPE_INFO, "Dynamic validation available !"); |
} |
} |
|
catch (SAXNotRecognizedException snre) { |
|
log(LogInterface.TYPE_ERROR, "Not recognized"); |
} |
|
catch (SAXNotSupportedException snre) { |
|
log(LogInterface.TYPE_ERROR, "Not supported"); |
} |
|
log(LogInterface.TYPE_WARNING, docFile.toString()); |
|
/* Set transformation source to the DOM object. */ |