|
|
|
IBM developerWorks : XML : Education - Tutorials | |
Complex Type definitions contain attributes, which are used by complex
elements.
Attributes themselves are always declared with a simple type.
This means that an element with attributes always has a complex
structure.
The XML Schema model java interface for a <attribute> is org.eclipse.xsd.XSDAttributeDeclaration and can be created by calling org.eclipse.xsd.XSDFactory.eINSTANCE.createXSDAttributeDeclaration(). Attribute use Local attribute declarations and attribute references can be optional, required, or prohibited by changing the attribute use usage attribute. If an attribute is local or a reference, it can contain attributes, which are described by http://www.w3.org/TR/xmlschema-1/#cAttributeUse. Referencing a global attribute ceclaration If you declare a global attribute declaration, you can reference this attribute in the remainder of the schema using the ref attribute. This is done by calling the following method on the XML Schema model: org.eclipse.xsd.XSDAttributeDeclaration.setResolvedAttributeDeclaration(XSDAttributeDeclaration). Any attribute The <anyAttribute> element enables us to extend the XML instance document with attributes not specified by the schema. |
About IBM | Privacy | Legal | Contact |