Am Montag, den 03.12.2007, 20:57 +0000 schrieb [EMAIL PROTECTED]:
> Author: dkulp
> Date: Mon Dec 3 12:57:52 2007
> New Revision: 600686
>
> URL: http://svn.apache.org/viewvc?rev=600686&view=rev
> Log:
> [CXF-1219] Allow use of parsers that don't support validation
>
> Modified:
>
> incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/XMLTypeCreator.java
>
> Modified:
> incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/XMLTypeCreator.java
> URL:
> http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/XMLTypeCreator.java?rev=600686&r1=600685&r2=600686&view=diff
> ==============================================================================
> ---
> incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/XMLTypeCreator.java
> (original)
> +++
> incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/XMLTypeCreator.java
> Mon Dec 3 12:57:52 2007
> @@ -112,12 +112,17 @@
> InputStream is = XMLTypeCreator.class.getResourceAsStream(path);
> if (is != null) {
> try {
> + aegisDocumentBuilderFactory =
> DocumentBuilderFactory.newInstance();
> +
> +
> SchemaFactory schemaFactory =
> SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
> aegisSchema = schemaFactory.newSchema(new StreamSource(is));
> is.close();
> -
> - aegisDocumentBuilderFactory =
> DocumentBuilderFactory.newInstance();
> +
> aegisDocumentBuilderFactory.setSchema(aegisSchema);
> + } catch (UnsupportedOperationException e) {
> + //Parsers that don't support schema validation
> + LOG.info("Parser doesn't support setSchema. Not
> validating.", e);
Question: For Aegis databinding, does validation occur all the time
automatically, or only if the user explicitly requests it (such as for
example with our wsdl2java "-v" option?) If the latter, I would think
it would be better for CXF to halt with an error message, requiring the
user to either supply a parser that validates, or to turn off the
request for validation.
I'm assuming if the user has the choice for validation, and they
selected it, that it is important to them. It may not be safe to just
run with an LOG.info (or even WARN) message--because they may not see
it.
Glen
> } catch (IOException ie) {
> LOG.error("Error reading Aegis schema", ie);
> } catch (FactoryConfigurationError e) {
>
>