Home Products Consulting About Us White Papers Careers Contact Us Tutorials
 

 Download Delve® SOA Fast-Prototyping Toolkit (Beta 1.0)

Tutorials - How to Declare Attributes with Defaults or Optional Values
Page 1 of 2

In the lesson “How to Declare an XML Element with Properties” we took a look at how to go about declaring an XML element with XML-Schema properties. The same basic technique applies to XML attributes as well, and in this lesson we’ll take a look at the two properties most often applied to attributes, “optional” and “default.”

XML-Schema uses the “default” property to designate an attribute as possessing a default value. This means that if a document containing that attribute doesn’t assign an explicit value to the attribute, it is assumed to have the default value. To designate properties values in Tectonic, we use the verbose form of attribute declaration, which starts with the keyword “attribute” followed by the name of the attribute being declared.

 

 

The example shown above defines the type “school” as having an attribute “school-name” with a default value of “Valley High.”


 Download Delve® SOA Fast-Prototyping Toolkit (Beta 1.0)
Next Step

Move On To Next Step - "Creating a XML Element Instance From a Schema Definition"

Read a Detailed Product Description

Read About Delve and XML-Schema Documents in Detail

Browse Product White Papers

 
Home Products Consulting About Us White Papers Careers Contact Us Tutorials