[prog] Including entities in DocBook

Jenn Vesperman jenn at anthill.echidna.id.au
Thu Nov 21 23:35:50 EST 2002


On Thu, 2002-11-21 at 21:15, Dan Richter wrote:
> I have several DocBook docs that have a lot of entities in common. I would 
> like to declare all the entities in a single file, like this:
>    <!DOCTYPE ... [
>        <!ENTITY entity-file SYSTEM "foo">
>        &entity-file;
>    ]>
> But that doesn't work. Can anyone suggest a way of accomplishing the same 
> thing? While we're at it, it would be nice if it worked with XML, not just 
> SGML. (Yeah, I know, would you like the moon with that too...)

SGML format, in a file called top.sgml:


<!DOCTYPE BOOK PUBLIC "-//OASIS//DTD DocBook V3.1//EN" [

<!entity changes.sgml system "changes.sgml">
<!entity intro.sgml system "intro.sgml">
<!entity about.sgml system "about.sgml">
<!-- entity modules.sgml system "modules.sgml" -->
<!entity internet.sgml system "internet.sgml">
<!entity programming.sgml system "programming.sgml">
<!entity database.sgml system "database.sgml">
<!entity teaching.sgml system "../teaching.sgml">
<!entity terminology.sgml system "../terminology.sgml">

]>
<book>
<title>
.
.
.
&changes.sgml

</bookinfo>



<toc>
<title>Contents</title>
</toc>


&intro.sgml
&about.sgml
&internet.sgml
&programming.sgml
&database.sgml
&teaching.sgml
&terminology.sgml


</book>



(And yes, it works. That's cut-and-pasted from some of Netizen's old
teaching notes.)


Jenn V.
-- 
    "Do you ever wonder if there's a whole section of geek culture 
        	you miss out on by being a geek?" - Dancer.

jenn at anthill.echidna.id.au     http://anthill.echidna.id.au/~jenn/





More information about the Programming mailing list