You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@empire-db.apache.org by andrew cooke <an...@acooke.org> on 2009/10/12 13:17:06 UTC

Importing XML

Hi,

I can see how to export data to XML via DBReader, but is there a
utility that will import data from the same format?

Thanks,
Andrew

Re: Importing XML

Posted by andrew cooke <ac...@gmail.com>.
Hi,

I am doing this project to learn Scala, so this is the first time for me.

Yes, I think it is the future of Java.  The current fashion is to
integrate features from functional languages into OO languages, and
Scala is the best and most popular approach to doing this with Java.

You do not need to do anything to integrate Empire DB with Scala,
because Scala inter-operates very nicely with Java.  I have had no
problems at all using Empire DB from Scala.  For example, here is my
very nice (IMHO!) code for the schema definition -
http://code.google.com/p/uykfd/source/browse/src/main/scala/org/acooke/uykfd/db/Schema.scala#21

However, Scala does still have problems.  The tool support is not very
good - there is an Eclipse plugin, but it is missing quite basic
features (having said that, there is a build tool called "sbt" -
simple build tool - that is really really impressive; if you do try
Scala I strongly recommend using it).  And I had to upgrade to the
development version before it would inter-operate with another Java
library (the Jersey web sevrices library) due to a Scala compiler bug.

One reason I am looking at Scala is that at work we use both Python
and Java, and we would like the advantages of Python with the type
safety of Java.  Scala is exactly what we need.  But I will not be
recommending its use just yet - it needs to mature a little more.

I hope that helps!

Andrew

2009/10/13 Francis De Brabandere <fr...@gmail.com>:
> Hi andrew,
>
> A bit offtopic. Do you use scala a lot? Do you think it is the future
> for java? Would there be a need for empire-db - scala integration
> code?
>
> Thanks,
> Francis
>
> On Tue, Oct 13, 2009 at 2:17 PM, andrew cooke <ac...@gmail.com> wrote:
>> Sorry, no - my fault.  I was using getRecordData instead of open.  Andrew
>>
>> 2009/10/13 andrew cooke <ac...@gmail.com>:
>>> Also, the dump is missing the first element of each table.  I believe
>>> that is a bug in Empire DB, but I will first try to reproduce it in
>>> Java and then file a report with a simple example.
>>
>
>
>
> --
> http://www.somatik.be
> Microsoft gives you windows, Linux gives you the whole house.
>

Re: Importing XML

Posted by Francis De Brabandere <fr...@gmail.com>.
Hi andrew,

A bit offtopic. Do you use scala a lot? Do you think it is the future
for java? Would there be a need for empire-db - scala integration
code?

Thanks,
Francis

On Tue, Oct 13, 2009 at 2:17 PM, andrew cooke <ac...@gmail.com> wrote:
> Sorry, no - my fault.  I was using getRecordData instead of open.  Andrew
>
> 2009/10/13 andrew cooke <ac...@gmail.com>:
>> Also, the dump is missing the first element of each table.  I believe
>> that is a bug in Empire DB, but I will first try to reproduce it in
>> Java and then file a report with a simple example.
>



-- 
http://www.somatik.be
Microsoft gives you windows, Linux gives you the whole house.

Re: Importing XML

Posted by andrew cooke <ac...@gmail.com>.
Sorry, no - my fault.  I was using getRecordData instead of open.  Andrew

2009/10/13 andrew cooke <ac...@gmail.com>:
> Also, the dump is missing the first element of each table.  I believe
> that is a bug in Empire DB, but I will first try to reproduce it in
> Java and then file a report with a simple example.

Re: Importing XML

Posted by andrew cooke <ac...@gmail.com>.
My code to both dump and restore a database is at
http://code.google.com/p/uykfd/source/browse/src/main/scala/org/acooke/uykfd/db/Dump.scala

However it is (1) in Scala; (2) doesn't follow your error handling
conventions; (3) makes assumptions about how keys are named and
implemented.

Also, the dump is missing the first element of each table.  I believe
that is a bug in Empire DB, but I will first try to reproduce it in
Java and then file a report with a simple example.

Andrew


2009/10/13 Rainer Döbele <do...@esteam.de>:
> Hi Andrew,
>
> currently there is no support for importing XML. The idea behind extracting query data in XML is mainly to be able to transform it to a desired representation though XSLT - for example to transform it directly to XHTML.
>
> Importing XML data however could probably not be solved in such a generic way and it is thus up to the application to implement the import logic.
>
> However if you think your import code could be useful for our community we'd be happy to have a look at it.
> Regards
>
> Rainer
>
>
> acooke.org@gmail.com wrote:
>> Re: Importing XML
>>
>> Hi,
>>
>> I can see how to export data to XML via DBReader, but is there a
>> utility that will import data from the same format?
>>
>> Thanks,
>> Andrew
>

re: Importing XML

Posted by Rainer Döbele <do...@esteam.de>.
Hi Andrew,

currently there is no support for importing XML. The idea behind extracting query data in XML is mainly to be able to transform it to a desired representation though XSLT - for example to transform it directly to XHTML.

Importing XML data however could probably not be solved in such a generic way and it is thus up to the application to implement the import logic.

However if you think your import code could be useful for our community we'd be happy to have a look at it.
Regards

Rainer


acooke.org@gmail.com wrote:
> Re: Importing XML
> 
> Hi,
> 
> I can see how to export data to XML via DBReader, but is there a
> utility that will import data from the same format?
> 
> Thanks,
> Andrew