Skip to content

Commit 6f585f2

Browse files
committed
upd
1 parent d3faa61 commit 6f585f2

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed
Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,22 @@
11
# Namespace definition
22

3-
The namespace definition may be used to define a namespace that may be used for protecting or versioning other definitions and XML data processing.
3+
The namespace definition may be primarily used to define a namespace that may be used for protecting or versioning other definitions and XML data processing.
44

55
```
66
namespace ns1
7-
namespace ns2 = "http://example.com/secret"
7+
namespace ns2 = "http://example.com/secret/2015"
8+
```
9+
10+
In addition, the namespace definition may also be used to define aliases to a package wildcard import, as in:
11+
12+
```
13+
// com.inexistentninja.kunai.*
14+
namespace kunai = "com.inexistentninja.kunai";
15+
16+
// an alias to the top-level package.
17+
// users can just use `global` if it doesn't conflict
18+
// with their names.
19+
namespace shock_global = global;
820
```
921

1022
**Syntax**
@@ -15,4 +27,8 @@ namespace ns2 = "http://example.com/secret"
1527
<b>namespace</b> <i>IdentifierName</i><br>
1628
<b>namespace</b> <i>IdentifierName</i> <b>=</b> <i>AssignmentExpression</i><sup>allowIn</sup>
1729
</ul>
18-
</ul>
30+
</ul>
31+
32+
**Semantics**
33+
34+
A URI namespace contains at least a colon; namespaces assigned a string literal without a colon will result into an alias to a package wildcard import.

0 commit comments

Comments
 (0)