Is it allowed to have empty import tag in xsd

Is it allowed to have empty import tag in xsd

book

Article ID: KB0083608

calendar_today

Updated On:

Products Versions
TIBCO BusinessEvents Enterprise Edition -

Description

In one of our xsd files, we have an empty import tag as follows:
<import />
The xsd file passes validation but when we have this xsd file in a BE project, we are getting a runtime exception on a serializing event which is referring to unrelated elements. Example:

com.tibco.cep.runtime.model.exception.impl.BEExceptionImpl: org.genxdm.xpath.v20.err.ConcreteErrException: [XPTY0019] A step in a path expression (that is not the last step) is returning atomic values, which is not permitted.
        at org.genxdm.processor.xpath.v20.factories.QmExprAnalyzer.visit(QmExprAnalyzer.java:1299)
        at org.genxdm.processor.xpath.v20.sa.model.impl.AxisStepExpr.accept(AxisStepExpr.java:34)
        at org.genxdm.processor.xpath.v20.factories.QmExprAnalyzer.analyze(QmExprAnalyzer.java:198)
        at org.genxdm.processor.xpath.v20.factories.QmExprAnalyzer.visit(QmExprAnalyzer.java:1584)
        at org.genxdm.processor.xpath.v20.sa.model.impl.ApplyOrderingModeQmExpr.accept(ApplyOrderingModeQmExpr.java:26)
        at org.genxdm.processor.xpath.v20.factories.QmExprAnalyzer.analyze(QmExprAnalyzer.java:198)
        at org.genxdm.processor.xpath.v20.factories.QmExprAnalyzer.visit(QmExprAnalyzer.java:1059)
        at org.genxdm.processor.xpath.v20.sa.model.impl.RelativePathQmExpr.accept(RelativePathQmExpr.java:50)
        at org.genxdm.processor.xpath.v20.factories.QmExprAnalyzer.analyze(QmExprAnalyzer.java:198)
        at org.genxdm.processor.xpath.v20.factories.QmExprAnalyzer.visit(QmExprAnalyzer.java:563)
        at org.genxdm.processor.xpath.v20.sa.model.impl.FunctionCallQmExpr.accept(FunctionCallQmExpr.java:36)
        at org.genxdm.processor.xpath.v20.factories.QmExprAnalyzer.analyze(QmExprAnalyzer.java:198)
        at org.genxdm.processor.xpath.v20.factories.XPathQmExprCompiler.compile(XPathQmExprCompiler.java:53)
        at org.genxdm.processor.xpath.v20.factories.XPathQmExprCompiler.compile(XPathQmExprCompiler.java:41)
        at org.genxdm.processor.xpath.v20.XPath2Toolkit.prepare(XPath2Toolkit.java:113)
        at com.tibco.be.functions.xpath.XPath2Helper.a(SourceFile:339)
        at com.tibco.be.functions.xpath.XPath2Helper.a(SourceFile:150)
        at com.tibco.be.functions.xpath.XPath2Helper.evalAsString(SourceFile:175)
        at com.tibco.be.functions.xpath.XPathHelper.evalAsString(SourceFile:115)
        at com.tibco.be.functions.xpath.XPathHelper.evalAsString2(SourceFile:131)
        at com.tibco.cep.runtime.session.impl.RuleSessionImpl$4.doTxnWork(RuleSessionImpl.java:1150)
        at com.tibco.cep.kernel.core.rete.BeTransaction.run(SourceFile:141)
        at com.tibco.cep.kernel.core.rete.BeTransaction.execute(SourceFile:101)
        at com.tibco.cep.runtime.session.impl.RuleSessionImpl.preprocessPassthru(RuleSessionImpl.java:1174)
        at com.tibco.cep.runtime.service.cluster.ClusterTaskController$1.doTxnWork(ClusterTaskController.java:78)
        at com.tibco.cep.kernel.core.rete.BeTransaction.run(SourceFile:156)
        at com.tibco.cep.kernel.core.rete.BeTransaction.execute(SourceFile:101)
        at com.tibco.cep.runtime.service.cluster.ClusterTaskController.executeTask(ClusterTaskController.java:103)
        at com.tibco.cep.runtime.scheduler.impl.WorkerBasedControllerV2$WorkerTask.run(WorkerBasedControllerV2.java:521)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at com.tibco.cep.runtime.util.CustomBEManagedThread.run(CustomBEManagedThread.java:24)

Resolution

An import statement requires either a namespace or a schemaLocation attribute or both. The empty import statement is causing a resolution error while loading the shared resources and this breaks loading of other resources. Reference to a resource which is not loaded successfully, due to the resolution error, may get the exception as reported.
To resolve the issue, remove the empty import statement from the xsd file.

Issue/Introduction

Is it allowed to have an empty import tag in an xsd file?