]
Thomas Diesler resolved JBXB-33.
--------------------------------
Resolution: Out of Date
Util Class: Util method to pass a
StringList/SchemaBindingResolver/Error Handler
---------------------------------------------------------------------------------
Key: JBXB-33
URL:
http://jira.jboss.com/jira/browse/JBXB-33
Project: JBoss XML Binding (JBossXB)
Issue Type: Feature Request
Reporter: Anil Saldhana
Assigned To: Alexey Loubyansky
This is a feature request from JBoss Web Services Tools.
In order for me to migrate the parsing of multiple schema files to the JBossXB layer, I
need the following method in the Util class:
public static XSModel loadSchema(StringList xsdList, SchemaBindingResolver
schemaResolver,SchemaBindingErrorHandler schemaErrorHandler)
Note: SchemaBindingErrorHandler can be a JBossXB class that internally holds
org.apache.xerces.xni.parser.XMLErrorHandler as an implementation detail.
I did test the following method:
===========================================================================
/**
* Loads a Xerces based Schema Model provided a list of Strings representing
* schema files. Also a SchemaBindingResolver can be passed to the parser.
* @param xsdURL
* @param schemaResolver
* @return
*/
public static XSModel loadSchema(StringList xsdList, SchemaBindingResolver
schemaResolver)
{
XSImplementation impl = getXSImplementation();
XSLoader schemaLoader = impl.createXSLoader(null);
if(schemaResolver != null)
{
setResourceResolver(schemaLoader, schemaResolver);
}
XSModel model = schemaLoader.loadURIList(xsdList);
if(model == null)
{
throw new IllegalArgumentException("Invalid schema");
}
return model;
}
======================================================
I did not make the change because I need to pass an instance of
org.apache.xerces.xni.parser.XMLErrorHandler to the Xerces parsers
and I felt that you would be able to find a better way of passing an error handler to the
parsers (while hiding the Xerces details like
XMLErrorHandler as an implementation detail).
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: