Message: Re: problem with XML file Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: problem with XML file 

Keywords: problem reading xml file
Forum: Analysis
Re: Question problem with XML file (Maddalena Antonello)
Date: 10 Oct, 2006
From: Guy Barrand <Guy Barrand>

   Hello Maddalena

  Then, after gunzipping your .aida xml file and wandering in it / 
 trying various things with a jas3-0.8.2 on my MacIntel ; it appears that
 there is definitely a misunderstanding / disagreement in the way to 
 specify the default value of a column of a tuple ; at lease between 
 OpenScientist-15 and jas3-0.8.2. 
  It appears that I produce something like : 
      <column name="INTE1" type="int" default="0"/>
 and that the string : default="0" is not understood by jas3-0.8.2.
 I can arrange in a further release of my things to not produce this
 string in case the value is the default (which is anyway a good thing
 to do to minimize file size) ; but remains anyway that it seems that
 we have a misunderstanding on how to put this default value in the XML
 between various groups.
  I am going to raise the point on the AIDA mailing list.

  Anyway, being on XML and then on ascii files, will permit, with the 
 majic of UNIX command, to come with some fix. Below is a copy of a shell 
 script that remove the default="0" string without loss of information.
 With that I can read the file with jas3-0.8.2 on my MacIntel.

  Not so great but it should permit you to move.

    Cheers

Then the to_jas3.sh shell script : 

#!/bin/sh -f

#
#  USAGE :
#   ( UNIX> chmod a+x to_jas3.sh )
#     UNIX> to_jas3.sh xxx.aida
#     UNIX> <start jas3>
#     File/Open xxx_jas3.aida
#
#  xxx.aida should be a compressed AIDA xml file.
#  The script produces a xxx_jas3.aida compressed file.
#  This script :
#  - copies xxx.aida in xxx_jas3.aida.gz
#  - gunzip xxx_jas3.aida.gz
#  - replace with a "sed" the string : 
#      default="0"
#    by nothing.
#  - recompress the file.
#  - rename the xxx_jas3.aida.gz in xxx_jas3.aida
#  - the file xxx_jas3.aida should be readeable by jas3.
#

if [ $# != 1 ] ; then
  echo "Give the name of a compress aida xml file as first argument."
  echo "The file name should be of the form xxx.aida"
  exit
fi

# Extract file name. If given file is xxx.aida, then get xxx.
file_jas3=`basename $1 | sed -e 's#.aida##g'`
# Build a new name xxx_jas3
file_jas3=${file_jas3}_jas3
echo ${file_jas3}

# have a copy of the file :
/bin/cp $1 ${file_jas3}.aida.gz
# uncompress :
gunzip ${file_jas3}.aida.gz

# replace default="0" by nothing :
sed -e 's# default="0"##g' ${file_jas3}.aida > tmp
mv tmp ${file_jas3}.aida

# compress the corrected file :
gzip ${file_jas3}.aida
/bin/mv ${file_jas3}.aida.gz ${file_jas3}.aida






Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

 Add Message Add Message
to: "Re: problem with XML file"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]