Re: [xml] Help to write an element with an attribute
- From: michael jerusalmi steria com
- To: eric vicsmba com,xml gnome org
- Subject: Re: [xml] Help to write an element with an attribute
- Date: Fri, 13 Apr 2012 09:28:50 +0200
Thank you for your answer. I found a few hours before your answer the Tree API, and it's exactly what I
needed.
Thanks for your help. The subject is closed.
Regards
michael
-----"Eric S. Eberhard" <eric vicsmba com> a Ãcrit : -----
=======================
A : michael jerusalmi steria com, xml gnome org
De : "Eric S. Eberhard" <eric vicsmba com>
Date : 12/04/2012 20:16
Objet : Re: [xml] Help to write an element with an attribute
=======================
My question is why not just use the tree API? I have found little value
in the Writer API. In theory you can make larger files because you
don't have all the "stuff" in memory. Having said that, we exchange
data with a LOT of different people and have discovered that almost
nobody unsophisticated can parse the output from even a large tree, let
alone something huge you could make with the writer. When we do large
dumps (say an entire inventory listing with 100,000 SKUs with prices,
quantities, catalog info, etc) we just break and make a new file every
1000 records or so, thereby making it possible for people parsing with a
PC (or looking at it with an XML reader) to use our files. The tree
API also allows non-serialized XML creation allowing you to go back and
add things, delete things, make changes, etc. It is a lot more
flexible. The writer is simply like writing it to disk directly -- the
tree API is a linked list in memory with a lot of flexibility. In the
VERY rare cases where somebody needs a HUGE file instead of a bunch of
little ones I find it easier to still make the little ones and then
write a very simple program to input the files. On the first one only
include the header and root element, on the last one only include the
ending root element, all others strip both. It takes very few lines of
code, and can easily be implemented to write to a TCP/IP port. Eric
On 4/12/2012 3:17 AM, michael jerusalmi steria com wrote:
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.
_______________________________________________
xml mailing list, project page http://xmlsoft.org/
xml gnome org
http://mail.gnome.org/mailman/listinfo/xml
--
Eric S. Eberhard
VICS
PO Box 3661
Camp Verde, AZ 86322
928-567-3727 work 928-301-7537 cell
http://www.vicsmba.com/index.html (our work)
http://www.vicsmba.com/ourpics/index.html (fun pictures)
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]