os.rng 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. This file is part of DocBook V5.0
  4. Copyright 1992-2008 HaL Computer Systems, Inc.,
  5. O'Reilly & Associates, Inc., ArborText, Inc., Fujitsu Software
  6. Corporation, Norman Walsh, Sun Microsystems, Inc., and the
  7. Organization for the Advancement of Structured Information
  8. Standards (OASIS).
  9. Release: $Id: pool.rnc 7466 2007-09-27 14:03:55Z nwalsh $
  10. Permission to use, copy, modify and distribute the DocBook schema
  11. and its accompanying documentation for any purpose and without fee
  12. is hereby granted in perpetuity, provided that the above copyright
  13. notice and this paragraph appear in all copies. The copyright
  14. holders make no representation about the suitability of the schema
  15. for any purpose. It is provided "as is" without expressed or implied
  16. warranty.
  17. If you modify the DocBook schema in any way, label your schema as a
  18. variant of DocBook. See the reference documentation
  19. (http://docbook.org/tdg5/en/html/ch05.html#s-notdocbook)
  20. for more information.
  21. Please direct all questions, bug reports, or suggestions for changes
  22. to the docbook@lists.oasis-open.org mailing list. For more
  23. information, see http://www.oasis-open.org/docbook/.
  24. ======================================================================
  25. -->
  26. <grammar ns="http://docbook.org/ns/docbook" xmlns:db="http://docbook.org/ns/docbook" xmlns:s="http://purl.oclc.org/dsdl/schematron" xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns:rng="http://relaxng.org/ns/structure/1.0" xmlns:ctrl="http://nwalsh.com/xmlns/schema-control/" xmlns="http://relaxng.org/ns/structure/1.0">
  27. <start combine="choice">
  28. <ref name="db.cmdsynopsis"/>
  29. </start>
  30. <define name="db.domain.inlines" combine="choice">
  31. <ref name="db.os.inlines"/>
  32. </define>
  33. <define name="db.synopsis.blocks" combine="choice">
  34. <ref name="db.cmdsynopsis"/>
  35. </define>
  36. <define name="db.os.inlines">
  37. <choice>
  38. <ref name="db.prompt"/>
  39. <ref name="db.envar"/>
  40. <ref name="db.filename"/>
  41. <ref name="db.command"/>
  42. <ref name="db.computeroutput"/>
  43. <ref name="db.userinput"/>
  44. </choice>
  45. </define>
  46. <define name="db.computeroutput.inlines">
  47. <choice>
  48. <text/>
  49. <ref name="db.ubiq.inlines"/>
  50. <ref name="db.os.inlines"/>
  51. <ref name="db.technical.inlines"/>
  52. </choice>
  53. </define>
  54. <define name="db.userinput.inlines">
  55. <choice>
  56. <text/>
  57. <ref name="db.ubiq.inlines"/>
  58. <ref name="db.os.inlines"/>
  59. <ref name="db.technical.inlines"/>
  60. </choice>
  61. </define>
  62. <!-- ====================================================================== -->
  63. <define name="db.prompt.inlines">
  64. <ref name="db._text"/>
  65. </define>
  66. <!-- ====================================================================== -->
  67. <div>
  68. <db:refname>prompt</db:refname>
  69. <db:refpurpose>A character or string indicating the start of an input field in a computer display</db:refpurpose>
  70. <define name="db.prompt.role.attribute">
  71. <attribute name="role"/>
  72. </define>
  73. <define name="db.prompt.attlist">
  74. <interleave>
  75. <optional>
  76. <ref name="db.prompt.role.attribute"/>
  77. </optional>
  78. <ref name="db.common.attributes"/>
  79. <ref name="db.common.linking.attributes"/>
  80. </interleave>
  81. </define>
  82. <define name="db.prompt">
  83. <element name="prompt">
  84. <ref name="db.prompt.attlist"/>
  85. <zeroOrMore>
  86. <ref name="db.prompt.inlines"/>
  87. </zeroOrMore>
  88. </element>
  89. </define>
  90. </div>
  91. <!-- ====================================================================== -->
  92. <div>
  93. <db:refname>envar</db:refname>
  94. <db:refpurpose>A software environment variable</db:refpurpose>
  95. <define name="db.envar.role.attribute">
  96. <attribute name="role"/>
  97. </define>
  98. <define name="db.envar.attlist">
  99. <interleave>
  100. <optional>
  101. <ref name="db.envar.role.attribute"/>
  102. </optional>
  103. <ref name="db.common.attributes"/>
  104. <ref name="db.common.linking.attributes"/>
  105. </interleave>
  106. </define>
  107. <define name="db.envar">
  108. <element name="envar">
  109. <ref name="db.envar.attlist"/>
  110. <ref name="db._text"/>
  111. </element>
  112. </define>
  113. </div>
  114. <!-- ====================================================================== -->
  115. <div>
  116. <db:refname>filename</db:refname>
  117. <db:refpurpose>The name of a file</db:refpurpose>
  118. <define name="db.filename.class.enumeration">
  119. <choice>
  120. <value>devicefile</value>
  121. <a:documentation>A device</a:documentation>
  122. <value>directory</value>
  123. <a:documentation>A directory</a:documentation>
  124. <value>extension</value>
  125. <a:documentation>A filename extension</a:documentation>
  126. <value>headerfile</value>
  127. <a:documentation>A header file (as for a programming language)</a:documentation>
  128. <value>libraryfile</value>
  129. <a:documentation>A library file</a:documentation>
  130. <value>partition</value>
  131. <a:documentation>A partition (as of a hard disk)</a:documentation>
  132. <value>symlink</value>
  133. <a:documentation>A symbolic link</a:documentation>
  134. </choice>
  135. </define>
  136. <define name="db.filename.class.attribute">
  137. <attribute name="class">
  138. <db:refpurpose>Identifies the class of filename</db:refpurpose>
  139. <ref name="db.filename.class.enumeration"/>
  140. </attribute>
  141. </define>
  142. <define name="db.filename.path.attribute">
  143. <attribute name="path">
  144. <db:refpurpose>Specifies the path of the filename</db:refpurpose>
  145. </attribute>
  146. </define>
  147. <define name="db.filename.role.attribute">
  148. <attribute name="role"/>
  149. </define>
  150. <define name="db.filename.attlist">
  151. <interleave>
  152. <optional>
  153. <ref name="db.filename.role.attribute"/>
  154. </optional>
  155. <ref name="db.common.attributes"/>
  156. <ref name="db.common.linking.attributes"/>
  157. <optional>
  158. <ref name="db.filename.path.attribute"/>
  159. </optional>
  160. <optional>
  161. <ref name="db.filename.class.attribute"/>
  162. </optional>
  163. </interleave>
  164. </define>
  165. <define name="db.filename">
  166. <element name="filename">
  167. <ref name="db.filename.attlist"/>
  168. <ref name="db._text"/>
  169. </element>
  170. </define>
  171. </div>
  172. <!-- ====================================================================== -->
  173. <div>
  174. <db:refname>command</db:refname>
  175. <db:refpurpose>The name of an executable program or other software command</db:refpurpose>
  176. <define name="db.command.role.attribute">
  177. <attribute name="role"/>
  178. </define>
  179. <define name="db.command.attlist">
  180. <interleave>
  181. <optional>
  182. <ref name="db.command.role.attribute"/>
  183. </optional>
  184. <ref name="db.common.attributes"/>
  185. <ref name="db.common.linking.attributes"/>
  186. </interleave>
  187. </define>
  188. <define name="db.command">
  189. <element name="command">
  190. <ref name="db.command.attlist"/>
  191. <ref name="db._text"/>
  192. </element>
  193. </define>
  194. </div>
  195. <!-- ====================================================================== -->
  196. <div>
  197. <db:refname>computeroutput</db:refname>
  198. <db:refpurpose>Data, generally text, displayed or presented by a computer</db:refpurpose>
  199. <define name="db.computeroutput.role.attribute">
  200. <attribute name="role"/>
  201. </define>
  202. <define name="db.computeroutput.attlist">
  203. <interleave>
  204. <optional>
  205. <ref name="db.computeroutput.role.attribute"/>
  206. </optional>
  207. <ref name="db.common.attributes"/>
  208. <ref name="db.common.linking.attributes"/>
  209. </interleave>
  210. </define>
  211. <define name="db.computeroutput">
  212. <element name="computeroutput">
  213. <ref name="db.computeroutput.attlist"/>
  214. <zeroOrMore>
  215. <ref name="db.computeroutput.inlines"/>
  216. </zeroOrMore>
  217. </element>
  218. </define>
  219. </div>
  220. <!-- ====================================================================== -->
  221. <div>
  222. <db:refname>userinput</db:refname>
  223. <db:refpurpose>Data entered by the user</db:refpurpose>
  224. <define name="db.userinput.role.attribute">
  225. <attribute name="role"/>
  226. </define>
  227. <define name="db.userinput.attlist">
  228. <interleave>
  229. <optional>
  230. <ref name="db.userinput.role.attribute"/>
  231. </optional>
  232. <ref name="db.common.attributes"/>
  233. <ref name="db.common.linking.attributes"/>
  234. </interleave>
  235. </define>
  236. <define name="db.userinput">
  237. <element name="userinput">
  238. <ref name="db.userinput.attlist"/>
  239. <zeroOrMore>
  240. <ref name="db.userinput.inlines"/>
  241. </zeroOrMore>
  242. </element>
  243. </define>
  244. </div>
  245. <!-- ====================================================================== -->
  246. <div>
  247. <db:refname>cmdsynopsis</db:refname>
  248. <db:refpurpose>A syntax summary for a software command</db:refpurpose>
  249. <define name="db.cmdsynopsis.role.attribute">
  250. <attribute name="role"/>
  251. </define>
  252. <define name="db.cmdsynopsis.sepchar.attribute">
  253. <attribute name="sepchar">
  254. <db:refpurpose>Specifies the character that should separate the command and its top-level arguments</db:refpurpose>
  255. </attribute>
  256. </define>
  257. <define name="db.cmdsynopsis.cmdlength.attribute">
  258. <attribute name="cmdlength">
  259. <db:refpurpose>Indicates the displayed length of the command; this information may be used to intelligently indent command synopses which extend beyond one line</db:refpurpose>
  260. </attribute>
  261. </define>
  262. <define name="db.cmdsynopsis.label.attribute">
  263. <ref name="db.label.attribute"/>
  264. </define>
  265. <define name="db.cmdsynopsis.attlist">
  266. <interleave>
  267. <optional>
  268. <ref name="db.cmdsynopsis.role.attribute"/>
  269. </optional>
  270. <ref name="db.common.attributes"/>
  271. <ref name="db.common.linking.attributes"/>
  272. <optional>
  273. <ref name="db.cmdsynopsis.sepchar.attribute"/>
  274. </optional>
  275. <optional>
  276. <ref name="db.cmdsynopsis.cmdlength.attribute"/>
  277. </optional>
  278. <optional>
  279. <ref name="db.cmdsynopsis.label.attribute"/>
  280. </optional>
  281. </interleave>
  282. </define>
  283. <define name="db.cmdsynopsis.info">
  284. <ref name="db._info.title.forbidden"/>
  285. </define>
  286. <define name="db.cmdsynopsis">
  287. <element name="cmdsynopsis">
  288. <ref name="db.cmdsynopsis.attlist"/>
  289. <ref name="db.cmdsynopsis.info"/>
  290. <oneOrMore>
  291. <choice>
  292. <ref name="db.command"/>
  293. <ref name="db.arg"/>
  294. <ref name="db.group"/>
  295. <ref name="db.sbr"/>
  296. </choice>
  297. </oneOrMore>
  298. <zeroOrMore>
  299. <ref name="db.synopfragment"/>
  300. </zeroOrMore>
  301. </element>
  302. </define>
  303. </div>
  304. <!-- ====================================================================== -->
  305. <define name="db.rep.enumeration">
  306. <choice>
  307. <value>norepeat</value>
  308. <a:documentation>Can not be repeated.</a:documentation>
  309. <value>repeat</value>
  310. <a:documentation>Can be repeated.</a:documentation>
  311. </choice>
  312. </define>
  313. <define name="db.rep.attribute">
  314. <attribute name="rep" a:defaultValue="norepeat">
  315. <db:refpurpose>Indicates whether or not repetition is possible.</db:refpurpose>
  316. <ref name="db.rep.enumeration"/>
  317. </attribute>
  318. </define>
  319. <define name="db.choice.enumeration">
  320. <choice>
  321. <value>opt</value>
  322. <a:documentation>Formatted to indicate that it is optional.</a:documentation>
  323. <value>plain</value>
  324. <a:documentation>Formatted without indication.</a:documentation>
  325. <value>req</value>
  326. <a:documentation>Formatted to indicate that it is required.</a:documentation>
  327. </choice>
  328. </define>
  329. <define name="db.choice.opt.attribute">
  330. <attribute name="choice" a:defaultValue="opt">
  331. <db:refpurpose>Indicates optionality.</db:refpurpose>
  332. <ref name="db.choice.enumeration"/>
  333. </attribute>
  334. </define>
  335. <define name="db.choice.req.attribute">
  336. <attribute name="choice" a:defaultValue="req">
  337. <db:refpurpose>Indicates optionality.</db:refpurpose>
  338. <ref name="db.choice.enumeration"/>
  339. </attribute>
  340. </define>
  341. <!-- ====================================================================== -->
  342. <div>
  343. <db:refname>arg</db:refname>
  344. <db:refpurpose>An argument in a cmdsynopsis</db:refpurpose>
  345. <define name="db.arg.role.attribute">
  346. <attribute name="role"/>
  347. </define>
  348. <define name="db.arg.rep.attribute">
  349. <ref name="db.rep.attribute"/>
  350. </define>
  351. <define name="db.arg.choice.attribute">
  352. <ref name="db.choice.opt.attribute"/>
  353. </define>
  354. <define name="db.arg.attlist">
  355. <interleave>
  356. <optional>
  357. <ref name="db.arg.role.attribute"/>
  358. </optional>
  359. <ref name="db.common.attributes"/>
  360. <ref name="db.common.linking.attributes"/>
  361. <optional>
  362. <ref name="db.arg.rep.attribute"/>
  363. </optional>
  364. <optional>
  365. <ref name="db.arg.choice.attribute"/>
  366. </optional>
  367. </interleave>
  368. </define>
  369. <define name="db.arg">
  370. <element name="arg">
  371. <ref name="db.arg.attlist"/>
  372. <zeroOrMore>
  373. <choice>
  374. <ref name="db._text"/>
  375. <ref name="db.arg"/>
  376. <ref name="db.group"/>
  377. <ref name="db.option"/>
  378. <ref name="db.synopfragmentref"/>
  379. <ref name="db.sbr"/>
  380. </choice>
  381. </zeroOrMore>
  382. </element>
  383. </define>
  384. </div>
  385. <!-- ====================================================================== -->
  386. <div>
  387. <db:refname>group</db:refname>
  388. <db:refpurpose>A group of elements in a cmdsynopsis</db:refpurpose>
  389. <define name="db.group.role.attribute">
  390. <attribute name="role"/>
  391. </define>
  392. <define name="db.group.rep.attribute">
  393. <ref name="db.rep.attribute"/>
  394. </define>
  395. <define name="db.group.choice.attribute">
  396. <ref name="db.choice.opt.attribute"/>
  397. </define>
  398. <define name="db.group.attlist">
  399. <interleave>
  400. <optional>
  401. <ref name="db.group.role.attribute"/>
  402. </optional>
  403. <ref name="db.common.attributes"/>
  404. <ref name="db.common.linking.attributes"/>
  405. <optional>
  406. <ref name="db.group.rep.attribute"/>
  407. </optional>
  408. <optional>
  409. <ref name="db.group.choice.attribute"/>
  410. </optional>
  411. </interleave>
  412. </define>
  413. <define name="db.group">
  414. <element name="group">
  415. <ref name="db.group.attlist"/>
  416. <oneOrMore>
  417. <choice>
  418. <ref name="db.arg"/>
  419. <ref name="db.group"/>
  420. <ref name="db.option"/>
  421. <ref name="db.synopfragmentref"/>
  422. <ref name="db.replaceable"/>
  423. <ref name="db.sbr"/>
  424. </choice>
  425. </oneOrMore>
  426. </element>
  427. </define>
  428. </div>
  429. <!-- ====================================================================== -->
  430. <div>
  431. <db:refname>sbr</db:refname>
  432. <db:refpurpose>An explicit line break in a command synopsis</db:refpurpose>
  433. <define name="db.sbr.role.attribute">
  434. <attribute name="role"/>
  435. </define>
  436. <define name="db.sbr.attlist">
  437. <interleave>
  438. <optional>
  439. <ref name="db.sbr.role.attribute"/>
  440. </optional>
  441. <ref name="db.common.attributes"/>
  442. </interleave>
  443. </define>
  444. <define name="db.sbr">
  445. <element name="sbr">
  446. <ref name="db.sbr.attlist"/>
  447. <empty/>
  448. </element>
  449. </define>
  450. </div>
  451. <!-- ====================================================================== -->
  452. <div>
  453. <db:refname>synopfragment</db:refname>
  454. <db:refpurpose>A portion of a cmdsynopsis broken out from the main body of the synopsis</db:refpurpose>
  455. <define name="db.synopfragment.role.attribute">
  456. <attribute name="role"/>
  457. </define>
  458. <define name="db.synopfragment.attlist">
  459. <interleave>
  460. <optional>
  461. <ref name="db.synopfragment.role.attribute"/>
  462. </optional>
  463. <ref name="db.common.attributes"/>
  464. <ref name="db.common.linking.attributes"/>
  465. </interleave>
  466. </define>
  467. <define name="db.synopfragment">
  468. <element name="synopfragment">
  469. <ref name="db.synopfragment.attlist"/>
  470. <oneOrMore>
  471. <choice>
  472. <ref name="db.arg"/>
  473. <ref name="db.group"/>
  474. </choice>
  475. </oneOrMore>
  476. </element>
  477. </define>
  478. </div>
  479. <!-- ====================================================================== -->
  480. <div>
  481. <db:refname>synopfragmentref</db:refname>
  482. <db:refpurpose>A reference to a fragment of a command synopsis</db:refpurpose>
  483. <define name="db.synopfragmentref.role.attribute">
  484. <attribute name="role"/>
  485. </define>
  486. <define name="db.synopfragmentref.attlist">
  487. <interleave>
  488. <optional>
  489. <ref name="db.synopfragmentref.role.attribute"/>
  490. </optional>
  491. <ref name="db.common.attributes"/>
  492. <ref name="db.linkend.attribute"/>
  493. </interleave>
  494. </define>
  495. <define name="db.synopfragmentref">
  496. <element name="synopfragmentref">
  497. <s:pattern name="Synopsis fragment type constraint">
  498. <s:rule context="db:synopfragmentref">
  499. <s:assert test="local-name(//*[@xml:id=current()/@linkend]) = 'synopfragment' and namespace-uri(//*[@xml:id=current()/@linkend]) = 'http://docbook.org/ns/docbook'">@linkend on synopfragmentref must point to a synopfragment.</s:assert>
  500. </s:rule>
  501. </s:pattern>
  502. <ref name="db.synopfragmentref.attlist"/>
  503. <text/>
  504. </element>
  505. </define>
  506. </div>
  507. </grammar>