English 中文(简体)
DTD - Components
  • 时间:2025-03-15

DTD - Components


Previous Page Next Page  

本章将从TD的角度讨论关于XML部分的内容。 DTD将基本包含以下XML组成部分的声明:

    内容

    贡献

    实体

内容s

XML elements can be defined as building blocks of an XML document. 内容s can behave as a container to hold text, elements, attributes, media objects or mix of all.

每一项XML文件都有一个或多个内容,其边界要么由起点和最终标的划定,要么是空洞元素。

Example

以下是XML要素的简单例子。

<name>
   Tutorials Point
</name>

As you can see we have defined a <name> tag. There s a text between start and end tag of <name>. 内容s, when used in an XML-DTD, need to be declared which will be discussed in detail in the chapter DTD 内容s.

贡献

贡献 are part of the XML elements. An element can have any number of unique attributes. 贡献 give more information about the XML element or more precisely it defines a property of the element. An XML attribute is always a name-value pair.

Example

以下是XML属性的一个简单例子:

<img src = "flower.jpg"/>

Here img is the element name whereas src is an attribute name and flower.jpg is a value given for the attribute src.

If attributes are used in an XML DTD then these need to be declared which will be discussed in detail in the chapter DTD 贡献

实体

实体 are placeholders in XML. These can be declared in the document prolog or in a DTD. 实体 can be primarily categorized as −

    Built-in实体

    特征实体

    一般实体

    参数实体

有5个内在实体在知情的XML中发挥作用,它们是:

    邮局: &amp;

    单一报价:和

    大于:

    少于:及

    双重引用:和;引用;

We will study more about entity declarations in XML DTD in detail in the chapter DTD 实体

Advertisements