开发者

what about last line of xml what should be the corresponding dtd for that

XML file

root name college.it has two child nodes principal and teacher.i wrote a corresponding dtd for t开发者_JAVA百科hat but what about a single a text line with no element attach to it.how to write a corresponding dtd line for that.the line is:

 This college is ranked 7th in the university


If an element can contain text content (other than whitespace) it must use the Mixed content model. eg.:

<!ELEMENT college (#PCDATA | principal | teacher)*>

The Mixed content model doesn't allow you to add any further restrictions. For example you can't require that principal is used only once or comes before teacher.

Normally Mixed content is used for document-like semi-structured data. Might it be better to kick that extra information into a <ranking> element?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