473,791 Members | 3,105 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Nested <!ENTITY> Tags?

I'm starting to look at DocBook-XML (not SGML) for producing a large
documentation set. The hierarchy of DocBook elements for organizing
the content is (more or less);

set
book
part
chapter
sect1
sect2
....

Most of the examples and documentation for DocBook-XML describe using
<!ENTITY> tags within a DOCTYPE element to break up a book into
multiple chapter files, like this:

<!DOCTYPE book
PUBLIC "-//OASIS//DTD DocBook XML V4.1//EN"
"file:///c:\home\db\dtd\ docbookx.dtd"
[
<!ENTITY preface SYSTEM "userguide.pref ace.xml" >
<!ENTITY ch1 SYSTEM "userguide.ch1. xml" >
<!ENTITY ch2 SYSTEM "userguide.ch2. xml" >
]

<book>
&preface;
&ch1;
&ch2;
</book>

This works fine. But suppose I would like to include my books within a
set. If I do something similar in a set container file:

<!DOCTYPE set
PUBLIC "-//OASIS//DTD DocBook XML V4.1//EN"
"file:///c:\home\db\dtd\ docbookx.dtd"
[
<!ENTITY userguide SYSTEM "userguide.book .xml" >
<!ENTITY reference SYSTEM "reference.book .xml" >
]


<set>
&userguide;
&reference;
</set>

This does not work fine -- attempting to parse the set file generates
errors because of multiple DOCTYPE elements in a single file (the
DOCTYPE elements in the included book XML files).

As far as I can tell, this means that if I want to use the set
element, each of my DocBook books must be implemented as a single XML
file. This is not practical for large books (such as N. Walsh's
example of an aircraft maintenance manual).

I am interested in what kinds of approaches people take when using
DocBook-XML to work with large documentation sets? Do you eschew the
use of the set element? Use some kind of mechanical means to merge the
parts of a book before processing?

Thanks,

Ed Dennison
Cognex Corporation

e-mail ed at the obvious domain.
Jul 20 '05 #1
2 3159
In article <b6************ *************@p osting.google.c om>,
Ed Dennison <tu******@yahoo .com> wrote:
<!DOCTYPE book
PUBLIC "-//OASIS//DTD DocBook XML V4.1//EN"
"file:///c:\home\db\dtd\ docbookx.dtd"
[
<!ENTITY preface SYSTEM "userguide.pref ace.xml" >
<!ENTITY ch1 SYSTEM "userguide.ch1. xml" >
<!ENTITY ch2 SYSTEM "userguide.ch2. xml" >
]
>
<book>
&preface;
&ch1;
&ch2;
</book>


First of all, note that you could have split out the chapter entity
definitions into an external parameter entity, and used another
external entity to package up all the chapters:

userguide-defs.pe:

<!ENTITY preface SYSTEM "userguide.pref ace.xml" >
<!ENTITY ch1 SYSTEM "userguide.ch1. xml" >
<!ENTITY ch2 SYSTEM "userguide.ch2. xml" >
<!ENTITY userguide-chapters SYSTEM "userguide-chapters.xml">

userguide-chapters.xml:

&preface;
&ch1;
&ch2;

userguide.xml:

<!DOCTYPE book
PUBLIC "-//OASIS//DTD DocBook XML V4.1//EN"
"file:///c:\home\db\dtd\ docbookx.dtd"
[
<!ENTITY % userguide-defs SYSTEM "userguide-defs.pe" >
%userguide-defs;
] <book>
&userguide-chapters;
</book>

Then you could do this:

<!DOCTYPE set
PUBLIC "-//OASIS//DTD DocBook XML V4.1//EN"
"file:///c:\home\db\dtd\ docbookx.dtd"
[
<!ENTITY % userguide-defs SYSTEM "userguide-defs.pe" >
%userguide-defs;
<!ENTITY % reference-defs SYSTEM "reference-defs.pe" >
%reference-defs;
]


<set>
<book>
&userguide-chapters;
</book>
<book>
&reference-chapters;
</book>
</set>

Still rather more overhead than is desirable, but maybe good enough.

(NB you will have to choose different entity names for the chapters
in each book.)

