This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes assert error using schema 1.1 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "assert error using schema 1.1" Watch "assert error using schema 1.1" New topic
Author

assert error using schema 1.1

Dorothy Taylor
Ranch Hand

Joined: Nov 26, 2007
Posts: 104
Hi

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:
g tsuji
Ranch Hand

Joined: Jan 18, 2011
Posts: 499
    
    3
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.
Dorothy Taylor
Ranch Hand

Joined: Nov 26, 2007
Posts: 104
I changed it as below and it is working now:

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: assert error using schema 1.1
 
Similar Threads
Inhertiting complex type in XML Schema
Problem with parsing xml against schema using SAX2Parser
why Axis doesn't preserve Inheritance ?
Using BizTalk Schema for cXML