Does anybody know if it is possible to import data in XML format into Cardbox 3?
Cardbox 3 doesn't import any XML-based data format at present, although you could construct an XSLT transform that converted XML to the Cardbox External format.
What XML-based format were you thinking of importing? As you probably know, XML on its own is not a format for data transfer, only a basis upon which data transfer formats can be constructed.
My data (structured literature references) come from the Ovid search platform and may look like this:
<?xml version="1.0" standalone="yes" ?>
The data are send automatically to individuals within my company. I want my people to be able to import them simply into a database without the need to transform them.
Applying a macro: is that something that can be automated, so 'digibetes' could perform it?
Bert/Marcel: yes, the best approach is to use a macro. This can do the conversion (by calling an external program, if necessary) and it can then tell Cardbox to import the converted file.
Marcel: the basic problem with providing "XML import" for Cardbox is that there are infinitely many XML-based formats.
For example, you have shown us one in which the hierarchy is
with each <F> tag containing a complicated mixture of <D> and <T> tags (I say "complicated" because sometimes both tags are present inside the <F> tag and sometimes the <T> tags occur **inside** the <D> tags).
But other formats are possible. The tag names may be different from your Ovid sample. Or the tag names may be the same as the field names themselves - something like:
Or there may be various other ways of specifying field names - for example, a separate tag that lists field names before the first <RECORD> tag, or even the method adopted in CSV format, where a dummy "Record 0" effectively gives the names of the fields.
It would be almost impossible to give the user enough options within Cardbox to handle all these variants, and if we did offer all those options then no user would ever be able to understand them! This is why it is best to have an external program doing some preprocessing and conversion.
Ultimately most kinds of XML reformatting and conversion can be done with XSLT transforms, and so we would in principle be able to do the mirror-image of Cardbox's XML output: you would be able to specify an XSLT transform for converting your XML input into a standard form before Cardbox receives it. But there are still some open questions about how to do this most effectively, and until more people are reading data from XML-based formats, it is best to use macros for the conversion.
|© 2010 Cardbox Software Limited|