DTD-属性
来源:互联网 发布:视频压缩算法工程师 编辑:程序博客网 时间:2024/05/27 09:47
DTD里属性用ATTLIST声明
语法:
<!ATTLIST element-name attribute-name attribute-type default-value>
例:
<!ATTLIST payment type CDATA "check">
XML例:<payment type="check" />
attribute-type列表如下:
CDATA
The value is character data
(en1|en2|..)
The value must be one from an enumerated list
ID
The value is a unique id
IDREF
The value is the id of another element
IDREFS
The value is a list of other ids
NMTOKEN
The value is a valid XML name
NMTOKENS
The value is a list of valid XML names
ENTITY
The value is an entity
ENTITIES
The value is a list of entities
NOTATION
The value is a name of a notation
xml:
The value is a predefined xml value
The default-value can be one of the following:
value
The default value of the attribute
#REQUIRED
The attribute is required
#IMPLIED
The attribute is not required
#FIXED value
The attribute value is fixed
带默认属性值的
DTD:<!ELEMENT square EMPTY>
<!ATTLIST square width CDATA "0">
valid xml:<square width="100" />
属性必须有的:
语法:<!ATTLIST element-name attribute-name attribute-type #REQUIRED>
例:<!ATTLIST person number CDATA #REQUIRED>
有效的xml:<person number="5677" />
属性可有可无的
语法:<!ATTLIST element-name attribute-name attribute-type #IMPLIED>
例:DTD:<!ATTLIST contact fax CDATA #IMPLIED>
有效xml: <contact fax="555-667788" /> or <contact />
固定属性的:
语法:<!ATTLIST element-name attribute-name attribute-type #FIXED "value">
例:DTD:<!ATTLIST sender company CDATA #FIXED "Microsoft">
有效xml:<sender company="Microsoft" />
带可选值属性的:
语法:<!ATTLIST element-name attribute-name (en1|en2|...) default-value>
例:<!ATTLIST payment type (check|cash) "cash">
xml例: <payment type="check">
- DTD - 属性
- DTD-属性
- DTD属性
- dtd属性
- DTD中的属性声明
- DTD 属性详解
- DTD的内部属性
- DTD的内部属性
- 4.DTD - 元素 - 属性
- DTD属性的定义
- dtd定义属性
- XML:DTD、DTD定义元素、DTD定义属性、DTD定义实体
- DTD中属性可使用类型列表
- XML----DTD-引用,验证,元素属性
- DTD、
- DTD
- DTD
- DTD
- 上网行为管理系统
- 转:ASP.net中动态加载控件时一些问题的总结
- Tomcat配置SQLServer数据连接池
- 农业银行代销基金一览表
- SAX notes
- DTD-属性
- C#程序设计(二)-----Windows窗体及标签控件
- [原创]ASP.NET 运行模式学习(一)
- Details: To enable the details of this specific error message to be viewable on remote machines, please create a tag within a
- cakephp分页/cakephpページング/cakephp paging
- 开发笔记:Java命名规范
- DTD - 实体(Entities)
- 做程序员最重要的是什么?
- .net xml中无效字符处理