XML Schema simpleContent Element
Complete XML Schema Reference
Definition and Usage
The simpleContent element contains extensions or restrictions on a text-only complex
type or on a simple type as content and contains no
elements.
Element Information
- Parent elements: complexType
Syntax
<simpleContent
id=ID
any attributes
>
(annotation?,(restriction|extension))
</simpleContent>
|
(The ? sign declares that the element can occur zero or one time inside the
simpleContent element)
| Attribute |
Description |
| id |
Optional. Specifies a unique ID for the element |
| any attributes |
Optional. Specifies any other attributes with non-schema
namespace |
Example 1
Here is an example of an XML element (<shoesize>) that contains text-only:
<shoesize country="france">35</shoesize>
|
The following example
declares a complexType, "shoesize", with its content defined as a
integer data type and with a country attribute:
<xs:element name="shoesize">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:integer">
<xs:attribute name="country" type="xs:string" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
|
Complete XML Schema Reference
Learn XML with <oXygen/> XML Editor - Free Trial!
 |
|
oXygen helps you learn to define,
edit, validate and transform XML documents. Supported technologies include XML Schema,
DTD, Relax NG, XSLT, XPath, XQuery, CSS.
Understand in no time how XSLT and XQuery work by using the intuitive oXygen debugger!
Do you have any XML related questions? Get free answers from the oXygen
XML forum
and from the video
demonstrations.
Download a FREE 30-day trial today!
|
|