一起学习
There is no single answer to this: a lot depends on what you are designing the document type for.
Traditional editorial practice is to put the real text (what would be printed) as character data content, and keep the metadata (information about the text) in attributes, from where they can more easily be isolated for analysis or special treatment like display in the margin or in a mouseover:
PortiaThe quality of mercy is not strain'd,
But from the systems point of view, there is nothing wrong with storing the data the other way round, especially where the volume of text data on each occasion is relatively small:
184
A lot will depend on what you want to do with the information and which bits of it are easiest accessed by each method. A rule of thumb for conventional text documents is that if the markup were all stripped away, the bare text should still be readable and usable, even if unformatted and inconvenient. For database output, however, or other machine-generated documents like e-commerce transactions, human reading may not be meaningful, so it is perfectly possible to have documents where all the data is in attributes, and the document contains no character data in content models at all. See for more information.
下载本文示例代码
Which should I use in my DTD, attributes or elemenWhich should I use in my DTD, attributes or elemenWhich should I use in my DTD, attributes or elemenWhich should I use in my DTD, attributes or elemenWhich should I use in my DTD, attributes or elemenWhich should I use in my DTD, attributes or elemenWhich should I use in my DTD, attributes or elemenWhich should I use in my DTD, attributes or elemenWhich should I use in my DTD, attributes or elemenWhich should I use in my DTD, attributes or elemenWhich should I use in my DTD, attributes or elemenWhich should I use in my DTD, attributes or elemen