-
Notifications
You must be signed in to change notification settings - Fork 0
/
cmdi-xsl-per-schema.pl
executable file
·33 lines (25 loc) · 1.06 KB
/
cmdi-xsl-per-schema.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/perl -w
#@---------------------------------------------------------------------------------------------------
#@ By Junte Zhang <[email protected]> in 2013
#@ Distributed under the GNU General Public Licence
#@
#@ This script generates XSLT on-the-fly to map CMDI files to Solr XML format
#@---------------------------------------------------------------------------------------------------
use IndexCMDI; # plugin reference to Package file
use Data::Dumper;
# creating a new object of class IndexCMDI
my $object = new IndexCMDI();
# extract multiple XML schemas
my %xmlSchemas = $object->store_xml_schemas_in_hash("schemasNames.tmp");
# store all schema names by XML schema/CMDI profile
my %schemaNames = $object->store_schema_names_in_hash("schemasNames.tmp");
# 1) CSV from schema parser
$object->reset_dir("mapping");
# 2) directory with XSLTs to generate Solr index files
$object->reset_dir("indexSchemas");
# extract XML schemas from the Web service
foreach my $schema (keys %xmlSchemas)
{
$object->extract_xsl("$schema");
}
$object->extract_xsl_all();