|Re: Declare a default attribute [message #915347 is a reply to message #915342]
||Mon, 17 September 2012 05:13
| Ed Merks
Registered: July 2009
On 17/09/2012 6:58 AM, Dorothy Taylor wrote:
> I am new to schemas. Could anyone please suggest how I can create a
> schema element for capturing this requirement.
Note that this form is specifically for asking about how to use the
org.eclipse.xsd API, not a general forum for asking about XML Schema.
> Basically I want to have an xml tag such that it executes a Linux
> command say, <task name ="A" command="ls" /> I want that without
> specifying the Result attribute in this tag, I should be able to
> capture the result (success or failure) of the command in a global
> 'result' variable. Is there a way I can declare the 'Result' in my
> xsd(sxhema)? When I will write the engine for this xml-xsd in java, at
> that time, the behaviour of the 'Result' is that the result of the
> last executed task element will be stored in it, without even the
> schema-instance being aware of it
You could define the complex type for the "task" element to define an
xsd:any so you can nest arbitrary XML content within the "task" element.
Probably you'll want this form: <xs:any namespace="##other"
Professional Support: https://www.macromodeling.com/
Powered by FUDForum
. Page generated in 0.02150 seconds