[libreoffice-users] Re: Import XML files?
Mark Stanton wrote I hope not, XML is supposed to be a self defining file format surely? It's a meta-file format. You (who defines all the XML tags) are the one and only person able to develop import and export software for your particular flavour of XML. xml BLAH foo=bar blub x=121.43/blub scramble crucifix=Trueertzuiopdfghjklöxcvbnm/scramble /BLAH /xml How would you translate this into a spreadsheet? Is BLAH a row, a column? What is scramble? How to deal with the attributes? Nobody ever tells us anything about his/her user-defined file formats such as CSV or XML. So most of the topics becaome lengthy and some remain unsolved. A general importer ought to be easy, no? Google reveals plenty of examples about how to write XLST scritpts to import/export user-defined XML formats into/from ODF. This is development work just like writing macros or setting up a database. In all those years since OOo 1.0 nobody wrote a generic XML-to-Calc tool. I would search in the database world for existing XML tools for database engines. Once you have the data in a connectable database, you have it it in Calc and Writer as well. -- View this message in context: http://nabble.documentfoundation.org/Import-XML-files-tp4010875p4010988.html Sent from the Users mailing list archive at Nabble.com. -- For unsubscribe instructions e-mail to: users+h...@global.libreoffice.org Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/ Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette List archive: http://listarchives.libreoffice.org/global/users/ All messages sent to this list will be publicly archived and cannot be deleted
[libreoffice-users] Re: Import XML files?
FoxPro export exports database fields like this: ?xml version=1.0?Document OrderUpdate OrderId12345/OrderId OrderDate01/01/2004/OrderDate Confirmation123/Confirmation Storage StorageId01/StorageId Quantity1450/Quantity /Storage Storage StorageId02/StorageId Quantity2480/Quantity /Storage /OrderUpdate /Document It might be comparatively easy to write a Base driver for structures like this one. A spreadsheet does not imply any such structure. As far as I know, Excel imports arbitrary flavours of tabular XML through a wizard analog to a CSV import wizard. You specify the column tags, the row tags and get raw data in a spreadsheet. In the following example each record represents one consecutive spreadsheet row (starting at row#1) and each value represents a consecutive column value within that row (starting at column A). First row has column labels. xml record value type=StringID/value value typ=StringOrder Date/value value typ=StringValue/value /record record value type=Number13/value value type=Date2010-12-28/value value type=StringSome Text/value /record record value type=Number14/value value type=Date2010-12-31/value value type=StringSome Other Text/value /record /xml This one represents the very same data in German tags: xml zeile wert typ=ZeichenID/wert wert typ=ZeichenOrder Date/wert wert typ=ZeichenValue/wert /zeile zeile wert typ=Zahl13/wert wert typ=Datum2010-12-28/wert wert typ=ZeichenSome Text/wert /zeile zeile wert typ=Zahl14/wert wert typ=Datum2010-12-31/wert wert typ=ZeichenSome Other Text/wert /zeile /xml Other flavours of xml may describe rows within columns, railway connections in time tables, articles and clients in invoices, ... Any tool to import arbitrary XML into sheets needs to import text, numbers, special numbers and blanks into columns and rows even if there is no rectangular structure of records and fields. If there is a database structure (like the above FoxPro XML) it needs to import each value (number, text, date, blank) under its given field name. Most people who ask for XML import into Calc mean the XML flavour produced by Excel 2003. But they do not know that this particular flavour of XML is specifically made for that particular application. Other applications to read Excel-XML can be written easily but they need to be written. XML is not a file format on its own right. XML lets you define your own file formats. -- View this message in context: http://nabble.documentfoundation.org/Import-XML-files-tp4010875p4011079.html Sent from the Users mailing list archive at Nabble.com. -- For unsubscribe instructions e-mail to: users+h...@global.libreoffice.org Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/ Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette List archive: http://listarchives.libreoffice.org/global/users/ All messages sent to this list will be publicly archived and cannot be deleted
Re: [libreoffice-users] Re: Import XML files?
On 2012-10-05 02:22, Jay Lozier wrote: On 10/04/2012 08:11 AM, Andreas Säger wrote: Mark Stanton wrote I hope not, XML is supposed to be a self defining file format surely? It's a meta-file format. You (who defines all the XML tags) are the one and only person able to develop import and export software for your particular flavour of XML. xml BLAH foo=bar blub x=121.43/blub scramble crucifix=Trueertzuiopdfghjklöxcvbnm/scramble /BLAH /xml How would you translate this into a spreadsheet? Is BLAH a row, a column? What is scramble? How to deal with the attributes? Nobody ever tells us anything about his/her user-defined file formats such as CSV or XML. So most of the topics becaome lengthy and some remain unsolved. A general importer ought to be easy, no? Google reveals plenty of examples about how to write XLST scritpts to import/export user-defined XML formats into/from ODF. This is development work just like writing macros or setting up a database. In all those years since OOo 1.0 nobody wrote a generic XML-to-Calc tool. I would search in the database world for existing XML tools for database engines. Once you have the data in a connectable database, you have it it in Calc and Writer as well. -- View this message in context: http://nabble.documentfoundation.org/Import-XML-files-tp4010875p4010988.html Sent from the Users mailing list archive at Nabble.com. Andreas, My understanding the problem with importing a generic XML file is that the document definition does not a (defacto) standard that one can write an import script for? If the XML file uses a known definition (ODF for example) then it is easier to write an import script because there is a standard defining the document internals. The extension of this is, if the file format is well documented, even if it is proprietary, then writing an import script is possible because there exists a specification for the format. The only issue then is whether one has the complete format specification. Some of the XML files I import have nested lists, i.e not flat. I like to define how these are imported. The file also has a lot of fields I don't want imported (not shown). So by using a filter I get what I want displayed how I want. ?xml version=1.0 encoding=UTF-8? customers type=array customer saltc9bf86ac97d3f742f85e9811d338a594af727dbc/salt updated-at type=datetime2010-02-16T17:03:57-05:00/updated-at valid-access-count type=integer0/valid-access-count customer-visibility-groups type=array customer-visibility-group id type=integer10/id nameAll Customers/name the-parent-record-id type=NilClass1/the-parent-record-id /customer-visibility-group customer-visibility-group id type=integer11/id nameOIML customers/name the-parent-record-id type=NilClass1/the-parent-record-id /customer-visibility-group customer-visibility-group id type=integer258/id nameAE-United Arab Emirates/name the-parent-record-id type=NilClass1/the-parent-record-id /customer-visibility-group customer-visibility-group id type=integer21/id nameMNA-Middle East amp; N Africa/name the-parent-record-id type=NilClass1/the-parent-record-id /customer-visibility-group /customer-visibility-groups /customer /customers Steve -- For unsubscribe instructions e-mail to: users+h...@global.libreoffice.org Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/ Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette List archive: http://listarchives.libreoffice.org/global/users/ All messages sent to this list will be publicly archived and cannot be deleted
[libreoffice-users] Re: Import XML files?
MySQL can import your customer-visibility-groups: http://dev.mysql.com/doc/refman/5.5/en/load-xml.html If there is any reason why you want customer-visibility-groups in a calculator software, connect a registerd Base document to your MySQL server and dump the imported data from the data source pane into a sheet which creates a refreshable link. XSLT and ODF office suites: http://www.ibm.com/developerworks/xml/library/x-oocalc/ http://www.ibm.com/developerworks/xml/tutorials/x-xsltopenoff/index.html [9 pages] There are various topics on the OOo forums: http://www.oooforum.org/forum/viewtopic.phtml?t=67906 http://forum.openoffice.org/en/forum/viewtopic.php?t=3490f=45 -- View this message in context: http://nabble.documentfoundation.org/Import-XML-files-tp4010875p4011135.html Sent from the Users mailing list archive at Nabble.com. -- For unsubscribe instructions e-mail to: users+h...@global.libreoffice.org Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/ Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette List archive: http://listarchives.libreoffice.org/global/users/ All messages sent to this list will be publicly archived and cannot be deleted
Re: [libreoffice-users] Re: Import XML files?
On 2012-10-05 10:27, Andreas Säger wrote: MySQL can import your customer-visibility-groups: http://dev.mysql.com/doc/refman/5.5/en/load-xml.html If there is any reason why you want customer-visibility-groups in a calculator software, connect a registerd Base document to your MySQL server and dump the imported data from the data source pane into a sheet which creates a refreshable link. XSLT and ODF office suites: http://www.ibm.com/developerworks/xml/library/x-oocalc/ http://www.ibm.com/developerworks/xml/tutorials/x-xsltopenoff/index.html [9 pages] There are various topics on the OOo forums: http://www.oooforum.org/forum/viewtopic.phtml?t=67906 http://forum.openoffice.org/en/forum/viewtopic.php?t=3490f=45 Hi Andreas. The file with that XML snippit is uploaded to a MySQL database behind Rails every 15 minutes. From time to time I load it into calc to provide quick lists of extracted data to our sales guys who cope fare easier with a spread sheet. Steve -- For unsubscribe instructions e-mail to: users+h...@global.libreoffice.org Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/ Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette List archive: http://listarchives.libreoffice.org/global/users/ All messages sent to this list will be publicly archived and cannot be deleted
[libreoffice-users] Re: Import XML files?
Am 03.10.2012 20:54, Mark Stanton wrote: I've got an XML file (I've generated myself, programmatically). I thought it ought to be easy to import it in LO (3.4.6), somehow. I thougth Calc would be a good bet, but it just gives me General I/O error. Base does the same. The website (help.libreoffice.org/Common/About_Import_and_Export_Filters) suggests it ought to be doable but gives no details whatsoever. Anyone got any pointers I could use? Regars Mark Stanton Well, if you implemented your own XML format then you should know the appropriate software for your particular data structures. If there is some reason why you want to open your file format in this office suite then you have to write an XSLT script translating your specific XML flavour into ODF for import and possibly vice versa for export. -- For unsubscribe instructions e-mail to: users+h...@global.libreoffice.org Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/ Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette List archive: http://listarchives.libreoffice.org/global/users/ All messages sent to this list will be publicly archived and cannot be deleted
[libreoffice-users] Re: Import XML files?
Le 03/10/12 20:54, Mark Stanton a écrit : Hi Mark, I've got an XML file (I've generated myself, programmatically). I thought it ought to be easy to import it in LO (3.4.6), somehow. I thougth Calc would be a good bet, but it just gives me General I/O error. Base does the same. Without a filter to transform it into something readable/formattable by one of the apps of the suite, at best you could possibly open it in Writer as plain text. The installed XML/XSLT filters that come with LO are : Docbook from SXW (old binary StarOffice/OOo format) - import/export MediaWiki - export Mediawiki_web - export MS Excel 2003 XML - import/export MS Word 2003 XML - import/export UOF Presentation - import/export UOF Spreadsheet - import/export UOF Text - import/export XHTML Calc - export XHTML Writer - export XHTML Draw - export XHTML Impress - export Alex -- For unsubscribe instructions e-mail to: users+h...@global.libreoffice.org Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/ Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette List archive: http://listarchives.libreoffice.org/global/users/ All messages sent to this list will be publicly archived and cannot be deleted