[xmlsec] Signing a document with key and cert..

Marius Kjeldahl marius@kjeldahl.net
Wed, 20 Nov 2002 17:39:02 +0100


Aleksey Sanin wrote:
>>
>> My next challenge is to do this dynamically (so if anybody have 
>> experience on how to do that using libxml, feel free to spill the beans). 
> 
> 
> Check xmlCreateIntSubset() from th libxml/tree.h file.

By using xmlCreateIntSubset, the following gets put into my document:

<?xml version="1.0"?>
<!DOCTYPE ThreeDSecure PUBLIC "" "">
<ThreeDSecure>
...

which seems ok. Now I need to add the the definitions, like:

<!ATTLIST CRReq id ID #IMPLIED>

so that the complete result becomes something like:

<?xml version="1.0"?>
<!DOCTYPE ThreeDSecure [
<!ATTLIST CRReq id ID #IMPLIED>
]>
<ThreeDSecure>
...

which validates ok.

I've googled around both the web and newsgroups, but have not found the correct 
way to add the "attlist" nodes to the dtd. I've tried xmlAddDocEntity with 
XML_INTERNAL_PARAMETER_ENTITY, but I can not seem to get it work. In addition, I 
found something in valid.h which looks promising - xmlAddAttributeDecl - but 
this one requires a xmlValidCtxtPtr which I guess is necessary at the validation 
phase (which I can not do, since I do not have a complete document yet).

Any experts who want to give me a hint of what functions I need to call to add 
ATTLIST (and similar) entries in libxml?

-- 
Mvh, Marius Kjeldahl