Next in thread → Next in month →

Re: [docbook] Including multiple elements

From
Bob Stayton <>
Date
2010-03-12T19:30:11+00:00
ID
00c301cac21a$632640b0$6600a8c0@pazu
Thread
Re: [docbook] Including multiple elements
Hi,
You could use a system entity reference.  System entities do not have to be 
well-formed XML documents, and they are processed by every XML parser.  However, they 
do have to be declared before being used.

<!DOCTYPE article [
<!ENTITY exampleA SYSTEM "programlisting.xml">
]>
<article>
  <example>
    <title>My example</title>
    &exampleA;
  </example>
</article>


Bob Stayton
Sagehill Enterprises



----- Original Message ----- 
From: "Remko Tronçon" <>
To: <>
Sent: Tuesday, March 09, 2010 4:47 AM
Subject: [docbook] Including multiple elements


> Hi,
>
> Is there a clean way to put multiple elements to include in a document
> into one file?
>
> For example, I have the following toplevel file:
>  <article>
>    <example>[...]</example>
>  </article>
> At the place of the [...], I want to insert a generated
> <programlisting/> and <calloutlist/> (which belong together, and
> therefore are generated in one file). I'm currently doing it like
> this:
> <article>
>  <example>
>    <include xmlns="http://www.w3.org/2001/XInclude"
> href="programlisting.xml"
> xpointer="xpointer(//programlisting|//calloutlist)"/>
>  </example>
> </article>
> Where programlisting.xml looks like this:
> <foo>
>  <programlisting>...</programlisting>
>  <calloutlist>...</calloutlist>
> </foo>
>
> The drawbacks are that
> a) The dummy 'foo' element is ugly
> b) this uses xpointer, which not all processors support
>
> I was hoping I could replace <foo/> by some container element like
> <div/> in HTML, such that I could xinclude the whole document, but
> there is no such element in DocBook AFAIK.
>
> Is there a cleaner alternative (except for splitting both up into 2 files)?
>
> thanks,
> Remko
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: 
> For additional commands, e-mail: 
>
>
>
Next in thread → Next in month →