[xml] referencing to parameter entity



Hello

I'm writing an extension to libidmef library that generates xml docs,
and uses libxml. I 
wrote the dtd that defines new elements. I need referencing to the new
dtd 
dinamically when creating the doc.

A general libidmef doc starts like this:
<?xml version="1.0"?>
<!DOCTYPE IDMEF-Message PUBLIC "-//IETF//DTD RFC XXXX IDMEF v1.0//EN"
"/usr/local/share/snort/idmef-message.dtd">
...

I need to create a doc that starts like this:
<?xml version="1.0"?>
<!DOCTYPE IDMEF-Message PUBLIC "-//IETF//DTD RFC XXXX IDMEF v1.0//EN"
"/usr/local/share/snort/idmef-message.dtd" [
<!ENTITY % x-fwmessage SYSTEM "/usr/local/share/snort/fw-message.dtd">
%x-fwmessage;
]>
...

I can add the external dtd to the doc as parameter entity with 
xmlAddDocEntity(doc, FWDTD_NAME, XML_EXTERNAL_PARAMETER_ENTITY, NULL,
FWDTD_PATH, NULL);
function.

This function generates this doc:
<?xml version="1.0"?>
<!DOCTYPE IDMEF-Message PUBLIC "-//IETF//DTD RFC XXXX IDMEF v1.0//EN"
"/usr/local/share/snort/idmef-message.dtd" [
<!ENTITY % x-fwmessage SYSTEM "/usr/local/share/snort/fw-message.dtd">
]>
...

My question is, how can I create the "%x-fwmessage;" reference.
Sorry about the question if it is trivial, but I'm new in xml.

Thanks,
JOhn



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]