Schema Central > XML Schema 1.0 > xsd:ENTITY
Advanced search
Need XML Help?

Recommended Reading:

Definitive XML Schema

 

Web Service Contract Design and Versioning for SOA

 

Advanced XML Applications

 

xsd:ENTITY

The type xsd:ENTITY represents a reference to an unparsed entity. The xsd:ENTITY type is most often used to include information from another location that is not in XML format, such as graphics. An xsd:ENTITY value must be an NCName. An xsd:ENTITY value carries the additional constraint that it must match the name of an unparsed entity in a document type definition (DTD) for the instance.

Simple Type Information

Namespace: http://www.w3.org/2001/XMLSchema

Schema Document: datatypes.xsd

Content

Examples

The example shows an XML document that links product numbers to pictures of the products. In the schema, the picture element declaration declares an attribute location that has the type xsd:ENTITY. In the instance, each value of the location attribute (in this case, prod557 and prod563) matches the name of an entity declared in the internal DTD subset of the instance.

Schema:

<xs:element name="picture">
  <xs:complexType>
    <xs:attribute name="location" type="xs:ENTITY"/>
  </xs:complexType>
</xs:element>
<!--...-->

Instance:

<!DOCTYPE catalog SYSTEM "catalog.dtd" [
<!NOTATION jpeg SYSTEM "JPG">
<!ENTITY prod557 SYSTEM "prod557.jpg" NDATA jpeg>
<!ENTITY prod563 SYSTEM "prod563.jpg" NDATA jpeg>
]>

<catalog>
  <product>
    <number>557</number>
    <picture location="prod557"/>
  </product>
  <product>
    <number>563</number>
    <picture location="prod563"/>
  </product>
</catalog>

Type Inheritance Chain

Site developed and hosted by Datypic, Inc.

Please report errors or comments about this site to pwalmsley@datypic.com