From: Bruno S. <bru...@ya...> - 2005-04-06 23:46:13
|
hello Tony, thank you for the fast reply. I've tried to do as you said. I cannot get past this error message: variable `fo_invoice_result_tree' has initializer but incomplete type error: storage size of `fo_invoice_result_tree' isn't known fo_invoice_result_tree is declared as a FoXmlDoc. Any idea ? --- xml...@li... a écrit : > Send xmlroff-list mailing list submissions to > xml...@li... > > To subscribe or unsubscribe via the World Wide Web, > visit > > https://lists.sourceforge.net/lists/listinfo/xmlroff-list > or, via email, send a message with subject or body > 'help' to > xml...@li... > > You can reach the person managing the list at > xml...@li... > > When replying, please edit your Subject line so it > is more specific > than "Re: Contents of xmlroff-list digest..." > > > Today's Topics: > > 1. hello (Bruno Sadiez) > 2. Re: hello (Tony Graham) > > --__--__-- > > Message: 1 > Date: Tue, 5 Apr 2005 19:26:11 +0200 (CEST) > From: Bruno Sadiez <bru...@ya...> > To: xml...@li... > Subject: [xmlroff] hello > > I'm currently working on a project for a > philanthropic organization. I need to write an > invoicing application in C. I am not a professional > developer. > What I need to do is fetch data from a database and > issue PDF invoices. > I'm using Daniel Veillard's Libxml2 library and I > can > issue XML data files with all the required billing > details. I have written an XSL file with formating > objects. > As this project is supposed to issue many thousand > invoices at the end of each month, performance is a > concern. I would like to be able to > Load my XSLFO file only once > Apply it to many thousand dynamically created XML > data trees. > > > my code goes: > > xmlDocPtr invoice_doc = NULL; > (..... ) > > invoice_doc = xmlNewDoc(BAD_CAST "1.0"); > invoice_root_node = xmlNewNode(NULL, BAD_CAST > "invoice"); > xmlDocSetRootElement(invoice_doc, > invoice_root_node); > > then I populate the tree with the required billing > details. > > How is it possible to dynamically transform that > memory tree into a PDF. I would like to avoid > writing > xml data files to disk. > > I hope I'm being clear. > > Thanks in advance > > > > > > > __________________________________________________________________ > Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace > de stockage pour vos mails ! > Créez votre Yahoo! Mail sur > http://fr.mail.yahoo.com/ > > > --__--__-- > > Message: 2 > Date: Wed, 06 Apr 2005 04:26:56 +0100 > From: Tony Graham <Ton...@Su...> > Subject: Re: [xmlroff] hello > To: xml...@li... > > Welcome to the xmlroff-list, and thank you for your > interest in > xmlroff. > > Bruno Sadiez <bru...@ya...> writes: > > I'm currently working on a project for a > > philanthropic organization. I need to write an > > invoicing application in C. I am not a > professional > > developer. > > What I need to do is fetch data from a database > and > > issue PDF invoices. > > I'm using Daniel Veillard's Libxml2 library and I > can > > issue XML data files with all the required billing > > details. I have written an XSL file with formating > > objects. > > As this project is supposed to issue many thousand > > invoices at the end of each month, performance is > a > > concern. I would like to be able to > > Load my XSLFO file only once > > Apply it to many thousand dynamically created > XML > > data trees. > > > > > > my code goes: > > > > xmlDocPtr invoice_doc = NULL; > > (..... ) > > > > invoice_doc = xmlNewDoc(BAD_CAST "1.0"); > > invoice_root_node = xmlNewNode(NULL, BAD_CAST > > "invoice"); > > xmlDocSetRootElement(invoice_doc, > > invoice_root_node); > > > > then I populate the tree with the required billing > > details. > > > > How is it possible to dynamically transform that > > memory tree into a PDF. I would like to avoid > writing > > xml data files to disk. > > > > I hope I'm being clear. > > Yes, you are. > > The short answer is that you can do what you want. > > The public interfaces for the libfo library work on > filenames for the > XML input and the XSLT stylesheet (if any) so > someone using the > library doesn't have to know or care about libxml2 > or libxslt. > > The public interfaces work on either strings or > FoXmlDoc objects that > are really just GObject wrappers of libxml2. > > The FoXSLTFormatter wrapper for libxslt currently > requires a string > for the filename for the XSLT stylesheet, which is > possibly > shortsighted of me. > > You can, however, do the transformation yourself > using libxslt and > then create a FoXmlDoc from the result of your > transformation using > fo_xml_doc_set_xml_doc() from fo-xml-doc-private.h: > > FoXmlDoc result_tree = fo_xml_doc_new (); > fo_xml_doc_set_xml_doc (result_tree, > your_xml_doc_ptr); > > You can then use your 'result_tree' with an > FoXSLFormatter as in > xmlroff-libfo.c from the libfo-examples package. > > The other thing to look at is using fo_libfo_init2() > and supplying > your own malloc, etc. so that libfo and libxslt use > the same heap. > > You are trying something that AFAIK hasn't been > tried before, so I'm > interested to know how you get on. I do expect that > you will find > that xmlroff has memory leaks, but if you can > identify them, we can > look to fixing them. > > Regards, > > > Tony. > > > > > --__--__-- > > === message truncated === __________________________________________________________________ Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos mails ! Créez votre Yahoo! Mail sur http://fr.mail.yahoo.com/ |
From: Stefan S. <se...@sy...> - 2005-04-06 23:49:53
|
Bruno Sadiez wrote: > hello Tony, > > thank you for the fast reply. > > I've tried to do as you said. I cannot get past this > error message: > variable `fo_invoice_result_tree' has initializer but > incomplete type > error: storage size of `fo_invoice_result_tree' isn't > known > > fo_invoice_result_tree is declared as a FoXmlDoc. This usually means the type has been forward-declared, i.e. some #include may be missing to expose a real declaration to the code using it. Regards, Stefan |
From: Tony G. <Ton...@Su...> - 2005-04-07 01:00:28
|
Stefan Seefeld <se...@sy...> writes: > Bruno Sadiez wrote: >> hello Tony, >> thank you for the fast reply. >> I've tried to do as you said. I cannot get past this >> error message: >> variable `fo_invoice_result_tree' has initializer but >> incomplete type >> error: storage size of `fo_invoice_result_tree' isn't >> known >> fo_invoice_result_tree is declared as a FoXmlDoc. > > This usually means the type has been forward-declared, > i.e. some #include may be missing to expose a real > declaration to the code using it. Stefan is correct. The problem may be in the two lines of code in my previous post where I omitted a '*'. I should have used a FoXmlDoc*, not a FoXmlDoc: FoXmlDoc *result_tree = fo_xml_doc_new (); fo_xml_doc_set_xml_doc (result_tree, your_xml_doc_ptr); If that is not the problem, please post the function containing the problem and the complete compiler error message so we have a better chance of working out the problem. Please note, however, that I am very short of time for the rest of this week and I will have limited email ability next week. Regards, Tony. |