Ask Your Question
1

About using odt(template file) and XML(data file) files to create document in LibreOffice [closed]

asked 2013-04-29 02:18:42 +0200

Beavey gravatar image

updated 2013-04-30 07:04:23 +0200

qubit gravatar image

Can I use odt(template file) and XML(data file) files to create document in LibreOffice?

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by Alex Kemp
close date 2015-10-30 21:36:44.587472

1 Answer

Sort by » oldest newest most voted
3

answered 2013-04-29 17:10:03 +0200

CyanCG gravatar image

The short answer to your question is “yes, this is very much possible and is one of the main advantages of XML: you can combine any XML data with any other XML data, given the right transformations”.

That is the harder part: getting your XML data in a useful format. Let us make a helpful distinction. XML documents can have either a narrative focus or a records-based focus:

  • What I mean by narrative is a document that has one main run of text organized more or less linearly. XHTML, OpenDocument Text, TEI, DocBook and RSS all have a narrative focus, even though they all have different specific purposes.

  • What I mean by records-based focus is a document that is not primarily linear and is intended for record-keeping, comparison, calculation, analysis or reference. OpenDocument Spreadsheet, OpenDocument Database and XML configuration files in general have a records-based focus.

That being said, any well-formed XML document can (theoretically) be imported in LibreOffice and recognized as XML, whether the document has a narrative or records-based focus. However, by default, any imported XML document which is not specifically accounted for by an import filter will be opened in LibreOffice Calc as though it were records-based. One interesting case is opening the content.xml or the styles.xml from an OpenDocument Text document: even though they are part of a format that is accounted for, individually they present themselves as records-based documents when imported.

When importing such a document in Calc, the application will offer to “map” the elements and attributes of the document to cells and properties in a spreadsheet table. Depending on the document type, this might be what you want or not. If it is what you want, you simply need to take the time to think about how you want to organize the document’s information in a table or set of tables.

If your document has a narrative focus and you want to use its content in an OpenDocument Text document, you have multiple options that all involve some work on your part.

  • If, for the given document type, there already exists a tool to convert it to a format that is already accounted for in LibreOffice, then by all means use this tool. However, the tool might not have the desired granularity i.e. it might not offer you enough options in deciding how to treat the elements, attributes and ...

(more)
edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-04-29 02:18:42 +0200

Seen: 2,662 times

Last updated: Apr 30 '13