-- Richard
--
Spam filter: to mail me from a .com/.net site, put my surname in the headers.

FreeBSD rules!
Jul 20 '05 #2
"Ed Dennison" <tu******@yahoo .com> wrote in message
news:b6******** *************** **@posting.goog le.com...
--snip--

I am interested in what kinds of approaches people take when using
DocBook-XML to work with large documentation sets? Do you eschew the
use of the set element? Use some kind of mechanical means to merge the
parts of a book before processing?

--snip--

Chapter 19 [http://www.sagehill.net/docbookxsl/ModularDoc.html] in 'DocBook
XSL: The Complete Guide' [http://www.sagehill.net/docbookxsl/] has some
pretty good advice for working with modular DocBook files. Assuming you are
processing your sources with N. Walsh's styulesheets.
// Magnus
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3232
by: Eshrath | last post by:
Hi, What I am trying to do: ======================= I need to form a table in html using the xsl but the table that is formed is quite long and cannot be viewed in our application. So we are writing one object in C# which will take the entire table tag contents and renders. Ie., we need to pass "<table>………… <thead>……</thead>. <tr>.<td> <td>..<tr>.<td> <td> </table>" content to
2
10569
by: Donald Firesmith | last post by:
I am having trouble having Google Adsense code stored in XSL converted properly into HTML. The <> unfortunately become &lt; and &gt; and then no longer work. XSL code is: <script type="text/javascript"> <!]> </script> <script type="text/javascript"
27
2307
by: dip | last post by:
pardon the coversational manner of my thread subject. i'm having issues with the way that the two browsers handle CSS. this is an element i've defined in my style sheet. =========== sm { font: 10px arial; color: #53278F; }
5
628
by: Marcos MOS | last post by:
Hi, I've put a appSetting tag into my web.config, but when I try to catch its value to my Image WebControl occurs the follow error: "Server tags cannot contain <% ... %> constructs." on myPage.aspx (Notice the ImageUrl tag): <asp:Image id="Image1" runat="server" ImageUrl=<%=System.Configuration.ConfigurationSettings.AppSettings%> />
8
1640
by: Mark | last post by:
We have a multi-line textbox that users copy and paste email text into. The pasted text frequently will contain a tag like <blah@aol.com> or similar. I believe .NET is protecting itself from code injection by throwing a global error when this occurs. The exception message is pasted below. We will NOT be able to train our users to eliminate all <> tags. What's the best way to deal with this issue? Thanks in advance.
2
2130
by: SEB | last post by:
can any one please redirect me to how to use control builder class to parse the following case (or any other method) <mycustomcontroltag> <item attribute1="x" attribute2="y" ......> <subitems> <item attribute1="xx" attribute2="yy" ......> <subitems> more deeper nested tags can be here </subitems> </item>
3
5562
by: Ward Bekker | last post by:
Hi, I need a regular expression that will match only the tags that have nested tags inside them: Input: <control id=1><control id=2></control></control><control id=3></control> Goal:
1
1242
by: arunsh | last post by:
Hi I have problem fetching valuesof nested tags in xmlusing xsl stylesheet. For eg.The xml Looks like this <InputFields> <AcctReq> <CardNbrCnt length="3">001</CardNbrCnt> <Acct> <ReqCd length="3">001</ReqCd> <TransSourceTxt length="3">EXP</TransSourceTxt> </Acct>
3
3384
by: ajay2552 | last post by:
Hi, I have a query. All html tags start with < and end with >. Suppose i want to display either '<' or '>' or say some text like '<Company>' in html how do i do it? One method is to use &lt, &gt ,&ltCompany&gt to display '<', '>' and '<Company>' respectively. But is there any freeware code available which could implement the above functionality without having to use &gt,&lt and such stuff???
14
3161
by: Michael | last post by:
Since the include function is called from within a PHP script, why does the included file have to identify itself as a PHP again by enclosing its code in <?php... <?> One would assume that the PHP interpreter works like any other, that is, it first expands all the include files, and then parses the resulting text. Can anyone help with an explanation? Thanks, M. McDonnell
0
9669
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9515
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10207
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9995
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9029
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7537
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6776
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5431
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3718
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.