Re: [xml] xmlTextWriter and namespace

Yong Chen (yongche) wrote:
   rc = xmlTextWriterStartElementNS(writer, "my_prefix", BAD_CAST
"ORDER", "");

The node "ORDER" will have namespace set to "my_prefix" which has value
of "" as following:

 <my_prefix:ORDER xmlns:my_prefix="">

My question is, if I want to define several more namespaces (including
the default namespace) on node "ORDER", as following:

  <my_prefix:ORDER xmlns:my_prefix="" xmlns=""

How do I do it? Which API to call?
You can simply write them out as attributes:
xmlTextWriterWriteAttribute(writer, "xmlns", "");
xmlTextWriterWriteAttribute(writer, "xmlns:my_prefix_2", "");


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