Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Example Analysis of entities in XML

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article will explain in detail the example analysis of entities in XML. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.

Because the data is not in XML format, the NDATA declaration is used to specify the data type. Avi is the MIME media type defined in NOTATION. Embedding unparsed entities in XML is complex and irregular, so try not to use it. Entity

Define the entity with the ENTITY declaration. Such as:

The string can be referenced with & linux;

You can define an external entity that references an external XML document

Use & linux; to reference / home/linux/test.xml documents

External entities do not have XML declarations, but can have text declarations, which are similar, except that the text declaration must have an encoded declaration, while the version information is optional.

Is a legitimate textual declaration as well as a legitimate textual declaration.

Not all data is XML. Such as jpeg photos, mpeg movies and so on. XML recommends using external unparsed entities as a mechanism for embedding this content in a document. DTD specifies a name and URI for entities that contain non-XML data.

Because the data is not in XML format, the NDATA declaration is used to specify the data type. Avi is the MIME media type defined in NOTATION. Embedding unparsed entities in XML is complex and irregular, so try not to use it.

Parameter entities define a common set of entities that can be referenced in a document. The definition of a parameter entity is similar to that of a generic entity, except that there is an extra% in the middle and the% code is also used when referencing.

Referencing the method% person; will replace the parameter entity% person with name,address,postcode.

Usually the DTD is relatively large, and the DTD of DocBook is more than 11000 lines long. If you store it in a single file, it is very difficult to manage and maintain. We can use an external DTD subset to divide a large DTD into different functional blocks and store them in different files. Then introduce it into the current DTD through external parameter entity declaration, such as:

Define parameter entity reference external names.dtd call external DTD subset% names

Use the IGNORE keyword to annotate declarations, such as:

]] >

Of course, it is used in the same way.

The INCLUDE keyword indicates that the given declaration is indeed being used in DTD, such as:

]] >

Judging from this statement alone, the effect is the same with or without INCLUDE, but if you combine INCLUDE and IGNORE, you can achieve the choice of DTD functionality. We can define a parameter entity:

Then use parameter entity references instead of keywords:

]] >

The element declaration is valid as described above, but we can also redefine the parameter entity% note_allowed to IGNORE so that the element declaration is invalid.

This is the end of this article on "example Analysis of entities in XML". I hope the above content can be helpful to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report