[Kalzium] [Blue-obelisk] XML-Format for (chemical) spectra

Daniel Franke franke.daniel at gmail.com
Mon Oct 10 17:42:34 CEST 2005


> Question: Is this format ok for BO? It is for me but as I stated, I don't
> know to much about XML.
>
> <spectra>
>  <spectrum
>  intensity="50"
>  wavelength="949.7430"
>  aki="0.34375"
>  energy1="0.0000" energy2="105291.6443"
>  electronconfig1="1s" electronconfig2="5p"
>  term1="2S" term2="2P&deg;"
>  J1="1/2" J2="1/2.3/2"
>  />
> </spectra>

Carsten, 

from what I know of XML, one should try to favour elements over attributes. 
In this case:

<spectra>
  <spectrum>
    <intensity>50</intensity>
    <wavelength>949.7430</wavelength>
    <aki>0.34375</aki>
    <energy>0.0000</energy>
    <energy>105291.6443</energy>
    <electronconfig>1s</electronconfig>
    <electronconfig>5p</electronconfig>
    <term>2S</term>
    <term>2P&deg;</term>
    <J>1/2</J>
    <J>1/2.3/2</J>
  </spectrum>
</spetra>

Your suggestion is somewhat troublesome if
 a) there is a n-th energy/electronconfig/term/J 
 b) any of your attributes would need an attribute 

Using elements instead covers both issues, adding attributes, e.g. additional 
descriptive attributes/tags is easy, and multiple 
energy/electronconfig/term/J are no problem either. In addition, an 
appropiate Schema may limit the number of occurences of any of these elements 
to two (if necessary).

Regards
	Daniel


P.S. A good read for XML/Schema is

    Eric van der Vlist, 2002
    XML Schema
    ISBN 0596002521

http://www.amazon.com/exec/obidos/tg/detail/-/0596002521/qid=1128958625/sr=8-2/ref=pd_bbs_2/103-2217024-1902234?v=glance&s=books&n=507846






More information about the Kalzium mailing list