|
| 1 | + |
| 2 | +<<< |
| 3 | +[[namespaces-namespaces]] |
| 4 | +== Namespaces == |
| 5 | +The namespaces can be used to help divide a specific protocol into sub-elements as |
| 6 | +well as define multiple sub-protocols in the same schema. |
| 7 | + |
| 8 | +For example, having different messages with the same names defined in different namespaces. |
| 9 | +[source,xml] |
| 10 | +---- |
| 11 | +<?xml version="1.0" encoding="UTF-8"?> |
| 12 | +<schema ...> |
| 13 | + <ns name="sub1"> |
| 14 | + <message name="Msg1"> |
| 15 | + ... |
| 16 | + </message> |
| 17 | + <message name="Msg2" ... /> |
| 18 | + </ns> |
| 19 | + |
| 20 | + <ns name="sub2"> |
| 21 | + <message name="Msg1"> |
| 22 | + ... |
| 23 | + </message> |
| 24 | + <message name="Msg2" ... /> |
| 25 | + </ns> |
| 26 | + |
| 27 | + <!-- Common Frame --> |
| 28 | + <frame name="Frame"> |
| 29 | + ... |
| 30 | + </frame> |
| 31 | +</schema> |
| 32 | +---- |
| 33 | +
|
| 34 | +Another example is having multiple sub-protocols with their own frames: |
| 35 | +[source,xml] |
| 36 | +---- |
| 37 | +<?xml version="1.0" encoding="UTF-8"?> |
| 38 | +<schema ...> |
| 39 | + <ns name="prot1"> |
| 40 | + <message name="Msg1"> |
| 41 | + ... |
| 42 | + </message> |
| 43 | + <message name="Msg2" ... /> |
| 44 | + |
| 45 | + <frame name="Frame1"> |
| 46 | + ... |
| 47 | + </frame> |
| 48 | + </ns> |
| 49 | + |
| 50 | + <ns name="prot2"> |
| 51 | + <message name="Msg1"> |
| 52 | + ... |
| 53 | + </message> |
| 54 | + <message name="Msg2" ... /> |
| 55 | + |
| 56 | + <frame name="Frame2"> |
| 57 | + ... |
| 58 | + </frame> |
| 59 | + </ns> |
| 60 | +</schema> |
| 61 | +---- |
| 62 | +
|
| 63 | +[[namespaces-name]] |
| 64 | +=== Namespace Name === |
| 65 | +Every namespace definition must specify its <<intro-names, name>> using |
| 66 | +**name** <<intro-properties, property>>. |
| 67 | +[source,xml] |
| 68 | +---- |
| 69 | +<?xml version="1.0" encoding="UTF-8"?> |
| 70 | +<schema ...> |
| 71 | + <ns name="ns1"> |
| 72 | + ... |
| 73 | + </ns> |
| 74 | +</schema> |
| 75 | +---- |
| 76 | +
|
| 77 | +[[namespaces-description]] |
| 78 | +=== Description === |
| 79 | +It is possible to provide a description of the namespace about what it is and |
| 80 | +what it contains to be used. This description is only for documentation |
| 81 | +purposes and may find it's way into the generated code as a comment for the |
| 82 | +generated namespace. The <<intro-properties, property>> is **description**. |
| 83 | +[source,xml] |
| 84 | +---- |
| 85 | +<?xml version="1.0" encoding="UTF-8"?> |
| 86 | +<schema ...> |
| 87 | + <ns name="ns1"> |
| 88 | + <description> |
| 89 | + Some long |
| 90 | + multiline |
| 91 | + description |
| 92 | + </description> |
| 93 | + ... |
| 94 | + </ns> |
| 95 | +</schema> |
| 96 | +---- |
| 97 | +
|
| 98 | +[[namespaces-display-name]] |
| 99 | +=== Display Name === |
| 100 | +When documenting a namespace the value of **displayName** property can be used as more descriptive |
| 101 | +human readable name. |
| 102 | +[source,xml] |
| 103 | +---- |
| 104 | +<?xml version="1.0" encoding="UTF-8"?> |
| 105 | +<schema > |
| 106 | + <ns name="ns1" displayName="Some Summary"> |
| 107 | + ... |
| 108 | + </ns> |
| 109 | +</schema> |
| 110 | +---- |
| 111 | +In case **displayName** is empty, the **name** <<intro-properties, property>> is expected be used instead. |
| 112 | +
|
| 113 | +Use <<appendix-namespace, properties table>> for future references. |
0 commit comments