2 bossin2014 bossin2014 于 2014.11.27 11:51 提问

xml中定义为DefaultValue的属性在浏览器中没显示出来

xml中的代码:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE CATALOG SYSTEM "4.DTD">
<CATALOG>
<PRODUCT NAME="ff" >
<SPECIFICATIONS WEIGHT="1221" POWER="DSDS"></SPECIFICATIONS>
<OPRIONS></OPRIONS>
<PRICE/>
<NOTES/>
</PRODUCT>
</CATALOG>

4.DTD中的代码:

<?xml version="1.0" encoding="utf-8"?>
<!ELEMENT CATALOG (PRODUCT+)>
<!ELEMENT PRODUCT
      (SPECIFICATIONS+,OPTIONS?,PRICE+,NOTES?)>
<!ATTLIST PRODUCT
      NAME CDATA #IMPLIED
      CATEGORY (HandTool|Table|Shop-Professional) "HandTool"
      PARTNUM CDATA #IMPLIED
      PLANT (Pittsburgh|Milwaukee|Chicago) "Chicago"
      INVENTORY (InStock|Backordered|Discontinued) "InStock">
 <!ELEMENT SPECIFICATIONS (#PCDATA)>
 <!ATTLIST SPECIFICATIONS
      WEIGHT CDATA #IMPLIED
      POWER CDATA #IMPLIED>
 <!ELEMENT OPTIONS (#PCDATA)>
 <!ATTLIST OPTIONS
      FINISH (Metal|Polished|Matte) "Matte" 
      ADAPTER (Included|Optional|NotApplicable) "Included"
      CASE (HardShell|Soft|NotApplicable) "HardShell">
 <!ELEMENT PRICE (#PCDATA)>
 <!ELEMENT NOTES (#PCDATA)>

浏览器中效果:

<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE CATALOG (View Source for full doctype...)>
- <CATALOG>
- <PRODUCT NAME="ff" CATEGORY="HandTool" PLANT="Chicago" INVENTORY="InStock">
<SPECIFICATIONS WEIGHT="1221" POWER="DSDS" />
<OPRIONS />
<PRICE />
<NOTES />
</PRODUCT>
</CATALOG>

问题:PRODUCT中定义为DefaultValue的属性有显示出来,而OPRIONS中定义为DefaultValue的属性却没有显示出来?

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!