[xml] How xmlNewDocProp() works?



In fact here are two questions:
 
1)  I have successfuly created "xmlDoc" with xmlNewDoc() function.
Then I tryed to call xmlNewDocProp(). It returned me non zero value? but I found no changes in xmlDoc structure. The code is primitive:
 
{
   xmlDocPtr doc=NULL;
   xmlAttrPtr  Attr=NULL;
 
   doc = xmlNewDoc((xmlChar*)"1.0");
   Attr = xmlNewDocProp(doc, (xmlChar*)"PropName", (xmlChar*)"prop value");
   ..........................................
}
 
What is wrong?
 
==========================================================
 
2) "xmlDoc" structure has field "encoding". I couldn't find functions to read this field, or write into it. Can I do it directly simply writing somethign like this:
 
{
   xmlDocPtr doc=NULL;
 
   doc = xmlNewDoc((xmlChar*)"1.0");
   doc->encoding = "iso-8859-5";
   ..........................................
}
 
or I am wrong and there are stil some functions and I just didn't find them?

With respect Tyushin Vadim.


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