1
<?xml version="1.0" encoding="utf-8"?>
2
<page xmlns="http://projectmallard.org/1.0/" type="topic" id="mal_block_example">
5
<revision version="0.1" date="2009-05-06" status="review"/>
8
<name>Shaun McCance</name>
9
<email>shaunm@gnome.org</email>
10
<years>2008-2009</years>
13
<include xmlns="http://www.w3.org/2001/XInclude" href="legal.xml"/>
15
<desc>Mark a group of block elements as being part of a single example.</desc>
18
<title>Beispiele</title>
20
<synopsis><code mime="application/relax-ng-compact-syntax">
21
mal_block_example = element example {
22
attribute style { xsd:NMTOKENS } ?,
23
attribute * - (mal:* | local:*) { text } *,
25
<link xref="mal_block">mal_block</link> +
29
<p>Use the <code>example</code> element to place block elements into a
30
logical group, indicating that they are part of a single example. This
31
may be used to group example input with its result, to show different
32
steps with different types of block elements, or simply to group some
33
paragraphs together.</p>
38
<title>Anmerkungen</title>
40
<item><p>The <code>example</code> element can contain any
41
<link xref="mal_block">general block content</link>.</p></item>
43
<item><p>The <code>example</code> element can occur in any
44
general block context, including inside
45
<link xref="mal_page">pages</link>, <link xref="mal_section">sections</link>,
46
and certain <link xref="mal_block">block elements</link>.</p></item>
48
<item><p>The <code>style</code> attribute takes a space-separated list of
49
style hints. Processing tools should adjust their behavior according to
50
those style hints they understand.</p></item>
52
<item><p>The <code>example</code> element can have attributes from external
53
namespaces. See <link xref="mal_external"/> for more information
54
on external-namespace attributes.</p></item>
60
<!-- BEGIN examples -->
61
<section id="examples">
62
<title>Beispiele</title>
64
<p>Use <code>example</code> to show how to use the <code>screen</code>
65
element, grouping the input and formatted result:</p>
72
xsltproc -o mal_block_screen.html \
73
--stringparam mal.cache.file `pwd`/mallard.cache \
74
`pkg-config --variable mal2html gnome-doc-utils` \
77
]]>]<![CDATA[]></code>
79
xsltproc -o mal_block_screen.html \
80
--stringparam mal.cache.file `pwd`/mallard.cache \
81
`pkg-config --variable mal2html gnome-doc-utils` \
89
xsltproc -o mal_block_screen.html \
90
--stringparam mal.cache.file `pwd`/mallard.cache \
91
`pkg-config --variable mal2html gnome-doc-utils` \
96
xsltproc -o mal_block_screen.html \
97
--stringparam mal.cache.file `pwd`/mallard.cache \
98
`pkg-config --variable mal2html gnome-doc-utils` \
103
<!-- END examples -->
106
<!-- BEGIN processing -->
107
<section id="processing">
108
<title>Processing Expectations</title>
110
<p>The contents of an <code>example</code> element should each be rendered
111
as block elements as normal. Example should use margins, borders, or other
112
stylistic effects to provide a clear visual indication of the grouping.</p>
114
<!-- END processing -->
117
<!-- BEGIN comparison -->
118
<section id="comparison">
119
<title>Vergleich mit anderen Formaten</title>
121
<p>The <code>example</code> element is similar to the
122
<code href="http://www.docbook.org/tdg/en/html/example.html">example</code>
123
element in DocBook. In DocBook, the <code>example</code> element is a
124
formal element. In Mallard, <code>example</code> is a simple container
125
element, and does not allow a <code xref="mal_block_title">title</code>
128
<!-- END comparison -->