Skip to content

Commit 3ea3fc3

Browse files
committed
Merge pull request joomla#68 from Bakual/xml
Adding XML style guide
2 parents 88c642d + 8488db5 commit 3ea3fc3

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
## XML Files
2+
3+
### Attributes
4+
5+
* Each attribute is on its own line.
6+
* The four attributes `name`, `type`, `label` and `description` should be written in this order and at the top of the element definition.
7+
8+
### Closing Elements
9+
10+
Elements should be closed with the closing tag on a new line.
11+
12+
### Exception
13+
14+
When the element only has few attributes, then the whole element can stay on the same line.
15+
A max line length of 100 characters is recommended for good reading.
16+
17+
#### Examples
18+
19+
Element is **empty**:
20+
````
21+
<field
22+
name="abc"
23+
type="text"
24+
label="Empty Field"
25+
description="Empty field without options"
26+
/>
27+
````
28+
29+
Element is **not empty**:
30+
````
31+
<field
32+
name="abc"
33+
type="radio"
34+
label="Field"
35+
description="Field with options"
36+
>
37+
<option value="1">JYES</option>
38+
<option value="0">JNO</option>
39+
</field>
40+
41+
<field
42+
name="abc"
43+
type="radio"
44+
label="Field"
45+
description="Field with options"
46+
>
47+
<option
48+
value="1"
49+
foo="bar"
50+
>
51+
SOMETHING_VERY_LONG
52+
</option>
53+
<option value="0">
54+
SOMETHING_VERY_LONG
55+
</option>
56+
</field>
57+
````

manual/en-US/menu.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
- [Inline Code Comments](coding-standards/chapters/inline-comments.md)
66
- [DocBlocks](coding-standards/chapters/docblocks.md)
77
- [PHP Code](coding-standards/chapters/php.md)
8+
- [XML](coding-standards/chapters/xml.md)
89
- **Clientside Syntax Styleguides**
910
- [HTML](coding-standards/chapters/html.md)
1011
- [CSS](coding-standards/chapters/css.md)

0 commit comments

Comments
 (0)