External entity as CDATA

S

Soren Kuula

Hi,

I want to include som XML and DTD files into a DocBook document .. and I
want the contents to remain unparsed. Sort of, instead of cpoying and
pasting the code into the DocBook document :

<programlisting>
<![CDATA[blah blah blah]]>
</programlisting>

I want

<!DOCTYPE ..... [
<!ENTITY blahfile SYSTEM "blahfile.dtd">
]>

<programlisting>
<![CDATA[&blahfile;]]>
</programlisting>

Of course the above does not expand the entity; just evaluates to its
name. But it should give in idea of what I am trying to do.

Any way ?

Soren
 
R

Richard Tobin

Soren Kuula said:
I want to include som XML and DTD files into a DocBook document .. and I
want the contents to remain unparsed. Sort of, instead of cpoying and
pasting the code into the DocBook document :

I was going to say "that's impossible", but then I had an evil thought...

<!ENTITY % blahfile SYSTEM "blahfile.dtd">
<!ENTITY blahfile "<![CDATA[%blahfile;]]>">

You'll have to put that in an external subset, because you can't use
parameter entities that way in the internal subset. And you'd better
not have any CDATA sections in blahfile.

Don't tell anyone I suggested this.

-- Richard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top