/
lc_consistency.dita
51 lines (51 loc) · 2.46 KB
/
lc_consistency.dita
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?xml version="1.0" encoding="utf-8"?>
<!-- This file is part of the DITA Training project hosted on
github.com. See the accompanying LICENSE file for
applicable licenses.-->
<!DOCTYPE learningContent PUBLIC "-//OASIS//DTD DITA Learning Content//EN" "learningContent.dtd">
<learningContent id="content_hrm_xjh_1t">
<title>Be consistent</title>
<prolog>
<author href="http://www.scriptorium.com" scope="external" format="html">Gretyl Kinsey,
Scriptorium</author>
<critdates>
<created date="2015-08-24"/>
</critdates>
</prolog>
<learningContentbody>
<lcInstruction>
<p>Because DITA content exists separately from formatting, consistent use of the DITA
structure and tags is key to ensuring that all of your output types will look the
way you expect.</p>
<p>One negative side effect of inconsistent tagging is mixed content. Suppose you have
the following unordered list:</p>
<pre><ul>
<li>text</li>
<li>text</li>
<li>text
<p>text</p>
</li>
</ul></pre>
<p>In this example, the last list item contains two paragraphs. Because the <p>
element is valid inside the <li> element, it is possible to tag each paragraph
separately. However, tagging this content as shown in the example means that you now
have mixed content—the last <li> element has one line of text tagged simply with
the <li> element, and another line with <p> tags around it. This could affect
the styling of the text of this list item in the final output.</p>
<p>To avoid having mixed content, surround all text inside an <li> element with
<p> tags, whether you are tagging one paragraph or more:</p>
<pre><ul>
<li><p>text</p></li>
<li><p>text</p></li>
<li>
<p>text</p>
<p>text</p>
</li>
</ul></pre>
<p>In addition to the <li> element, we recommend that text inside the <note>,
<entry>, and <stentry> elements be surrounded with <p> tags in case there
are multiple paragraphs. To help ensure consistency and avoid mixed content, use the
<p> tag for any text that does not need to be tagged in a specific way.</p>
</lcInstruction>
</learningContentbody>
</learningContent>