[xml] Help to write an element with an attribute



Hi to everyone,
I just discovered the XML APl, and I'm trying to do some tests to see if I can cover all my needs with the 
API.
So far, the only thing I can't do is this : create an element with an attribute, for ex : <label 
width="12">My name</label>

I managed to do <label >My name</label> with    rc = xmlTextWriterWriteElement(writer, BAD_CAST "label", "My 
name");

I managed to do <label width="12"/> with rc = xmlTextWriterStartElement(writer, BAD_CAST "label");    rc = 
xmlTextWriterWriteAttribute(writer, BAD_CAST "width", BAD_CAST "12");

I managed to do <labelwidth="12"></label> with  rc = xmlTextWriterFullEndElement(writer);

But I cannot managed to mix everything.

Thank you for your help.

Michael
Ce message est à l'attention exclusive des destinataires dÃsignÃs. Il peut contenir des informations 
confidentielles. Si vous n'Ãtes pas destinataire du message, merci d'en avertir immÃdiatement l'expÃditeur et 
de dÃtruire ce message. Le contenu de ce message ne pourrait engager la responsabilità de Steria que s'il a 
Ãtà Ãmis par une personne dÃment habilitÃe agissant dans le strict cadre de ses fonctions et à des fins non 
ÃtrangÃres à ses attributions. Bien que les meilleurs efforts soient faits pour maintenir cette transmission 
exempte de tout virus, l'expÃditeur ne donne aucune garantie à cet Ãgard et sa responsabilità ne saurait Ãtre 
engagÃe pour tout dommage rÃsultant d'un virus transmis.  
This message is intended exclusively for the designated addressee. It may contain confidential material. If 
you are not the correct addressee, please notify the sender immediately and destroy the message. The content 
of this message will engage the responsibility of Steria only if it has been sent by an authorized person 
acting in the strict scope of his functions and for purposes that are related to his competence. Although 
reasonable efforts have been made to keep this transmission free from viruses, the sender will not be liable 
for damages caused by a transmitted virus.  


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