[XML-SIG] external entities and CDATA sections

Uche Ogbuji uche.ogbuji@fourthought.com
Fri, 25 May 2001 09:02:09 -0600


> Hello,
> 
> While writing some documentation, I wanted to include some python code in
> a docbook document. My first thought was using an external entity
> referencing the source file. However, the code has some interger
> comparison code, and features a couple of '<' characters, so it should be
> set in a CDATA section for proper handling. This in turn prevents the
> resolution of the external entity. 
> 
> How would the XML experts on the list tackle this?

Unfortunately there is no easy solution.  You'd have to wrap all the entities 
in

]]>&entity;<![CDATA[

None of the other potential solutions, XInclude, XLink of embed type, etc., 
would help here.

Of course you can always not use CDATA sections and just &lt; escape what you 
need to.


-- 
Uche Ogbuji                               Principal Consultant
uche.ogbuji@fourthought.com               +1 303 583 9900 x 101
Fourthought, Inc.                         http://Fourthought.com 
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python