xml初学者的问题
rxin 2004-04-06 05:58:13 1、请问在Schema中定义ElementType的content为textOnly和将之定义为dt:type="string"有何区别?
2、我建立了一个yd.xml文件
<yd xmlns="x-schema:yd_struct.xml">
...
<yd_date>2004-04-06</yd_date>
<yd_fz>宜宾北</yd_fz>
<yd_dz>北京东</yd_dz>
<yd_fhdd>五粮液酒厂</yd_fhdd>
<yd_shdd />
...
然后又建了一个Schema文件yd_struct.xml
...
<ElementType name="yd_date" dt:type="date" />
<ElementType name="yd_fz" content="textOnly" />
<ElementType name="yd_dz" content="textOnly" />
<ElementType name="yd_fhdd" content="empty" />
<ElementType name="yd_shdd" content="empty" />
...
我将yd_fhdd元素定义为空元素,可是为什么我用浏览器打开yd.xml文件却依然将yd_fhdd的内容显示出来,难道Schema不能检测内容的合法性?