Σχετ: Σχετ:  Perl module to transform XSL to JSON

From: dasos ili <dasos_ili_at_nyob>
Date: Tue, 24 Sep 2013 10:05:55 +0100
To: CODE4LIB_at_LISTSERV.ND.EDU
and another thing, will elasticsearch work directly to XML?





________________________________
 Απο: Marc Chantreux <mc@UNISTRA.FR>
Προς: CODE4LIB@LISTSERV.ND.EDU 
Στάλθηκε: 11:59 π.μ. Τρίτη, 24 Σεπτεμβρίου 2013
Θέμα: Re: [CODE4LIB] Σχετ: [CODE4LIB] Perl module to transform XSL to JSON
 

On Tue, Sep 24, 2013 at 09:29:58AM +0100, dasos ili wrote:
>    for storage in mongodb and elasticsearch

then don't convert anything and just store the xml content as a value:
( less code, less transformation, less computation so more speed and
more reliability)

use IO::All;
use MongoDB;

my $xml = io('file.xsl')->all; 
my $client = MongoDB::MongoClient->new
   ( host => 'localhost'
   , port => 27017 );
my $database   = $client->get_database( 'foo' );
my $collection = $database->get_collection( 'bar' );
my $id         = $collection->insert({ transformation => $xml });

HTH




-- 
Marc Chantreux
Université de Strasbourg, Direction Informatique
14 Rue René Descartes,
67084  STRASBOURG CEDEX
☎: 03.68.85.57.40
http://unistra.fr
"Don't believe everything you read on the Internet"
    -- Abraham Lincoln
Received on Tue Sep 24 2013 - 05:10:39 EDT