Attribute and Attribute Reference Properties in XML Schemas

Both global and local attributes have the properties described in the Table 75. References to attributes have the same properties, except where noted.

Property
Description
Type
For attributes, the type is always Attribute. For attribute references, the type is always Ref. to Attribute.
Name
The attribute name you use in an instance document. Specify the name you want the attribute to have.
Data Type
The type of the data that is the value of the attribute. Select from all simpleTypes defined in an XML Schema, and all simpleTypes that you already defined in the same schema. References to attributes do not have this property.
Default
Specifies the default value for this attribute. Specification of this property makes sense only for optional attributes. If you specified optional for the Restrictions property, you can specify a default value.
If this attribute is in an instance document, the attribute has whatever value you specify. If you do not specify this attribute, the schema processor behaves as though you had specified it with the default value. When you specify a default value for an attribute, that attribute must be optional in an instance document. An attribute can have a value for the Default property or a value for the Fixed Value property. The two properties are mutually exclusive.
Fixed Value
When you specify a value for Fixed Value, it is optional for the attribute to appear in an instance document. However, if the attribute does appear, it must have the value specified by Fixed Value. Whether or not you specify this attribute in an instance document, the schema processor behaves as though you had specified this attribute with the fixed value. An attribute can have a value for the Fixed Value property or a value for the Default property. The two properties are mutually exclusive.
Restrictions
Specify prohibited, optional, or required.
Form
An attribute's form is either qualified or unqualified. A form of qualified means that each time the attribute is referenced in a schema document, you must specify the prefix of its namespace. Every attribute has a form attribute. If it is not explicitly defined, the schema processor checks the default attribute form specified for the Schema node.
Table 75. Attribute and Attribute Reference Properties

XML Schema Validator, DTD Validator

Stylus Studio lets you validate XML documents using integrated XML Schema or DTD validators. Use the Stylus Studio built-in validator, or any number of supported XML parsers and XML validators like MSXML SAX and DOM, Xerces, .NET, and more!

Web Service Standards

Stylus Studio supports Web service standards including WSDL, UDDI and SOAP. The Web Service Tester lets you easily develop and leverage Web services in your XML applications.

Validating X12 Documents with XML Schemas

Either before or after transforming X12 EDI content, generated XML Schemas will make sure that we have all of the necessary components, our codes are all according to the standard codelists, and every little delimiter is in the right place.

Xerces - Parsing and Validating XML with the Apache Xerces Parser

The Xerces Parser supports the XML 1.0 recommendation and W3C's XML Schema recommendation version 1.0, DOM and SAX. Learn how easy it is to use Apache Xerces directly in Stylus Studio to parse and validate XML with ease.

Stylus Most Wanted

 
Free Stylus Studio XML Training:
W3C Member