sample_to_move.sh 807 Bytes
Newer Older
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
#!/bin/bash
# sample_to_move.sh
# generate a set of Qbox commands to move atoms to the positions
# in a given sample.
# use: sample_to_move.sh sample.xml
#
xsltproc - $1 << EOF
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fpmd="http://www.quantum-simulation.org/ns/fpmd/fpmd-1.0">
<xsl:output method="text" indent="yes"/>
<xsl:strip-space elements="*"/>
<xsl:template match="/fpmd:sample">
  <xsl:apply-templates/>
</xsl:template>
<xsl:template match="atomset">
  <xsl:apply-templates/>
</xsl:template>
<xsl:template match="atom">
  <xsl:text>move </xsl:text>
  <xsl:value-of select="@name"/> 
  <xsl:text> to </xsl:text>
  <xsl:value-of select="position"/> <xsl:text>
</xsl:text>
</xsl:template>
<xsl:template match="*"/>
</xsl:stylesheet>
EOF