Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » XML Schema Definition (XSD) » Declare a default attribute
Declare a default attribute [message #915342] Mon, 17 September 2012 04:58 Go to next message
Dorothy Taylor is currently offline Dorothy TaylorFriend
Messages: 2
Registered: March 2012
Junior Member
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 05:13 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 26231
Registered: July 2009
Senior Member
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
Previous Topic:Schema default value not honored for complex type
Next Topic:create XML document based on XSDElementDeclaration
Goto Forum:
  


Current Time: Thu Nov 27 09:57:50 GMT 2014

Powered by FUDForum. Page generated in 0.01632 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software