2006/11/17, Tallapragada, Sridevi <[EMAIL PROTECTED]>:
> Hi David
>
> Check if this helps:
>
> hchild2 = xmlNewChild(hchild1,NULL,(const xmlChar*)"elementname","also a
> value here");
> xmlSetProp(hchild2, (const xmlChar*)"attr1", (const xmlChar*)"hello");

Small suggestion; there's a BAD_CAST macro you can use for the cast, e.g:

BAD_CAST "elementname"

Regards,
Aron

> -----Original Message-----
> From: "David" [mailto:[EMAIL PROTECTED]
> Sent: Friday, November 17, 2006 1:20 PM
> To: xml @ gnome. org
> Subject: [xml] attribute and value element
>
> Hello,
>
> I want to use the xmlwriter module from libxml2 and want to code that
> resuls in the following xml.
>
> <elementname attr1="hello">also a value here</elementname>
>
>
>
> I can produce the following xml, but i want to use value and attribute
> with one xml-tag.
>
> <elementname attr1="hello">
>  <value>also a value here</value>
> </elementname>
>
>
> I hope someone can help me.
>
> Cheerz, David
> _______________________________________________
> xml mailing list, project page  http://xmlsoft.org/ [email protected]
> http://mail.gnome.org/mailman/listinfo/xml
> _______________________________________________
> xml mailing list, project page  http://xmlsoft.org/
> [email protected]
> http://mail.gnome.org/mailman/listinfo/xml
>
_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
[email protected]
http://mail.gnome.org/mailman/listinfo/xml

Reply via email to