Skip to content

generator ​

Implementation level ​

TypeStatus
CML extraction template
HTML5 representation

Template attributes ​

AttributeValue
sourceVASP outcar
idgenerator
nameProgram version
pattern\s*vasp\.\d.*
endPattern\s*executed\son.*
endOffset1
xml:basegenerator.xml

Input ​

 vasp.5.3.2 13Sep12 (build Apr  2 2013 11:33:10) complex

 executed on             LinuxIFC date 2014.03.06  12:09:30

Output text ​

xml
<comment class="example.output" id="generator">
        <module cmlx:templateRef="generator">
            <scalar dataType="xsd:string" dictRef="cc:program">vasp</scalar>
            <scalar dataType="xsd:string" dictRef="cc:subversion">13Sep12 (build Apr  2 2013 11:33:10) complex</scalar>
            <scalar dataType="xsd:string" dictRef="v:platform">LinuxIFC</scalar>
            <scalar dataType="xsd:date" dictRef="cc:rundate">2014-03-06T12:09:30.000+01:00</scalar>
            <scalar dataType="xsd:string" dictRef="cc:programVersion">5.3.2</scalar>
        </module> 
    </comment>

Template definition ​

xml
<record>\s*&#123;A,cc:program&#125;\.&#123;I,x:programMajor&#125;\.&#123;I,x:programMinor&#125;.&#123;I,x:programMicro&#125;[\.\s]&#123;X,cc:subversion&#125;</record>
<record repeat="1" />
<record>\s*executed\son&#123;A,v:platform&#125;date&#123;X,x:date&#125;</record>
<transform process="pullup" xpath=".//cml:scalar" repeat="2" />
<transform process="createDate" xpath=".//cml:scalar[@dictRef='x:date']" format="yyyy'.'MM'.'dd  HH:mm:ss" />
<transform process="addChild" xpath="." elementName="cml:scalar" dictRef="cc:programVersion" value="$string(concat( //cml:scalar[@dictRef='x:programMajor'], '.' , //cml:scalar[@dictRef='x:programMinor'], '.' ,//cml:scalar[@dictRef='x:programMicro']))" />
<transform process="addAttribute" xpath=".//cml:scalar[@dictRef='cc:programVersion']" name="dataType" value="xsd:string" />
<transform process="addAttribute" xpath=".//cml:scalar[@dictRef='x:date']" name="dictRef" value="cc:rundate" />
<transform process="delete" xpath=".//cml:list" />
<transform process="delete" xpath=".//cml:scalar[contains(@dictRef, 'x:program')]" />