宽带上网教程
局域网组建教程
无线上网知识
路由交换教程
分享互联网教程
交换机技术教程
网络管理员教程
网络协议教程
网络技术应用教程
组网方案教程
Cisco教程
华为技术
网络专业技术
网络存储教程
网络认证教程
网络服务器架设教程
WEB服务器教程
ftp服务器教程
mail服务器教程
网络协议教程ID第84799篇

用XML 写I_Ds 和 RFC文档

PCPPC.CN  教程来源:作者:  栏目:网络协议教程  更新时间:较新  字体尺寸:缩小 放大
您正在看的网络协议教程是:用XML 写I_Ds 和 RFC文档。t;keyword>RequestforComments</keyword>
<keyword>I-D</keyword>

<keyword>Internet-Draft</keyword>
<keyword>XML</keyword>
<keyword>ExtensibleMarkupLanguage</keyword>
<abstract>
<t>ThismemopresentsatechniqueforusingXML
(ExtensibleMarkupLanguage)asasourceformat
fordocumentsintheInternet-Drafts(I-Ds)and
RequestforComments(RFC)series.</t>
</abstract>
</front>

2.3Middle

"middle"元素包含文档的除参考书目和附录之外的所有章节:

...
</front>
<middle>
<section...>
<section...>
<section...>
</middle>
<back>
...

"middle"元素包含一个或多个"section"元素s.

2.3.1section元素

每一个"section"元素包含了文档的一个章节.有一个必须的属性,就是"title",标识了该章节的
标题.还有一个可选的属性"anchor",它和"xref"元素一起使用,以能进行联结.(见2.3.1.4),
例:

<sectionanchor="intro"title="Introduction">
...
</section>

"section"元素是可以递归的–每一个元素可以包含以下"t","figure",和"section"元素的
任意组合,如,

<sectiontitle="TheMiddle">
...
<sectiontitle="section元素">
...
<sectiontitle="t元素">...</section>
<sectiontitle="list元素">...</section>
<sectiontitle="figure元素">...</section>
<sectiontitle="xref元素">...</section>
<sectiontitle="eref元素">...</section>
<sectiontitle="iref元素">...</section>
</section>
</section>

2.3.1.1t元素

"t"元素可包含任意段落,列表和图片的组合.如果在章节,图片或者参考中需要有交叉联结
(cross-reference),则可以使用"xref"元素(见2.3.1.4);同样,如果有外部联结,则使用"eref"元
素(见2.3.1.5)."iref"元素可以提供文本的索引(见2.3.1.6).

2.3.1.2list元素

"list"元素包含一个或多个条目.每一个条目是一个"t"元素,允许递归,如,

<liststyle="numbers">
<t>Thepfirstitem.</t>
<t>Theseconditem,whichcontainstwobulletedsub-items:
<liststyle="symbols">
<t>Thefirstsub-item.</t>
<t>Thesecondsub-item.</t>
</list>
</t>
</list>

"list"元素有一个可选的属性"style",其值可以为"numbers"(数值型列表),"symbols"(子弹
型列表),"hanging"(悬挂型列表),或,"empty"(锯齿型列表).如果"list"元素是嵌套的,它的
缺省值来自于它最近的父元素,否则它的缺省值是"empty".

嵌套了"hanginglist"元素时,"t"元素有一个可选属性"hangText",它标识了被插入的文本,
如:

<liststyle="hanging">
<thangText="full2026:">indicatingthatthedocumentisin
fullconformancewithalltheprovisionsofSection10ofRFC
2026;</t>

<thangText="noDerivativeWorks2026:">indicatingthatthe
文档isinfullconformancewithalltheprovisionsof
Section10ofRFC2026exceptthattherighttoproduce
derivativeworksisnotgranted;or,</t>

<thangText="none:">indicatingthatthedocumentisNOT
offeredinaccordancewithSection10ofRFC2026,andthe
authordoesnotprovidetheIETFwithanyrightsotherthan
topublishasanInternet-Draft.</t>
</list>

2.3.1.3figure元素

"figure"元素组合了一个可选的"preamble"元素,一个"artwork"元素,及一个可选的
"postamble"元素."figure"元素还有一个可选的属性"anchor",它和"xref"元素一起使用用来进
行交叉联结(见2.3.1.4).它还有一个可选属性,用来标识图片的标题.

"preamble和"postamble"元素如果出现,只是简单的文本.如果在章节,图片或者参考中需要有交
叉联结(cross-reference),则可以使用"xref"元素(见2.3.1.4);同样,如果有外部联结,则使用
"eref"元素(见2.3.1.5)."iref"元素可以提供文本的索引(见2.3.1.6).

"artwork"元素是必需的,它包含"ASCIIartwork".它不象在"t","preamble",或"postamble"元
素中包含文本,"artwork"元素中水平和垂直的whitespace都是有意义的.

现在,把它们连在一起,我们有下例,
<figureanchor="figure_example">
<preamble>So,
puttingitalltogether,wehave,e.g.,</preamble>
<artwork>
asciiartworkgoeshere...

besuretouse"<"or"&"insteadof"<"and"&",
respectively!
</artwork>
<postamble>whichisaverysimpleexample.</postamble>
</figure>
这只是一个很简单的例子.

如果你的作品中有很多"<"符号,有一种XML技巧可以

上一篇  [1] [2] [3] [4] [5] [6] [7] 下一篇

加入收藏 - 友情链接 - 网站声明 - 网站地图 - 关于我们 - 联系我们 -
Copyright© 2004-2007 电脑教程之家 PCPPC.cn All Rights Reserved