| 
| Declare a default attribute [message #915342] | Mon, 17 September 2012 00:58  |  | 
| Eclipse User  |  |  |  |  | Hi 
 I am new to schemas. Could anyone please suggest how I can create a schema element for capturing this requirement. 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
 
 Thanks
 |  |  |  | 
| 
| Re: Declare a default attribute [message #915347 is a reply to message #915342] | Mon, 17 September 2012 01:13  |  | 
| Eclipse User  |  |  |  |  | Dorothy, 
 Comments below.
 
 On 17/09/2012 6:58 AM, Dorothy Taylor wrote:
 > Hi
 >
 > 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.
 
 http://www.w3.org/TR/xmlschema-1/#Wildcards
 
 Probably you'll want this form: <xs:any namespace="##other"
 processContents="lax"/>
 >
 > Thanks
 |  |  |  | 
Powered by 
FUDForum. Page generated in 0.03438 seconds