You can put code into the XML document by using CDATA sections.
Anything in a CDATA section is ignored by the parser so you can put
characters that you normally cannot add to an XML document, i.e., less
than, greater than, etc.
Below is how a CDATA section is constructed for the Docbook example
<p>Anything in a CDATA section is ignored by the XML Parser.</p>
The parser will also respect any white space in the CDATA section so
what you see will be what you get inside the section.
Hope this helps!
On 2015-06-21 12:16, David Ashley wrote:
In the past when creating a new document that will contain code
examples in C/C++ or Python I always placed the examples in separate
files from the main XML. This way it would be easier to test those
examples to make sure that they work as intended. Being new to the
Fedora Docs team I have looked at some of the current documents and
they do not seem to separate the code from the document itself. So I
am wondering if I should follow that convention or separate the code
from the XML like I have done in the past?
Please provide some guidance.
Betty Harvey | Phone: 410-787-9200 FAX: 9830
Electronic Commerce Connection, Inc. |
harvey(a)eccnet.com | Washington,DC XML Users Grp
Member of XML Guild (www.xmlguild.org