I am facing problem in creating a schema if anyone could please assist. I am using Oxygen XML Editor. So the problem is that I have a schema declaration as below:
So what teh above intends is that some element has an 'output' attribute which is optional. But if this attribute is defined, then it cannot have values 'result' or 'isTimedOut' i.e. if in the instance xml I say output="result" then it should not validate.
Now the problem is that in the xml I cannot have the element without 'output' attribute even though I am declaring it as optional. So if the tag does not define the output attrbute then the xml is not validated. Could anyone please suggest how to mandate the optional behaviour for this attribute. Below is the error that Oxygen gives:
Below is the error that Oxygen gives:
view plaincopy to clipboardprint?
Element task does not satisfy assertion (@output ne 'result') and (@output ne 'isTimedOut')
That shouldn't be for a proprely made schema v1.1 support validator. Oxygen probably bundles 3rd parties processors - I do not have Oxygen at my disposal - and that the support of v1.1 is somewhat still "work-in-progress" with compliance improving over time. Hence, you first have to determine which underlying validator you're using and whether it is feasible to update that. That is probably the step you've to take above all.
For a v1.1 compliant schema processor, there should have no need to independently checking for "existence" of output attribute for the test conditions in the xs:assert element. You can do but it should need and if it results in error without, adding existence test would probably not do any better as it signifies the support is already broken at that part.
In the meantime, you can try to rewrite it in a more concise alternative see if it does any magic - I don't expect much, though.