Re: [xml] xmlTextWriter and namespace
- From: Rob Richards <rrichards ctindustries net>
- To: "Yong Chen (yongche)" <chen cisco com>
- Cc: xml gnome org
- Subject: Re: [xml] xmlTextWriter and namespace
- Date: Sat, 30 Jun 2007 15:42:00 -0400
Yong Chen (yongche) wrote:
rc = xmlTextWriterStartElementNS(writer, "my_prefix", BAD_CAST
"ORDER", "www.my.com");
The node "ORDER" will have namespace set to "my_prefix" which has value
of "www.my.com" as following:
<my_prefix:ORDER xmlns:my_prefix="www.my.com">
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="www.my.com" xmlns="www.my1.com"
xmlns:my_prefix_2="www.my2.com">
How do I do it? Which API to call?
You can simply write them out as attributes:
xmlTextWriterWriteAttribute(writer, "xmlns", "www.my1.com");
xmlTextWriterWriteAttribute(writer, "xmlns:my_prefix_2", "www.my2.com");
Rob
[
Date Prev][Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]