Constructor and Description |
---|
SchemaLoaderUtils() |
Modifier and Type | Method and Description |
---|---|
static String |
getSystemId(org.springframework.core.io.Resource resource)
Retrieves the URL from the given resource as System ID.
|
static Schema |
loadSchema(org.springframework.core.io.Resource[] resources,
String schemaLanguage)
Load schema from the given resource.
|
static Schema |
loadSchema(org.springframework.core.io.Resource resource,
String schemaLanguage)
Load schema from the given resource.
|
public static Schema loadSchema(org.springframework.core.io.Resource resource, String schemaLanguage) throws IOException, SAXException
resource
- the resource to load fromschemaLanguage
- the language of the schema. Can be XMLConstants.W3C_XML_SCHEMA_NS_URI
or
XMLConstants.RELAXNG_NS_URI
.IOException
- if loading failedSAXException
- if loading failedXMLConstants.W3C_XML_SCHEMA_NS_URI
,
XMLConstants.RELAXNG_NS_URI
public static Schema loadSchema(org.springframework.core.io.Resource[] resources, String schemaLanguage) throws IOException, SAXException
resources
- the resources to load fromschemaLanguage
- the language of the schema. Can be XMLConstants.W3C_XML_SCHEMA_NS_URI
or
XMLConstants.RELAXNG_NS_URI
.IOException
- if loading failedSAXException
- if loading failedXMLConstants.W3C_XML_SCHEMA_NS_URI
,
XMLConstants.RELAXNG_NS_URI
public static String getSystemId(org.springframework.core.io.Resource resource)
null
if it cannot be opened.