Skip to content

Commit

Permalink
Use inputStream when parsing prism schema
Browse files Browse the repository at this point in the history
  • Loading branch information
tonydamage committed Mar 2, 2021
1 parent 9dbe7e5 commit e2e3265
Showing 1 changed file with 3 additions and 2 deletions.
Expand Up @@ -31,6 +31,7 @@
import org.apache.xml.resolver.tools.CatalogResolver;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.TestOnly;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.xml.sax.EntityResolver;
Expand Down Expand Up @@ -608,12 +609,11 @@ private void resolveMissingTypeDefinitionsInGlobalItemDefinitions(PrismSchemaImp
private void parsePrismSchema(SchemaDescriptionImpl schemaDescription, boolean allowDelayedItemDefinitions) throws SchemaException {
String namespace = schemaDescription.getNamespace();

Element domElement = schemaDescription.getDomElement();
boolean isRuntime = schemaDescription.getCompileTimeClassesPackage() == null;
long started = System.currentTimeMillis();
LOGGER.trace("Parsing schema {}, namespace: {}, isRuntime: {}",
schemaDescription.getSourceDescription(), namespace, isRuntime);
PrismSchema schema = PrismSchemaImpl.parse(domElement, entityResolver, isRuntime,
PrismSchema schema = PrismSchemaImpl.parse(schemaDescription.schemaSource(), entityResolver, isRuntime,
schemaDescription.getSourceDescription(), allowDelayedItemDefinitions, getPrismContext());
if (StringUtils.isEmpty(namespace)) {
namespace = schema.getNamespace();
Expand Down Expand Up @@ -752,6 +752,7 @@ private void initResolver() throws IOException {

//region Schemas and type maps (TODO)
@Override
@TestOnly
public javax.xml.validation.Schema getJavaxSchema() {
return javaxSchema;
}
Expand Down

0 comments on commit e2e3265

Please sign in to comment.