[xmlsec] About xmlParseInNodeContext() in libxml2.

StackWD(hotmail) StackWD at hotmail.com
Wed Sep 15 02:48:04 PDT 2004


Hi!

  I'm sorry to say although I have inserted those two lines as below, the error is so. But I have found an interesting things, if remove the attribute xsi:type=\"xsd:int\" of buffer, that's OK!

  It's important that I want to solve the problem of Encryption and namespace viewed of Mailing list in web site. Now we MUST encrypt the soap such as below, but when decryption the namespace of xsi not found where it defined. I want know how to solve this old problem (may be already solved) or give me some advice. 
	

>Can you try to insert the two lines from bellow? If it will not work
>then it would be a good idea to file a bug against LibXML2
>
>http://xmlsoft.org/bugs.html
>
>I'll try to look at this more this weekend (sorry, but I doubt that I'll
>have time before that).
>
>Aleksey
>
>> ===========================================================================================
>>     char *buffer = "<xsi:getsumReturn xsi:type=\"xsd:int\">9</xsi:getsumReturn>";
>> 
>>     xmlInitParser();
>>     LIBXML_TEST_VERSION
>>     xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS;
>>     xmlSubstituteEntitiesDefault(1);
>> 
>>     /* load template */
>>     doc = xmlParseFile("soap.xml");
>>     if ((doc == NULL) || (xmlDocGetRootElement(doc) == NULL)){
>>         fprintf(stderr, "Error: unable to parse file \"%s\"\n", "soap.xml");
>>         goto done;
>>     }
>> 
>>     ret = xmlParseInNodeContext(xmlDocGetRootElement(doc), buffer, xmlStrlen(buffer), XML_PARSE_NOENT, &encNode);
>>     if(ret < 0) {
>>         fprintf(stderr, "Error: xmlParseInNodeContext.\n");
>>         goto done;
>>     }
>> 
>
>AS ====> xmlUnlinkNode(encNode);
>AS ====> xmlSetTreeDoc(encNode, doc);
>
>>     xmlAddChild(xmlDocGetRootElement(doc), encNode);
>>     xmlDocDump(stdout, doc);
>> 
>>     xmlFreeDoc(doc);  <----- The error : Segmentation fault occur!


 
				 
        StackWD(hotmail)
        StackWD at hotmail.com
          2004-09-15



More information about the xmlsec mailing list